0% found this document useful (0 votes)
213 views2 pages

MATLAB Cheat Sheet Signals Systems

This MATLAB cheat sheet provides essential commands for working with signals and systems, including signal definition, convolution, step and impulse responses, frequency domain analysis, and transfer functions. It covers key operations such as plotting poles and zeros, system response to custom inputs, and time shifting and scaling. The document serves as a quick reference for implementing various signal processing techniques in MATLAB.

Uploaded by

masegokgokong574
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
213 views2 pages

MATLAB Cheat Sheet Signals Systems

This MATLAB cheat sheet provides essential commands for working with signals and systems, including signal definition, convolution, step and impulse responses, frequency domain analysis, and transfer functions. It covers key operations such as plotting poles and zeros, system response to custom inputs, and time shifting and scaling. The document serves as a quick reference for implementing various signal processing techniques in MATLAB.

Uploaded by

masegokgokong574
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

MATLAB Cheat Sheet for Signals and Systems

1. Signal Definition
--------------------
t = 0:0.01:10; % Time vector
x = sin(2*pi*5*t); % 5 Hz sine wave

2. Convolution
--------------
y = conv(x1, x2); % Linear convolution
y = conv(x1, x2, 'same'); % Same length as x1

3. Step & Impulse Responses


---------------------------
num = [1]; % Numerator of H(s)
den = [1 3 2]; % Denominator of H(s)
sys = tf(num, den);
step(sys); % Step response
impulse(sys); % Impulse response

4. Frequency Domain (Fourier, Spectrum)


---------------------------------------
X = fft(x); % FFT of signal
f = (0:length(X)-1)*(fs/length(X)); % Frequency axis
plot(f, abs(X)); % Magnitude spectrum

5. Laplace & Transfer Functions


-------------------------------
s = tf('s');
H = (s+1)/((s+3)*(s+2)); % H(s)

6. Poles and Zeros


------------------
pzmap(H); % Plot poles & zeros
pole(H) % List poles
zero(H) % List zeros

7. System Response to Custom Input


----------------------------------
lsim(sys, input, t); % Response to any signal

8. Time Shifting & Scaling


--------------------------
x_shifted = [zeros(1,N), x]; % Right shift by N
x_scaled = x([Link]nd); % Downsample

You might also like