Signal and system experiment

Experiment with MATLAB

Exponential signal

The expression is, where a is a real number. If a>0, the signal grows with time; if a<0, the signal decays with time; if a=0, the signal becomes a DC signal. In fact, the exponential signal of attenuation is encountered more frequently.
It can be expressed by the function exp in MATLAB, and its calling form is: y=K exp(at )

Draw the waveforms of the three signals

Insert picture description here
Insert picture description here
Insert picture description here

Generate rectangular pulse directly in MATLAB, periodic rectangular pulse

Periodic rectangular wave (square wave) signal:

It is represented by the square function in MATLAB, and its calling form is

y=square(t,D UTY)

Its function is similar to sin(t), which is used to generate a periodic square wave signal with a duration of t and an amplitude of ±1. The DUTY parameter represents the duty cycle, that is, the positive value in a period of the signal. percentage. For example, the MATLAB reference program for a periodic square wave signal with a frequency of 30 Hz is as follows:

Show the code below

t=-2*pi/100:pi/1024:2*pi/100;
y=square(2*pi*30*t,50);
plot(t,y);
grid
ylim([-1.5 1.5])

Insert picture description here

Guess you like

Origin blog.csdn.net/aqiuisme/article/details/109005852