Sunteți pe pagina 1din 25

DIGITAL FILTER DESIGN:

FREQUENCY SAMPLING METHOD


22 26 Lectures 22-26

Digital Signal Processing
A Practical Aproach
Second Edition
Emmanuel C. Ifeachor
Barrie W. Jervis
Chapter 7: FIR filter Design
Frequency Sampling Method
An alternate approach to Fourier Transform
Windowmethod
The filter coefficients can be calculated based on
the specified magnitudes of the desired filter
frequency response, distributed uniformly in
frequency domain
More flexibility
Freq. Samp. Method
Create an ideal specification of the filter in the
frequency-domain
Take Inverse Discrete Fourier Transform to get the
time-domain impulse response of the filter
Remember, in window method we took IDTFT, here
we take the IDFT
Derivation
Suppose H(k) represents the sampled version of the
ideal magnitude response of the desired filter, so,
h[n] i.e. IDFT of H(k), would represent its impulse
response
N
kn
j
N
k
e k H
N
n h
t 2
1
0
) (
1
] [

=
=
( ) ( ) | |
N
kn
N
kn
N
k
j k H
N
n h
t t 2 2
1
0
sin cos ) (
1
] [ + =

=
We have established that for linear phase response, we
require the impulse response to be symmetric (taking
N as odd number)
( ) ( ) | |
N
kn
N
kn
k
j k H
N
n h
N
t t 2 2
0
sin cos ) (
1
] [
2
1
+ =

=
Now, there is another issue with this equation
There is a possibility that h[n] may be complex, i.e. it
might include the real component & the
quadrature (imaginary) component
To avoid the requirement of quadrature processing in
time domain, we shall have to make sure that the
impulse response is real
This can only happen if
a) H(0) is real
b) H(k) = H*(N-k)
This concept is illustrated in the figure on next slide
Graph courtesy DSP by Ifeachor & Jervis, pp. 380
N = 15
k = 0, 1, . . . , 14
Filter Design Steps
Given the filter length N, specify the magnitude
frequency response for the normalized frequency
range from 0 to Fs :
Calculate the FIR filter co-efficients
2
1
,..., 1 , 0
N-
k
N
kF
f
s
k
= =
| |
(
(

+ =

2
1
1
) ( 2
) 0 ( cos ) ( 2
1
] [
N
k
N
n k
H k H
N
n h
o t
2
1
=
N
o
Example: Design a low-pass FIR filter with the following
specs using the frequency sampling method,
Pass band : 0-5 KHz
Sampling frequency : 18 KHz
filter length : 9
The ideal frequency response can be easily constructed
We need to sample it at
4 , 3 , 2 , 1 , 0 , 2
9
18 x
= = = = k KHz k
k
N
kF
f
s
k
4
2
1
=

=
N
o
The pass-band edge frequency is 5 KHz, which would
actually fall between frequency bins 2 & 3
k =2 4 Hz
k =3 6 Hz
Well choose k=3, since k=2 would mean that the
component at 5 KHz would be stopped
|H(k)|
k 1 0 2 3 4 5 6 7 8
( ) ( )
( )( )
( )
( )( )
(

+ +
)
`


+
)
`


+ = 0 0
9
4 2 2
cos 2 2
9
4 1 2
cos 1 2 0
9
1
] [
n
H
n
H H n h
t t
for n = 0, 1, 2, 3, 4

=
=
=
4 , 3 0
2 , 1 , 0 1
) (
k
k
k H
( ) ( )
(

)
`


+
)
`


+ =
9
4 4
cos 2
9
4 2
cos 2 1
9
1
] [
n n
n h
t t
for n = 0, 1, 2, 3, 4
| | 0725 . 0 53 . 1 879 . 1 1
9
1
] 0 [ = + = h

=
=
=
4 , 3 0
2 , 1 , 0 1
) (
k
k
k H
( ) ( )
(

)
`


+
)
`


+ =
9
4 4
cos 2
9
4 2
cos 2 1
9
1
] [
n n
n h
t t
( ) ( )
(

)
`


+
)
`


+ =
9
4 0 4
cos 2
9
4 0 2
cos 2 1
9
1
] 0 [
t t
h
(

)
`

+
)
`

+ =
9
16
cos 2
9
8
cos 2 1
9
1
] 0 [
t t
h
| | 111 . 0 1 1 1
9
1
] 1 [ = = h
( )( ) ( )( )
(

)
`


+
)
`


+ =
9
4 2 2 2
cos 2
9
4 2 1 2
cos 2 1
9
1
] 2 [
t t
h
| | 059 . 0 879 . 1 347 . 0 1
9
1
] 2 [ = + = h
( ) ( )
(

)
`


+
)
`


+ =
9
4 4
cos 2
9
4 2
cos 2 1
9
1
] [
n n
n h
t t
( ) ( )
(

)
`


+
)
`


+ =
9
4 1 4
cos 2
9
4 1 2
cos 2 1
9
1
] 1 [
t t
h
(

)
`

+
)
`

+ =
9
12
cos 2
9
6
cos 2 1
9
1
] 1 [
t t
h
( )( ) ( )( )
(

)
`


+
)
`


+ =
9
4 3 2 2
cos 2
9
4 3 1 2
cos 2 1
9
1
] 3 [
t t
h
| | 31993 . 0 347 . 0 532 . 1 1
9
1
] 3 [ = + + = h
( )( ) ( )( )
(

)
`


+
)
`


+ =
9
4 4 2 2
cos 2
9
4 4 1 2
cos 2 1
9
1
] 4 [
t t
h
| | 55 . 0 2 2 1
9
1
] 4 [ = + + = h
Using the symmetry property, we can find the remaining coeffs
55 . 0 ] 4 [ = h
0723 . 0 ] 8 [ ] 0 [ = = h h
111 . 0 ] 7 [ ] 1 [ = = h h
059 . 0 ] 6 [ ] 2 [ = = h h
31993 . 0 ] 5 [ ] 3 [ = = h h
0 1000 2000 3000 4000 5000 6000 7000 8000 9000
-600
-400
-200
0
Frequency (Hz)
P
h
a
s
e

(
d
e
g
r
e
e
s
)
0 1000 2000 3000 4000 5000 6000 7000 8000 9000
-60
-40
-20
0
20
Frequency (Hz)
M
a
g
n
i
t
u
d
e

(
d
B
)
Example: Design a FIR low-pass filter using the
frequency sampling method, with the following spec
Pass band : 0-5 KHz
Sampling frequency : 18 KHz
filter length : 15
Solve it
Optimizing the amplitude resp.
From the graph for the previous example we
observed that there were large ripples in the stop
band
Gibbs effect, caused due to discontinuity
This is similar to what we observed in the FT-W
method when rectangular window was used
In that case we used a window function to
smoothen the discontinuity, trading it off with the
transition width
Graph courtesy DSP by Ifeachor & Jervis, pp. 384
For a lowpass filter, the stop-band attenuation
increases, approximately, by 20 dB for each
transition band bin (citing Rabiners work in 1970),
with a corresponding increase in the transition
width
Approx. stop-band attenuation : (25+20M) dB
Approx. transition width : (M+1)Fs/N
Where M = number of bins in transition band & N is the
length of the filter impulse response
The key to using transition width bins is to choose
their values properly, to get the required
attenuation & so that bins are not used
Rabiner, also went ahead and calculated some
optimized values of these transition width bins and
are given on next slide
| |
(


} stopband in the w {
) ( ) ( max
minimize
} ,..., , {
2 1
w H w H W
d
T T T
M
Graph courtesy DSP by Ifeachor & Jervis, pp. 384
Example: Design a FIR low-pass filter using the
frequency sampling method, with the following spec
Pass band : 0-5 KHz
Sampling frequency : 18 KHz
filter length : 15
stop band attenuation : 42 dB
Solve it
Comparison of Filter Design Methods
H
d
()

H
d
()
or H(k)

Window based method Frequency sampling method


( ) ( )
k
sampling
d
H H e e
( ) ( ) t h H
d
F
d

1
e
( ) ( ) K n n h k H
DFT
s s

0
1
( ) ( ) n h n h
truncate
d

( ) ( ) e H n h
DTFT

( ) ( ) e H n h
DTFT

( ) ( ) n h t h
d
Sampling
d

S-ar putea să vă placă și