Professional Documents
Culture Documents
Course Code:
Course Name:
EEE 420
Digital Signal Processing
M -1
n=0
n=0
H z = h n z -n = z - M -1 h n z M -1-n
which has M - 1 poles at the origin z = 0 (trivial poles) and M - 1 zeros located anywhere
in the z-plane. The frequency response function is
M -1
H e jw = h n e-jw ,
- p w
n=0
M -1 / 2
n=0
H e jw =
a n coswn
e -jw M -1 /2
a 0 = h
M -1
- n
2
a n = 2h
Since then, we have
1 n
M -3
2
H r w =
M -1 / 2
a n coswn
n=0
M /2
n=1
H e jw =
w n - e -jw M -1 /2
2
b n cos
where
M
- n
2
b n = 2h
Hence,
H r w =
M /2
n = 1,2,...,
b n cos
n=1
M
2
w n -
2
M /2
b n cos
n=1
n - 0
2
jw
M -1 / 2
n=1
-j 2 w M -1 /2
c n sinwn e
where
M -1
- n
2
c n = 2h
Hence,
H r w =
Note that at
w = 0 and w =
n = 1,2,...,
M -1
2
M -1 / 2
c n sinwn
n=1
we have H r w 0 , regardless of
c n or h n .
M /2
n=1
H e jw =
where
w M -1 /2
2
j
1
d n sin w n - e
2
M
- n
2
d n = 2h
and
H r w =
M /2
d n sin
n = 1,2,...,
n=1
M
2
w n -
2
6 5 2 1 1 4]
d) h n [ 4 1 1 2 5 6
6 5 2 1 1 4]
c) h n [4 1 1 2 5 0 5 2 1 1 4]
Determine the Type of the Linear-Phase FIR filters. Find the amplitude response H r w and
locations of the zeros of H z . Also plot the impulse response, amplitude response,
coefficients, and the zero locations.
WINDOW DESIGN TECHNIQUES
Summary of commonly used window function characteristics.
Window
Transition
Min. Stopband
Width w Exact
Name
Approximate
Attenuation
Values
4
1.8
Rectangular
21 dB
M
M
8
6.1
Bartlett
25 dB
M
M
8
6.2
Hanning
44 dB
M
M
8
6.6
Hamming
53 dB
M
M
12
11
Blackman
74 dB
M
M
MATLAB provides several routines to implement window functions discussed above table.
Using these routines, we can use MATLAB to design FIR filters based on the window
technique, which also requires an ideal lowpass impulse response hd n as shown below.
function hd=ideal_lp(wc,M);
% Ideal LowPass filter computation
% -------------------------------% [hd] = ideal_lp(wc,M);
% hd = ideal impulse response between 0 to M-1
% wc = cutoff frequency in radians
% M = length of the ideal filter
%
alpha = (M-1)/2;
n = [0:1:(M-1)];
m = n - alpha +eps;
% add smallest number to avoi divided by zero
hd = sin(wc*m)./(pi*m);
To display the frequency domain plots of digital filters, MATLAB provides the freqz routine.
Using this routing, we can developed a modified version, called freqz_m, which returns the
magnitude response in absolute as well as dB scale, the phase response, and the group delay
response as shown below.
function [db,mag,pha,grd,w] = freqz_m(b,a)
% Modified version of freqz subroutine
% -----------------------------------% [db,mag,pha,grd,w] = freqz_m(b,a)
% db = relative magnitude in dB computed over 0 to pi radians
% mag = absolute magnitude computed over 0 to pi radians
% pha = Phase response in radians over 0 to pi radians
% grd = Group delay over 0 to pi radians
%
w = 501 frequency samples between 0 to pi radians
%
b = numerator polynomial of H(z)
(for FIR: b=h)
%
a = denominator polynomial of H(z)
(for FIR: a=[1])
%
[H,w] = freqz(b,a,1000,'whole') ;
H = (H(1:1:501))';
w = (w(1:1:501))';
mag = abs(H);
db = 20*log10((mag+eps)/max(mag));
pha = angle(H);
grd = grpdelay(b,a,w);
Assignment 3
3. Design a digital FIR lowpass filter with the following specifications:
wp = 0.2
ws = 0.3
R p = 0.25dB
As = 50dB