You are on page 1of 45

F E AR OF T HE L OR D I S T HE B E GI NNI NG OF

WI S DOM
SIGNALS & SYSTEM
ANALYSIS USING MATLAB
By

Mr. Anish Benny
Asst. Professor
SIGNALS & SYSTEM
Signals and systems deal with various types of
signals and the analysis of the system.
Signals can be elementary type or derived type.
Elementary signals are impulse signal, step signal
and ramp signal.
Derived signals are sinusoidal signals, exponential
signals, pulse etc.
Matlab can be used for generating all types of
signals.
Signals and systems toolbox is employed for theses
purpose
KITES - 2014, RIT PAMPADY
SYSTEM
A is an interconnection of components forming a
particular configuration to provide a desired system
response
Mobile phone
Computer
Robotic arm
Automobile cruise control system etc.
KITES - 2014, RIT PAMPADY
Basic Signals & System Components

System
- The device which will generate response
according to the given input

Process
System
Input
signal
Output
CONCEPT OF A SYSTEM
KITES - 2014, RIT PAMPADY
SIGNALS & SYSTEM MODELLING
Time domain modeling is done on both the signals
and system to get the mathematical equation.
Time domain model (both continuous and
discrete)is needed for further analysis.
By applying a frequency domain transformation on
the above time domain model will result in Transfer
Function (TF) of the system and frequency spectrum
of the signal.
By using the model of a system we can analyze the
system for various properties like linearity, time
invariance, stability etc.

KITES - 2014, RIT PAMPADY
STEP SIGNAL
KITES - 2014, RIT PAMPADY
VARIOUS FORMS OF STEP SIGNAL
KITES - 2014, RIT PAMPADY
EXAMPLE
KITES - 2014, RIT PAMPADY
EXAMPLE
KITES - 2014, RIT PAMPADY
RAMP FUNCTION
KITES - 2014, RIT PAMPADY
IMPULSE SIGNAL
KITES - 2014, RIT PAMPADY
EXAMPLE SYSTEM MODELING
KITES - 2014, RIT PAMPADY
Find the model of the system? Take v1(t) as input
and v2(t) as the output.



Solution
EXAMPLE CIRCUIT MODELING
Find the model of the system? Take v1(t) as input
and v2(t) as the output.



Solution

KITES - 2014, RIT PAMPADY
TRANSFER FUNCTION OF THE MODEL
Case 1
By applying Laplace transform we get,
RCSV
2
(s)+V
2
(s) = V
1
(s)
Output/Input = V
2
(s)/ V
1
(s) = 1/(SRC + 1)

Case 2
By applying Laplace transform we get,
LCS
2
V
2
(s)+RCSV
2
(s)+V
2
(s) = V
1
(s)
Output/Input = V
2
(s)/ V
1
(s) = 1/(S
2
LC + SRC + 1)
KITES - 2014, RIT PAMPADY
MATLAB COMMANDS
ss - Specify state-space models or convert LTI model to state
space
tf - Create or convert to transfer function model
zpk - Create or convert to zero-pole-gain model
bodeplot - Plot Bode frequency response and return plot
handle
impulseplot - Plot impulse response and return plot handle
pzplot - Plot pole-zero map of LTI model and return plot handle
stepplot - Plot step response of LTI systems and return plot
handle

KITES - 2014, RIT PAMPADY
conv - Convolution and polynomial multiplication
deconv - Deconvolution and polynomial division
fourier Finds the Fourier transform
ifourier - Inverse Fourier transform
laplace Finds the Laplace transform
ilaplace - Inverse Laplace transform
ztrans Finds the Z transform
iztrans - Inverse Z transform
sawtooth - Sawtooth or triangle wave
square - Square wave
gensig - Generate test input signals for lsim

KITES - 2014, RIT PAMPADY
MATLAB COMMANDS
allmargin - All crossover frequencies and corresponding
stability margins
bode - Bode diagram of frequency response
bodemag - Bode magnitude response of LTI models
evalfr - Evaluate frequency response at given frequency
freqresp - Evaluate frequency response over frequency grid
frd - Create or convert to frequency-response data models
margin - Gain and phase margins and associated crossover
frequencies
impulse - Impulse response of LTI model
step - Step response of LTI systems

KITES - 2014, RIT PAMPADY
MATLAB COMMANDS
MATLAB COMMANDS
bandwidth - Frequency response bandwidth
lti/order - LTI model order
pole - Compute poles of LTI system
zero - Transmission zeros of LTI model
pzmap - Compute pole-zero map of LTI models
ss2tf - Convert state-space filter parameters to transfer
function form
tf2ss - Convert transfer function filter parameters to state-
space form
feedback - Feedback connection of two LTI models
KITES - 2014, RIT PAMPADY
CONTINUOUS TIME SYSTEM ANALYSIS
Transfer Function Representation
Time Simulations
Frequency Response Plots
Control Design
State Space Representation
TRANSFER FUNCTION
REPRESENTATION
Tf2zp
Zp2tf
Feedback
Parallel
series

CONT
Transfer functions are defined in MATLAB by storing
the coefficients of the numerator and the
denominator in vectors. Given a continuous-time
transfer function
B(s)
H(s) = ---------
A(s)
CONT
Where B(s) = b
M
s
M
+b
M-1
s
M-1
++b
0
and A(s) = a
N
s
N
+a
N-1
s
N-1
++a
0

Store the coefficients of B(s) and A(s) in the vectors
num = [b
M
b
M-1
b
0
]
den = [a
N
a
N-1
a
0
]

EXAMPLE
5s+6
H(s) = ----------------
s
3
+10s
2
+5
num = [5 6];
den = [1 10 0 5];

all coefficients must be included in the vector, even
zero coefficients
CONT
To find the zeros, poles and gain of a transfer
function from the vectors num and den which
contain the coefficients of the numerator and
denominator polynomials:
[z,p,k] = tf2zp(num,den)

EXAMPLE
num = [5 6];
den = [1 10 0 5];
[z,p,k] = tf2zp(num,den)

z = -1.2000
p = -10.0495 0.0248+0.7049i 0.0248-0.7049i
k = 5
EXAMPLE CONT
(s-z
1
)(s-z
2
)...(s-z
n
)
H(s) = K --------------------------
(s-p
1
)(s-p
2
)...(s-p
n
)

5*(s+1.2)
----------------------------------------------------------
(s+10.0495)(s-{0.0248+0.7049i})(s-{0.0248-0.7049i})

CONT
To find the numerator and denominator
polynomials from z, p, and k:
[num,den] = zp2tf(z,p,k)
To reduce the general feedback system
to a single transfer function:
T(s) = G(s)/(1+G(s)H(s))
[numT,denT]=feedback(numG,denG,numH,denH);
CONT
To reduce the series system to a single transfer function,
T(s) = G(s)H(s)
[numT,denT] = series(numG,denG,numH,denH);
To reduce the parallel system to a single transfer
function, T(s) = G(s) + H(s)
[numT,denT] = parallel(numG,denG,numH,denH);


TIME SIMULATIONS
residue
Step
Impulse
lsim
CONT
[R,P,K] = residue (B,A) finds the residues, poles and
direct term of a partial fraction expansion of the
ratio of two polynomials B(s)/A(s)
The residues are stored in r, the corresponding poles
are stored in p, and the gain is stored in k.
EXAMPLE
If the ratio of two polynomials is expressed as
b(s) 5s
3
+3s
2
-2s+7
------- = -------------------
a(s) -4s
3
+8s+3

b = [ 5 3 -2 7]
a = [-4 0 8 3]
EXAMPLE CONT
r = -1.4167 -0.6653 1.3320
p = 1.5737 -1.1644 -0.4093
k = -1.2500

B(s) R(1) R(2) R(n)
------ = -------- + --------- + ... + --------- + K(s)
A(s) s - P(1) s - P(2) s - P(n)
FIND THE RESPONSE OF A SYSTEM TO A
PARTICULAR INPUT
First store the numerator and denominator of the
transfer function in num and den, respectively.
To plot the step response:
step(num,den)
To plot the impulse response:
impulse(num,den)
CONT
For the response to an arbitrary input, use the
command lsim (linear simulation)
Create a vector t which contains the time values in
seconds
t = a:b:c;
Define the input x as a function of time, for
example, a ramp is defined as x = t
lsim(num,den,x,t);


FREQUENCY RESPONSE PLOTS
Freqs
Bode
Logspace
Log10
Semilogx
CONT
To compute the frequency response H of a transfer
function, store the numerator and denominator of
the transfer function in the vectors num and den.
Define a vector w that contains the frequencies for
which H) is to be computed, for example w = a:b:c
where a is the lowest frequency, c is the highest
frequency and b is the increment in frequency.
H = freqs(num,den,w)


CONT
To draw a Bode plot of a transfer function which has
been stored in the vectors num and den:
bode(num,den)

CONT
To customize the plot, first define the vector w which
contains the frequencies at which the Bode plot will be
calculated.
Since w should be defined on a log scale, the command
logspace is used.
For example, to make a Bode plot ranging in
frequencies from 0.1 to 100, define w by
w = logspace(-1,2);
The magnitude and phase information for the Bode plot
can then be found by:
[mag,phase] = bode(num,den,w);

CONT
To plot the magnitude in decibels, convert mag
using the following command:
magdb = 20*log10(mag);
To plot the results on a semilog scale where the y-
axis is linear and the x-axis is logarithmic:
semilogx(w,magdb)
For the log-magnitude plot :
semilogx(w,phase)

VERY SHORT SIMULINK TUTORIAL
In the Matlab command window write simulink.
The window that has opened is the Simulink Library
Browser.
It is used to choose various Simulink modules to use in your
simulation.
From this window, choose the File menu, and then New
(Model).
Now we have a blank window, in which we will build our model.
This blank window and the library browser window, will be the
windows well work with.
We choose components from the library browser, and
then drag them to our work window.
Well use only the Simulink library (also called toolbox) for now.
KITES - 2014, RIT PAMPADY
SIMULINK TUTORIAL
As we can see, the Simulink library is divided into several
categories:
1. Continuous Provides functions for continuous
time, such as integration, derivative, etc.
2. Discrete Provides functions for discrete time.
3. Functions & Tables Just what the name says.
4. Math Simple math functions.
5. Nonlinear Several non-linear functions, such as
switches, limiters, etc.
6. Signals & Systems Components that work
with signals.
7. Sinks Components that handle the outputs of the
system (e.g. display it on the screen).
8. Sources Components that generate source signals
for the system.
KITES - 2014, RIT PAMPADY
EXAMPLE OF SIMULINK
KITES - 2014, RIT PAMPADY
Two main libraries for manipulating signals
in Simulink:
Sources: generate a signal
Sink: display, read or store a signal
EXAMPLE OF SIMULINK
KITES - 2014, RIT PAMPADY
EXAMPLE OF SIMULINK
KITES - 2014, RIT PAMPADY

You might also like