You are on page 1of 1

Plotting the Frequency Response Using MATLAB

The frequency response of a system is the major way of characterizing how a system
behaves in the frequency domain. It is important to understand the frequency
characteristics of a given system rather than time domain characteristics alone for many
practical applications like filter design.
The frequency response of a system,
) H
is just the transfer function,
) s H
evaluated at
j s
. !requency response is usually a comple" valued function, so it can
be written as
) ) ) H H H =
, where
) H
is the magnitude response and
) H
is the phase response. #ou can use $%T&%' to plot the magnitude and phase
responses as follows(
)"ample(
* *
+
) ,
) +
)
- -
+ +

=
+

=
s s
s
s
s
s H
, to plot magnitude and phase responses use the
following command lines. .efine two vectors b and a where b is the coefficients of the
polynomial in the numerator, and a is the coefficients of the polynomial in the numerator.
/ote that they have to be the same length and start with the coefficient of the highest
order term. Then define w as the vector of frequencies over which you want to plot the
magnitude and phase responses.
00 b123 + 4+56
00 a12+ * *56
00 w123(.+(-7pi56
00 freqsb,a,w)
10
-1
10
0
-50
0
50
100
150
200
Frequency (rad/s)
P
h
a
s
e

(
d
e
g
r
e
e
s
)
10
-1
10
0
10
-0.96
10
-0.87
Frequency (rad/s)
M
a
g
n
i
t
u
d
e

You might also like