7 1
7 1
7 1
Rating:
Rating:
Lacuna, Karen D.
EC42FB1
7.1. Design a 3-tap FIR lowpass filter with a cutoff frequency of 1,500 Hz and a
sampling rate of 8,000 Hz using
a. rectangular window function
=0,
3
, ,
radians .
4 2 4
Solution:
c =2 f c T s =2 ( 1500 )
1
( 8000
)= 38
2 M +1=3
M =1
Lowpass filter
h ( n )=
sin ( c n )
for n 0
n
n=0
1 n 1
8
3
h ( 0 )=
=
sin
h ( 1 )=h (1 )=
w rec ( n )=1,M n M
3
(1 )
8
=0.29 40799888
(1)
3
3
hw ( 0 )=h ( 0 ) wrec ( 0 )= ( 1 )= =0.375
8
8
hw ( 1 )=h w (1 )=h ( 1 ) wrec ( 1 )=0.29 40799888 (1 ) =0.29 40799888
b0 =b2=0.29 40799888
b1=0.375
Transfer function
Difference equation
H ( z )=
Y ( z)
1
2
=0.29 40799888+0.375 z + 0.29 40799888 z
X ( z)
1
radians
f=
fs
Hz
2
{+
0.375+0.5881599776 cos ( )
|H ( e j )|
0.9631599776
0.963159977
6
1000
0.7908919086
0.790891908
6
2000
.375
.375
3
4
3000
-0.04089190858
0.040891908
58
4000
-0.2131599776
0.213159977
6
|H ( e j )|dB dB
0.32603144
09
2.03765735
2
8.51937464
5
27.7672523
8
13.4258866
8
Plot
[hz, w] = freqz( [0.2941 0.375 0.2941], [1], 512);
phi= 180*unwrap(angle(hz))/pi;
plot(w,20*log10(abs(hz))),grid;
xlabel(Frequency (radians));
ylabel(Magnitude Response (dB))
H ( e j)
0
45
90
45
0
( nM ) , M n M
w ham ( 0 )=0.54+0.46 cos
[ ]
( 0 )( )
=1
1
[ ]
( 1) ( )
=0.08
1
3
3
hw ( 0 )=h ( 0 ) wham ( 0 )= ( 1 ) = =0.375
8
8
hw ( 1 )=h w (1 )=h ( 1 ) wham ( 1 )=0.29 40799888 ( 0.08 )=0.0235263991
b0 =b2=0.0235263991
b1=0.375
Transfer function
Difference equation
H ( z )=
Y (z)
1
2
=0.0235263991+0.375 z +0.0235263991 z
X ( z)
f=
fs
Hz
2
0.375+0.0470527982 cos ( )
0.4220527982
1000
0.4082713527
2000
0.375
|H ( e j )|
0.422052798
2
0.408271352
7
0.375
|H ( e j )|dB dB
7.49266432
7.78102184
6
8.51937464
5
H ( e j)
degree
0
45
90
3
4
3000
0.3417286473
0.341728647
3
4000
0.3279472018
0.327947201
8
9.32637225
1
9.68392140
7
135
180
Plot
[hz, w] = freqz( [0.0235 0.375 0.0235], [1], 512);
phi= 180*unwrap(angle(hz))/pi;
plot(w,20*log10(abs(hz))),grid;
xlabel(Frequency (radians));
ylabel(Magnitude Response (dB))
7.3. Design a 5-tap FIR bandpass filter with a lower cutoff frequency of 1,600 Hz, an
upper cutoff frequency of 1,800 Hz, and a sampling rate of 8,000 Hz using
a. rectangular window function
b. Hamming window function.
Determine the transfer function and difference equation of the designed FIR system,
and compute and plot the magnitude frequency response for
=0,
3
, ,
radians .
4 2 4
Solution:
1
( 8000
)= 52
1
( 8000
)= 209
2 M +1=5
M =2
Bandpass filter
H L
h ( n )=
sin ( H n ) sin ( L n )
for n 0
n
n
n=0
M n M
9
2
20
5
1
h ( 0 )=
=
20
sin
h ( 1 )=h (1 )=
sin
h ( 2 )=h (2 )=
] [
9
2
( 1 ) sin ( 1 )
20
5
=0.01166027182
(1)
(1)
] [
9
2
(2 ) sin ( 2 )
20
5
=0.04436734622
(2)
( 2)
w rec ( n )=1,M n M
w rec ( 0 )=wrec ( 1 )=wrec (1 ) =w rec (2 )=w rec (2)=1
hw ( 0 )=h ( 0 ) wrec ( 0 )=
1
1
( 1 )= =0.05
20
20
Transfer function
Difference equation
H ( z )=
Y (z)
=0.04436734622+ 0.01166027182 z 1 +0.05 z2+0.01166027182 z30.04436734622 z4
X ( z)
1
|H ( e j )|=|{0.04 [ cos +isin ] +0.01+0.05 [ cos ( )isin ( ) ]+0.01[ cos ( 2 )isin ( 2 ) ]0.04 [ cos ( 3 )i sin
H ( e j) =
{+
if {0.04 [ cos +i sin ] +0.01+0.05 [ cos ( )i sin ( ) ] +0.01[cos ( 2 )i sin ( 2 ) ]0.04 [ cos ( 3 )isin ( 3 ) ] }> 0
if {0.04 [ cos +i sin ] +0.01+0.05 [ cos ( )i sin ( ) ] +0.01[cos ( 2 )i sin ( 2 ) ]0.04 [ cos ( 3 )isin ( 3 ) ] }< 0
radians
f=
fs
Hz
2
)iHsin
( e j(2) ) ]0.04 [ cos ( 3
{0.04 [ cos +i sin ] + 0.01+0.05|[Hcos( e(j )|i sin ( |)H] +0.01[cos
( e j )|dB dB( 2
-0.01
0.01
-40
180
1000
0.05-0.05i=0.07 -
0.07
-23.10
135
2000
-0.13i=0.13 -1.57
0.13
-17.72
90
3
4
3000
-0.03-0.03i= 0.04 -
0.04
-27.96
45
4000
2.36
0.05
0.05
-26.02
180
0.79
Plot
( nM ) , M n M
w ham ( 0 )=0.54+0.46 cos
[ ]
( 0 )( )
=1
1
[ ]
(1) ( )
=0.54
2
[ ]
(2) ( )
=0.08
2
Transfer function
H ( z )=3.55 x 103 +6.30 x 103 z1+ 0.05 z2 +6.30 x 103 z33.55 x 103 z4
Difference equation
H ( z )=
Y ( z)
=3.55 x 103 +6.30 x 103 z1 +0.05 z2+ 6.30 x 103 z 33.55 x 103 z4
X ( z)
Y ( z ) =3.55 x 103 X ( z)+6.30 x 103 z1 X ( z )+ 0.05 z2 X ( z )+ 6.30 x 103 z 3 X ( z )3.55 x 103 z4 X (z)
y ( n )=3.55 x 103 x( n)+6.30 x 103 x (n1)+0.05 x (n2)+ 6.30 x 103 x (n3)3.55 x 103 x (n4)
H ( e j ) =e j {3.55 x 103 [ cos +i sin ] +6.30 x 103 +0.05 [ cos ( ) +i sin () ]+6.30 x 103 [cos (2 ) +i sin (
H ( e j ) =e j {3.55 x 103 [ cos +i sin ] +6.30 x 103 +0.05 [ cos ( )isin ( ) ] +6.30 x 103 [cos ( 2 ) isin ( 2 )
|H ( e j )|=|{3.55 x 103 [ cos +i sin ] + 6.30 x 103 +0.05 [ cos ( )i sin ( ) ] +6.30 x 103 [ cos ( 2 )i sin ( 2 )]
H ( e j) =
{+
if {3.55 x 103 [ cos +isin ] +6.30 x 103+ 0.05 [ cos ( )i sin ( ) ] + 6.30 x 103 [cos ( 2 )isin ( 2 ) ]3.55 x 103 [ cos ( 3 )
if {3.55 x 103 [ cos +isin ] +6.30 x 103+ 0.05 [ cos ( )i sin ( ) ] + 6.30 x 103 [cos ( 2 )isin ( 2 ) ]3.55 x 103 [ cos ( 3 )
radians
f=
fs
Hz
2
j
))isin
( e j [)cos
)|dB dBx 103 [cos
H((2e
{3.55 x 103 [ cos +isin ] +6.30 x 103|+H0.05
| ( )i sin
|H( (e j)]+6.30
0.0555
0.0555
-25.11
180
1000
0.04-0.04i=0.06 -0.79
0.06
-24.44
135
2000
-0.0571i=0.0571 -1.57
0.0571
-24.87
90
3
4
3000
-0.02905533906-0.029i=
0.04
-27.96
45
4000
0.0303
-30.37
0.04 -2.36
-0.0303
Plot
H ( z )=3.55 x 103 +6.30 x 103 z1+ 0.05 z2 +6.30 x 103 z33.55 x 103 z4
7.5. Given an FIR lowpass filter design with the following specifications:
Passband (fpass)= 0800 Hz
Stopband (fstop)= 1,2004,000 Hz
Passband ripple = 0.1 dB
Stopband attenuation =40 dB
Sampling rate (fs) = 8,000 Hz,
determine the following:
a. window method
Solution:
a. window method
Passband ripple = 0.1 dB
Hence, it is hanning window method
f=
N=
|f stop f pass|
fs
1200800
=0.05
8000
3.1 3.1
=
=62
f 0.05
f c=
7.7. Given an FIR bandpass filter design with the following specifications:
Lower cutoff frequency (fl) = 1,500 Hz
Lower transition width =600 Hz
Upper cutoff frequency(fh) =2,300 Hz
Upper transition width = 600 Hz
Passband ripple =0.1 dB
Stopband attenuation = 50 dB
Sampling rate(fs) = 8,000 Hz,
f 1=
1500600
=0.1125
8000
f 2=
n=
2300600
=0.2125
8000
5
=44.4 which is approximately equal 45
0.1125
Solution:
a. transversal form, and write the difference equation for implementation
H ( z )=
Y (z)
=.25 0.5 z1+ 0.25 z 2
X ( z)
H ( z )=
Y (z)
1
2
=.25 0.5 z + 0.25 z
X ( z)
7.11. Determine the transfer function for a 5-tap FIR lowpass filter with a lower
cutoff frequency of 2,000 Hz and a sampling rate of 8,000 Hz using the frequency
sampling method.
Solution:
N=2 M +1=5
M =2
k =
2
k , k =0,1,2
5
H0
H1
H2
0.5
c =2 f c T s =2 ( 2000 )
1
( 8000
)= 2
Frequency Sampling
]}
2
2 k ( n3 )
1
h ( n )= 1+2 H k cos
, n=0,1,2
5
7
k=1
[ ]}
[ ]}
[ ]}
h ( 0 )=
1
4
1+2 cos
=0.1236
5
5
h ( 1 )=
1
2
1+ 2cos
=0.3236
5
5
h ( 2 )=
1
0
1+ 2cos
=0.6
5
5
b0 =b4 =0.1236
b1=b3=0.3236
b2=0.6
1
N=2 M +1=7
M =4
k =
2
k , k =0,1,2
5
H1
H3
H0
0
H2
0.35
0.75
1
( 8000
)= 38
1
( 8000
)= 34
Frequecny Sampling
]}
3
2 k ( n3 )
1
h ( n )= 0+ 2 H k cos
, n=0,1,2
7
7
k=1
{ [ ]}
h ( 0 )=
1
6
2 cos
=0.2574
7
7
h ( 1 )=
1
4
2 cos
=0.0636
7
7
h ( 2 )=
1
2
2 cos
=0.1781
7
7
h ( 2 )=
1
0
2 cos
=0.2857
7
7
{ [ ]}
{ [ ]}
{ [ ]}
b0 =b6 =0.1781
b1=b5=0.2574
b2=b4 =0.0636
b3 =0.2857
H ( z )=0.17810.2574 z10.0636 z2+ 0.2857 z3 0.0636 z40.2574 z 5 +0.1781 z6
7.15. In a speech recording system with a sampling rate of 10,000 Hz, the speech is
corrupted by broadband random noise. To remove the random noise while
preserving speech information, the following specifications are given:
Speech frequency range = 03,000 kHz
Stopband range = 4,0005,000 Hz
Passband ripple = 0.1 dB
Stopband attenuation = 45 dB
FIR filter with Hamming window.
Determine the FIR filter length (number of taps) and the cutoff frequency; use
MATLAB to design the filter; and plot the frequency response.
f=
|f stop f pass|
fs
40003000
=0.1
10000
N=
3.3 3.3
=
=33
f 0.1
cutoff frequency
f c=
b. filter length
f=
1600
=0.0363
44100
N lowpass=N highpass=
3.3
=90.91 which is approximately equal 91
0.0363
c. cutoff frequency
c =crossover frequency
c (low )=c (high )=2000 Hz