Impulse Responses of Ideal Filters

You might also like

Download as ppt, pdf, or txt
Download as ppt, pdf, or txt
You are on page 1of 25

Impulse Responses of Ideal

Filters
• Ideal lowpass filter -

sin c n
hLP [n]   n ,    n  

• Ideal highpass filter -


 1  c , 
  n 0
hHP [n]  
sin(c n)
 n , n  0

Impulse Responses of Ideal
Filters
• Ideal bandpass filter -

sin(c 2n)  sin(c1n) , n  0


 n n
hBP [n]  
c 2 c1
    , n  0

Impulse Responses of Ideal
Filters
• Ideal bandstop filter -

 1  (c 2  c1 ) , 
  n 0
hBS [n]  
sin(c1n) sin(c 2 n)
 n  n , n  0

Gibbs Phenomenon
• Gibbs phenomenon - Oscillatory behavior in
the magnitude responses of causal FIR filters
obtained by truncating the impulse response
coefficients of ideal filters
1.5
N = 20
N = 60
1
Magnitude

0.5

0
0 0.2 0.4 0.6 0.8 1
/
Gibbs Phenomenon
• As can be seen, as the length of the lowpass
filter is increased, the number of ripples in
both passband and stopband increases, with
a corresponding decrease in the ripple
widths
• Height of the largest ripples remain the
same independent of length
• Similar oscillatory behavior observed in the
magnitude responses of the truncated
versions of other types of ideal filters
Gibbs Phenomenon
• Gibbs phenomenon can be explained by
treating the truncation operation as a
windowing operation:
ht [n]  h[n]  w[n]
• In the frequency domain
j 1  j j (  )
H t (e )   d
H ( e )  ( e ) d
2 
j j
• where H t (e ) and  ( e ) are the DTFTs
of h [n] and w[n] , respectively
t
Gibbs Phenomenon
j
• Thus tH ( e ) is obtained by a periodic
continuous convolution of H d (e j ) with
j
 (e )
Gibbs Phenomenon
• If  (e j ) is a very narrow pulse centered at
  0 (ideally a delta function) compared to
variations in H d (e j ), then H t (e j ) will
j
approximate H d (e ) very closely
• Length 2M+1 of w[n] should be very large
• On the other hand, length 2M+1 of ht [n]
should be as small as possible to reduce
computational complexity
Gibbs Phenomenon
• A rectangular window is used to achieve
simple truncation:
1, 0  n  M
wR [n]  
0, otherwise
j
• Presence of oscillatory behavior in H t (e )
is basically due to:
– 1) hd [n] is infinitely long and not absolutely
summable, and hence filter is unstable
– 2) Rectangular window has an abrupt transition
to zero
Gibbs Phenomenon
• Rectangular window has an abrupt transition
to zero outside the range  M  n  M , which
results in Gibbs phenomenon in H t (e j )
• Gibbs phenomenon can be reduced either:
(1) Using a window that tapers smoothly to
zero at each end, or
(2) Providing a smooth transition from
passband to stopband in the magnitude
specifications
Fixed Window Functions
• Using a tapered window causes the height
of the sidelobes to diminish, with a
corresponding increase in the main lobe
width resulting in a wider transition at the
discontinuity
• Hanning:
w[n]  0.5  0.5 cos( 2 n ),  M  n  M
2M  1
• Hamming:
w[n]  0.54  0.46 cos( 2 n ),  M  n  M
2M  1
• Blackman:
w[n]  0.42  0.5 cos( 2  n )  0.08 cos( 4  n )
2M  1 2M  1
Fixed Window Functions
• Plots of magnitudes of the DTFTs of these
windows for M = 25 are shown below:
Rectangular window Hanning window
0 0

-20 -20

Gain, dB
Gain, dB

-40 -40

-60 -60

-80 -80

-100 -100
0 0.2 0.4 0.6 0.8 1 0 0.2 0.4 0.6 0.8 1
/ /
Hamming window Blackman window
0 0

-20 -20
Gain, dB

Gain, dB

-40 -40

-60 -60

-80 -80

-100 -100
0 0.2 0.4 0.6 0.8 1 0 0.2 0.4 0.6 0.8 1
/ /
Fixed Window Functions
• Magnitude spectrum of each window is
characterized by a main lobe centered at
 = 0 followed by a series of sidelobes with
decreasing amplitudes
• Parameters predicting the performance of a
window in filter design are:
• Main lobe width
• Relative sidelobe level
Fixed Window Functions
• Main lobe width  ML - given by the
distance between zero crossings on both
sides of main lobe
• Relative sidelobe level As - given by the
difference in dB between amplitudes of
largest sidelobe and main lobe
Fixed Window Functions

j( c  2 ) j( c  2 )
• Observe Ht (e )  H t (e ) 1
jc
• Thus, H t (e )  0.5
• Passband and stopband ripples are the same
Fixed Window Functions
• Distance between the locations of the
maximum passband deviation and minimum
stopband value   ML

• Width of transition band


   s   p   ML
Fixed Window Functions
• To ensure a fast transition from passband to
stopband, window should have a very small
main lobe width
• To reduce the passband and stopband ripple
 , the area under the sidelobes should be
very small
• Unfortunately, these two requirements are
contradictory
Fixed Window Functions
• In the case of rectangular, Hanning, Hamming,
and Blackman windows, the value of ripple  does
not depend on filter length or cutoff frequency c ,
and is essentially constant
• In addition the transition bandwidth,
  c
M
where c is a constant for most practical purposes
Fixed Window Functions
• Rectangular window -  ML  4 /(2M  1)
As  13.3 dB,  s  20.9 dB,   0.92 / M
• Hanning window -  ML  8 /(2M  1)
As  31.5 dB,  s  43.9 dB,   3.11 / M
• Hamming window -  ML  8 /(2M  1)
As  42.7 dB,  s  54.5 dB,   3.32 / M
• Blackman window -  ML  12 /(2M  1)
As  58.1 dB,  s  75.3 dB,   5.56 / M
Fixed Window Functions
• Filter Design Steps -
(1) Set
c  ( p   s ) / 2
(2) Choose window based on specified s
(3) Estimate M using
  c
M
4) Obtain the impulse response coefficients of the
filter
ht [n]  h[n]  w[n]
FIR Filter Design Example
• Lowpass filter of length 51 and c   / 2
Lowpass Filter Designed Using Hann window Lowpass Filter Designed Using Hamming window
0 0

Gain, dB
Gain, dB

-50 -50

-100 -100

0 0.2 0.4 0.6 0.8 1 0 0.2 0.4 0.6 0.8 1


/ /
Lowpass Filter Designed Using Blackman window
0
Gain, dB

-50

-100

0 0.2 0.4 0.6 0.8 1


/
Adjustable Window Functions
• Kaiser Window -
I 0{ 1  (n / M ) 2 }
w[n]  , M nM
I0 ( )
where  is an adjustable parameter and I 0 (u )
is the modified zeroth-order Bessel function
of the first kind:  (u / 2) r
I 0 (u )  1   [ ] 2
r 1 r!
• Note I 0 (u )  0 for u > 0
20 (u / 2) r
• In practice I 0 (u )  1   [ ] 2
r 1 r!
Adjustable Window Functions
•  controls the minimum stopband
attenuation of the windowed filter response
•  is estimated using
 0.1102(  s 8.7 ), for  s  50
 0.5842(  s  21)0.4  0.07886(  s  21), for 21   s  50
 0, for  s  21
• Filter order is estimated using
s  8
N
2.285( )
where  is the normalized transition
bandwidth
FIR Filter Design Example
• Specifications:  p  0.3 ,  s  0.5 ,
 s  40 dB
• Thus c  ( p   s ) / 2  0.4
 s / 20
 s  10  0.01
  0.5842(19)  0.0788619  3.3953
0.4

32
N  22.2886
2.285(0.2)
• Choose N = 25 implying M =12
FIR Filter Design Example
sin(0.4 n)
• Hence ht [n]  n  w[n],  12  n  12
where w[n] is the n-th coefficient of a
length-25 Kaiser window with   3.3953
Kaiser Window Lowpass filter designed with Kaiser window
0 0

-20 -20

Gain, dB
Gain, dB

-40 -40

-60 -60

-80 -80
0 0.2 0.4 0.6 0.8 1 0 0.2 0.4 0.6 0.8 1
/ /

You might also like