Ce105 - Digital Signal Processing ASSIGNMENT 5: FIR Filter Design
Ce105 - Digital Signal Processing ASSIGNMENT 5: FIR Filter Design
Ce105 - Digital Signal Processing ASSIGNMENT 5: FIR Filter Design
Choosing 25 L = filter coefficients using the Hamming window method:
( )
1 1
1
1600 500
2
. 0.2625
2 8000 2
p s
c
e e
t
e t
+ +
= = =
( )
2 2
2
3500 2300
2
. 0.725
2 8000 2
p s
c
e e
t
e t
+ +
= = =
0 500 1000 1500 2000 2500 3000 3500 4000
-1500
-1000
-500
0
500
Frequency (Hz)
P
h
a
s
e
(
d
e
g
r
e
e
s
)
0 500 1000 1500 2000 2500 3000 3500 4000
-100
-50
0
Frequency (Hz)
M
a
g
n
i
t
u
d
e
(
d
B
)
5
Program
% MATLAB program to create Figure in P1.3
%
N=25;Ftype=3;WnL=0.2625*pi;WnH=0.725*pi;Wtype=4;fs=8000;
Bham=firwd(N,Ftype,WnL,WnH,Wtype);
freqz(Bham,1,512,fs);
axis([0 fs/2 -130 10]);
1.4 Solution:
The normalized transition widths:
1
1500
2 0.375
8000
e t t A = = , and
2
1300
2 0.325
8000
e t t A = =
The filter lengths are determined using the Blackman window as:
1
2
29.33
11
33.8
L
L L
t
e
=
A =
0 500 1000 1500 2000 2500 3000 3500 4000
-2000
-1000
0
1000
Frequency (Hz)
P
h
a
s
e
(
d
e
g
r
e
e
s
)
0 500 1000 1500 2000 2500 3000 3500 4000
-100
-50
0
Frequency (Hz)
M
a
g
n
i
t
u
d
e
(
d
B
)
6
We choose an odd number 35 L = . The normalized lower and upper cutoff frequencies are
calculated as:
2 .1250
0.3125
8000
cL
t
e t = =
2 .2850
0.7125
8000
cH
t
e t = =
Program P1.4
% MATLAB program to create Figure in P1.4
%
N=35;Ftype=4;WnL=0.3125*pi;WnH=0.7125*pi;Wtype=5;fs=8000;
Bblack=firwd(N,Ftype,WnL,WnH,Wtype);
freqz(Bblack,1,512,fs);
axis([0 fs/2 -120 10]);
0 500 1000 1500 2000 2500 3000 3500 4000
-3000
-2000
-1000
0
Frequency (Hz)
P
h
a
s
e
(
d
e
g
r
e
e
s
)
0 500 1000 1500 2000 2500 3000 3500 4000
-100
-50
0
Frequency (Hz)
M
a
g
n
i
t
u
d
e
(
d
B
)
7
Example:
a) Design a 3-tap (L=3) FIR lowpass with cutoff frequency of 800Hz and
sampling rate of 8000Hz using Hamming window function.
b) Determine the transfer function and difference equation of the designed FIR
system.
c) Compute and plot the magnitude frequency response for 0, / 4, / 2, 3 / 4 e t t t =
and t radians.