Professional Documents
Culture Documents
FIR Filter Design - New
FIR Filter Design - New
1. Linear Phase FIR Digital Filter. Introduction 2. Linear-Phase FIR Digital Filter Design: Window (Windowing) M th d Wi d (Wi d i ) Method
1
Topic: T i
Linear Phase FIR Digital Filter Introduction Filter.
advantages and disadvantages of linear phase FIR digital g g p g filters, linear phase conditions for FIR filters, four groups/kinds of linear phase FIR digital filters.
Special operations
Topic: T i
Linear-Phase Linear Phase FIR Digital Filter Design: Window (Windowing) Method
basic principles and algorithms, method description in time- and frequency-domain, Example A.: FIR filter design-rectangular window application, Gibbs phenomenon and different windowing applications, p g pp Example B.: FIR filter design at different window applications.
3
Differentiation:
y (t ) =
Integration:
dx(t ) dt
t
Y ( j ) = j X ( j )
y (t ) = x( ) d
Y ( j ) =
1 X ( j ) + X (0) ( ) j
HHP ( j ) (e 1
c 0
HBP ( j ) (e 1
HBS
(e j ) 1
c2 c1
c1 c2
c2 c1
c1 c2
( ) = t0
B. Comments on group delay function: Group delay function of ideal filters is constant:
( ) =
d ( ) d = [ t0 ] = t0 = const. d d
t0 =
M 1 2
12
All-Pass All Pass Filters: A filter is called all-pass if its magnitude all pass response is identically a positive constant ( H (e j ) = const). at all frequencies. The phase response of an all-pass filter frequencies all pass is not restricted and is allowed to vary arbitrarily as a function of the frequency. frequency
In general, a rational filter is all-pass if only if it has the same number of poles and zeros (including multiplicities), and each zero is the conjugate inverse of a corresponding pole: zk=1/pk.
Example:
0.8 z 1 H ( z) = 1 0.8 z 1
z1 = 1/ 0.8
p1 = 0.8
13 14
z1 = 1/ 0.8 = 1/ p1
FIR di it l filt h a fi it number of non-zero digital filter has finite b f coefficients of its impulse response:
M N : h(n) = 0 for n > M Mathematical model of a causal FIR digital filter: y ( n) = h( k ) x ( n k )
k =0 M 1
FIR
filters with exactly linear phase can be easily designed. This simplifies the approximation problem, in many cases, when one is only interested in designing of a filter that approximates an arbitrary magnitude response. Linear phase filters are important for applications where frequency dispersion due to nonlinear phase is harmful (e.g. speech processing and data transmission). implementing FIR filters. These include both nonrecursive and recursive realizations realizations.
16
Digital FIR filters cannot be derived from analogue g g filters, since causal analogue filters cannot have a finite impulse response. In many digital signal processing applications, FIR filters are preferred over their IIR 15 counterparts.
FIR filters realized non-recursively are inherently stable and free of limit cycle oscillations when implemented on a finite-word length digital system. The output noise due to multiplication round off errors in FIR filters is usually very low and the sensitivity to variations in the filter coefficients is also low. low Excellent design methods are available for various kinds of FIR filters with arbitrary specifications.
17
The linear phase condition is obtained by imposing symmetry conditions on the impulse response of the filter. In particular, we consider two different symmetry conditions for h(k): A. A Symmetrical impulse response:
H (e ) = h ( k )e
j k =0
M 1
j k
19
h( n)
M = 16
M 1 = 4 1 = 3 h(0) = h(3)
h(2) h(13) h(2)=h(13)
M 4 1 = 1 = 1 2 2
h(1) h(14) h(1)=h(14) h(0) h(15) h(0)=h(15)
21
22
H (e ) = h ( k )e
j k =0
M 1
j k
= h( k )e
k =0
4 1
j k
= h ( k )e
k =0
j k
H (e j ) = h(k )e jk =
k =0
M M 1 2 1 j 2 k =0
M 1
M 1 2 k =0
h( k ) e
e
j k
+e
j ( M 1 k )
= 2e
h( k )
M 1 2
M 1 j k 2
+e 2
M 1 j k 2
H (e j ) = e
M 1 2
= for M = 4 4.
23
M 1 2 h(k )cos k 2 k =0
h(k ) e jk + e k =0
j ( M 1 k )
M 1 2
H (e ) = e
M 1 2
H r ( ) f for H r ( ) 0 f for H r ( ) < 0 d ( ) M 1 = d 2 We observe that the phase response is a linear function of provided that H r ( ) is positive or negative. When H r ( ) changes the sign from positive to negative (or vice versa), the phase undergoes an abrupt change of radians radians. If these phase changes occur outside the pass-band of the filter we do not care, since the desired signal passing through the filter has no frequency content in the stopband.
26
M 1 j 2 H r ( ) e = M 1 H ( ) e j 2 + r
H (e j ) = H r ( )
( ) =
M 1 2 ( ) = M 1 2
h( n)
M = 15
M 1 = 4
h(6)=h(8)
h(0) = h(4) 1=
53 M 3 = 2 2
27
28
H (e ) = h ( k )e
j k =0
M 1
j k
=
M 3 2 k =0
H (e ) = e
j k
M 1 2
M 1 M 1 j 2 = h + e 2
h( k ) e
+e
j ( M 1 k )
M 1 j 2 H r ( ) e = M 1 H ( ) e j 2 + r
=e
M 1 j 2
M 1 M 1 M 3 j k j k 2 2 2 e +e M 1 h 2 + 2 h( k ) = 2 k =0
H (e j ) = H r ( ) M 1 2 ( ) = M 1 2
( ) =
d ( ) M 1 = d 2
=e
M 1 2
M 1 = 3
h(1)=-h(14)
k = 0,1,2,3
h(0) = h(3) h(1) = h(2) 4 M 1 = 1 = 1 2 2 k = 0,1,2,K, M 1 ,, , h(0) = h( M 1), h(1) = h( M 2), h(2) = h( M 3),K,
h(7)=-h(8)
h(0)=-h(15)
M M h 1 = h 2 2
31
32
H (e ) = h ( k )e
j k =0
M 1
j k
M 1 2 k =0
h( k ) e
M 1 j k 2
j k
j ( M 1 k )
H (e ) = e
M 1 +j 2 2
= 2 je
M M 1 2 1 j 2 k =0
h( k )
M 1 2
e 2j
M 1 j k 2
M 1 j +j 2 2 H r ( ) e = M 1 3 H ( ) e j 2 + j 2 r
H (e j ) = H r ( )
( ) =
=e
M 1 +j 2 2
M 1 2 h(k )sin k 2 k =0
d ( ) M 1 = d 2
M 1 + 2 2 ( ) = M 1 + 3 2 2
Here, the real-valued frequency response is given by M 1 H r ( ) = 2 h(k )sin k 2 k =0 M 1 H r (0) = 2 h(k )sin 0 k=0 2 k =0
M 1 2 M 1 2
h( n)
M = 17
h(1)=-h(15)
Low-pass and band-stop filters cannot possess an 0. antisymetrical impulse response because H r (0) 0
! !
35
h(0)=-h(16)
h(7)=-h(9)
36
M 1 = 4, k = 0,1,2,3,4 h(0) = h(4), h(1) = h(3), h(2) = h(2) h(2) = 0 ! 53 M 3 5 1 M 1 1= = 2= = 2 2 2 2 k = 0,1,2,K, M 1 h(0) = h( M 1), h(1) = h( M 2), h(2) = h( M 3),K, 1) 2) 3)
H (e j ) = h(k )e jk =
k =0
M 1
M 3 2 k =0
h( k ) e
e
M 1 j k 2
j k
j ( M 1 k )
= 2 je
M 1 j 2
M 3 2 k =0
h( k )
M 3 2
e 2j
M 1 j k 2
M 3 M +1 h = h , 2 2 M 1 M 1 h = h =0 2 2
M 1 +j 2 2
=e
M 1 j + 2 2
M 1 2 h(k )sin k 2 k =0
H (e ) = e
M 1 j +j 2 2 H r ( ) e = M 1 3 H ( ) e j 2 + j 2 r
H (e j ) = H r ( )
M 1 + 2 2 ( ) = M 1 + 3 2 2
! !
40
Low-pass and band-stop filters cannot possess an 0. antisymetrical impulse response because H r (0) 0
Since H (e j ) , the frequency response of any digital filter is a periodic in frequency, it can be expended in a Fourier series. The resultant series is of the form H (e ) =
j
k =
h ( k )e
j k
1 h( n) = 2
H (e
)e j n d
The coefficients h(k ) of the Fourier series are easily recognized as being identical to the impulse response of a digital filter. There are two difficulties with the application of the above given expressions for designing of FIR digital filters:
41 42
1. 1 The filter impulse response is infinite in duration duration, since the above given summation extends to . H (e ) = h (k )e 2. The filter is unrealizable (non-causal) because the i.e. impulse response begins at ; i e no finite amount of delay can make the impulse response realizable. j H (e ) = h(k )e jk k = Hence the filter resulting from a Fourier series representation of H (e j ) is an unrealizable (noncausal) IIR filter. In spite of that fact, the causal FIR filter can be designed by the approach illustrated in the next figures.
j j k k =
Summary
Non-Causal IIR filter: y ( n) =
k =
h( k ) x ( n k )
1 h( n) = 2
H (e ) =
k =
j
h ( k )e
j k
H (e
)e j n d
43
H ( e j ) = FT [h(n)] W ( e j )
Side lobes Central (main) lobe
1 Rectangularj jn window h( n) = e H (= 3 )e dn 2 N
W ( e j ) = FT [ w(n)] F ( e j )
n
Ripple! pp
n
45
F ( e j ) = H ( e j ) * W ( e j )
46
Gibbs Phenomenon
Problem: Given 1 , 2 , p and s , find the lowest complexity filter that meets specification Two Choices 1. 1 IIR Filt (Infinite Impulse Response, Filters (I fi it I l R 2. FIR Filters (Finite Impulse Response,
H (z) = B (z) A(z) H (z) = B (z)
Rectangular Windowing l i d i
h[n] = hd [n]wr [n]
Where
1, 0 n N 1 wr [n] = 0, otherwise 1 H (e ) = 2
j
H d (e j )Wr (e j ( ) )d
Prof Rao
Effects of Windowing g
W R (e ) =
e
n=0
N 1
=e
j ( N 1) 2
sin
(N )
2 2
sin
The width of the main lobe decreases as M increases The Area under sidelobes remains constant as M increases. The Width of the transition region increases with increase in width of the mainlobe of window..
Example: p
By the impulse response truncation method (by the windowing method at rectangular window application) design a low-pass filter of order N=15 with pass-band cut off frequency (pass-band edge frequency) f 0 = 1kHz . Frequency sampling is f S = 4 kHz .
Solution: f S = 4 kHz
1 h( n) = 2
H (e
jn
)e
jn
1 d = 2
/2
/2
1e j n d =
1 e = 2 jn / 2
/2
jn jn 2 1 e e 2 = n 2 j 2j
f 0 = 1kHz
0 =
1 j Low-pass filter: H (e ) = 0
2 2
59
1 e n
jn
e 2j
jn
sin n 2 = n
60
Problem: Solution :
sin n 2 for n = 0 0 h( n) = n 0
?
Rectangular window application:
1 h(0) = 2 1 = 2 =
/2
/2
H (e
)e j 0 d =
1d 1d =
1 /2 [ ] / 2 = 2
1 2
2 2 = 0.5
61
f ( n) = h( n)
=
0
n
Example: Phase Response E l Ph R
g ( n)
g(0)=f(-7) g(1)=f(-6)
( )
=
0
63
64
Next figures: Magnitude responses of the N-th order FIR low-pass digital filters with normalized cut off frequency / 2 , for N=5 25 50 100 The figures N 5, 25, 50, 100. confirm the above given statements concerning the Gibbs phenomenon phenomenon.
Comments: The major effect is that discontinuities of H (e j )became j transition bands between values on the either side of the discontinuity. Since the final frequency response of the filter is the circular convolution of the ideal frequency response with the windows frequency response
/2
G ( e j )
N = 50
/2
G ( e j )
N = 100
F (e j ) = H (e j ) * W (e j )
it is clear that the width of these transition bands depends on the width of the main (central) lobe of W (e j ) .
/2
/2
67
68
Some Commonly Used Windows The second effect of the windowing is that the ripple from the side lobes produces a ripple in the resulting frequency response response.
M 1 2 w(n) R for N n N N=
Rectangular: w(n) = 1
Bartlett: w(n) = 1
n N +1
a) Small width of the main lobe of the frequency response of the window containing as much the total energy as possible. b) Side lobes of the frequency response that decrease in energy rapidly as tends to .
69
Hann: w(n) =
1 2 n 1 cos 2 2 N + 1
Bartlett (triangular)
2 n / M , 0 n M 2 w[ n ] = 2 2 n / M , M / 2 n M 0, otherwise Hanning Hamming 0.5 0.5cos( n / M) 0 n M 2 ), 0.54 0.46cos(2n / M ), 0 n M w[n] = w[n] = 71 0, otherwise 0, otherwise
1. Compute
We see clearly that a wider transition region (wider mainlobe) is compensated by much lower side-lobes and thus less ripples.
Compute20 l 10 and select window type log Choose M, the filter order, to meet transition width Filter Coefficients h[ n ] = hd [ n ]w[ n ], 0 n M are given by
where c = ( p + s ) / 2 2,
74
Kaiser Window
w[n ] = I 0 [ (1 ( n
I0 ( )
) ) ]
1 2 2
, 0 n M , = M / 2
I 0 (.)is zeroth order modified Bessel function of the First Kind 2 (.5 x) m I ( x) = m! m =0 controls sidelobe level (Stopband Attenuation) Th filter order M controls the Mainlobe width The fil d l h M i l b id h
76
78
Example: p
Normalized frequency ( )
By the windowing method, design a low-pass filter of kHz order N 55 with pass-band cut off frequency f 0 = 1kH . d N=55 ith b d t ff f Frequency sampling is f S = 4 kHz.
Solution: For the results see the next figures. figures
79
80
20 * log10 H ( e j ) N=55 N 55
[dB]
20 * log10 H ( e j ) [dB]
Rectangular Window
Kaiser Window: alfa=3 Kaiser Window: alfa=10 Bartlett Window Kaiser Window: alfa=15 alfa 15 Kaiser Window: alfa=30 Hamming Window
Rectangular Window l i d
81
82