next up previous
Next: Ideal filter characteristics Up: Evaluating the frequency response Previous: Algebraic evaluation

Graphical evaluation using MATLAB `freqz' and `plot'

freqz calculates the complex response tex2html_wrap_inline714 of a digital filter from the a and b coefficients of the DE . We must think of H(z) in the form :

displaymath742

Here eg tex2html_wrap_inline754 is the greatest (negative) power of z in X(z). b(1) is the first element of a MATLAB row vector b (it is what we would normally write tex2html_wrap_inline764 in these lectures).
So in our above example :

displaymath743

MATLAB instructions to use freqz :

b=[1,0,-1]
a=[1,0,0,0,0.25]
[H,w]=freqz(b,a,512) % do 512 frequencies in the range 0 to pi
M=abs(H)
P=angle(H)
plot(w,M,'o')        % plot amplitude response
plot(w,P,'o')        % plot phase response

Logarithmic (Bode) plots
Bode plots plot :

  1. Digital frequency tex2html_wrap_inline716 on a logarithmic scale
  2. Amplitude tex2html_wrap_inline768 on a logarithmic scale
  3. Phase shift P on a linear scale

Note the application of MATLAB semilogx for such plots.



Keith Jones
Tue Oct 27 11:32:15 EST 1998