Sunteți pe pagina 1din 7

Design using Window Method

The desired frequency response of a digital filter, H d (e j ) is written as a Fourier Transform in


the form

H d (e j )   h(n)e  j n (1)
n o
where

1
hd (n)  
2 
H d (e j ) jn .d (2)

There are two difficulties in the representation of equation (2). The impulse response h(n) is
infinite in duration since the summation in equation (1) extends from  to   . The filter is
unrealizable since impulse response begins at  , i.e. no finite amount of delay can make the
impulse response realizable. Therefore, the filter which results from a Fourier transform
representation of H (e j ) is an unrealizable FIR filter.

By truncating the infinite Fourier transform at n  M  1 leads to Gibb’s phenomenon and also
not capable of designing good approximations to ideal low pass filters. Hence direct truncation
is not a reasonable way of obtaining an FIR filter.

Hence we use a “Finite Weighing Sequence” called a “Window” to modify the Fourier
coefficients h(n) in equation (2) to control the convergence of the Fourier series.

Then the unit impulse response of the FIR filter becomes

h(n)  hd (n).W (n), 0  n  M 1


(3)
 0, otherwise

Since h(n)  hd (n).W (n), H (e j ) is the circular convolution of H d (e j ) and W (e j ) .

There are certain major requirements of windows characteristics.

i) Small width of main lobe of the frequency response of the window containing
as much of the total energy as possible.
ii) Side lobes of the frequency response that decrease in energy rapidly as w
tends to 

Rectangular Window

The weighting function is given by

1, 0  n  M  1
 R ( n)   (4)
0, otherwise

The frequency response of the rectangular windows is


M 1
(1  e jwM )
WR (e jw )   e jwn 
n 0 1  e jw

After simplification

sin( M / 2)
WR (e jw )  (1  e jw( M 1)/2 ) (5)
sin( / 2)

Fig 1 shows the frequency response of the rectangular window function.

-2/M -2/M

Figure 1 Frequency response of rectangular window

Table 1 List of several windows function with the desirable response characteristics.

Time-domain sequence
Name of the Window
h(n), n=0,1,2,…M-1
M 1
2|n |
Bartlett (Triangular) 2
1
M 1
2n 4n
0.42  0.5 cos  0.08 cos
Blackman M 1 M 1

2n
Hamming 0.54  0.46 cos
M 1
2n
Hanning 0.5(1  cos )
M 1
 M 1 2 M 1 2 
I 0  ( )  (n  ) 
 2 2 
Kaiser
 M 1 
I 0  ( )
 2 
Comparison of Hamming, Hanning and Rectangular windows

Figure 2 Frequency response of rectangular, Hamming and Hanning windows

1. Main lobe of the frequency response of Hamming/Hanning windows is twice that of


that of the rectangular windows.
2. For   0.54, (Hamming window), 99.96% of the spectral energy is in the main lobe
and the peak side lobe ripple is down about 40 dB from the main lobe peak. In
rectangular windows, the spectral side lobes are down only about 14 dB from the
main lobe peak.
3. For α = 0.5 (Hanning window), 99.96% of the spectral energy is in the main lobe and
the peak side lobe ripple is down about 40-60 dB from the main lobe peak. In
rectangular windows, the spectral side lobes are down only about 14 dB from the
main lobe peak.

Design procedure for FIR filter design using Window method

1. For a given desired frequency response Hd(ejω), compute hd(n) using eqn.

1
hd (n)  
2 
H d (e j ) jn .d

2. Depending upon the necessity, choose the window function from Table 1.
3. Find h(n) using eqn.
h(n)  hd (n).W (n), 0  n  M  1
 0, otherwise
4. Find the transfer function using Z-Transform.
5. Compute the frequency response of the given filter using Fourier
Transform.
Example 1

A low pass filter is to be designed with following desired frequency response


j
e  j 2 ,  / 4     / 4
H d (e ) = 
0,  /4  
Determine the filter coefficients hd(n) if the window function is defined as

1, 0n4
W (n)  
0, otherwise

Also, determine the frequency response H (e j ) of the designed filter.

Solution
Given
e  j 2 ,  / 4     / 4
H d (e j ) = 
0,  /4  
Therefore,

1  j jn
hd (n)   H d (e )e d
2 
1  / 4  j 2 jn
  e e d
2  / 4
1  / 4 j ( n  2 )
  e d
2  / 4
1  e j ( n2) 4  e  j ( n2) 4 
  
 (n  2)  2j 
1 
 sin (n  2), n  2
 (n  2) 4
For n=2, the filter coefficient can be obtained by applying L’Hospital rule to the above
expression. Thus,
1
hd (2) 
4
Thus other coefficient are given by
1 1
hd (0)   hd (4) and hd (1)   hd (3)
2 2

The filter coefficient of the filter would be then

h(n)  hd (n).w(n)
Therefore,
1 1 1
h(0)   h(4) , h(1)   h(3) and h(2) 
2 2 4
The frequency response H d (e j ) is given by
4
H (e j )   h(n)e  jn
n 0

 h(0)  h(1)e  j  h(2)e  j 2  h(3)e  j 3  h(4)e  j 4


 
 e  j 2 h(0)e j  h(1)e j  h(2)  h(3)e  j  h(4)e  j 2
 e  j 2 h(2)  h(0)e  e  h(1)e  e 
j 2  j 2 j  j

 e  j 2
1 1
 
4 2

j 2
e e  
1
e  e 
 j 2
2
 j  j

 

The frequency response of the designed low pass filter is then,


1 2 1 
H d (e j ) = e  j 2   cos  cos 2 
4   
Example 2

The desired response of a low pass filter is


j
e  j 3 ,  3 / 4    3 / 4
H d (e ) = 
0, 3 / 4    
Determine H (e j ) for M=7 using Hamming Window

Solution

The filter coefficient are given by


 c
1 1
 H d (e j )e jn d   e
 j 3
hd (n)  e jn d
2  2  c

sin 3 (n  3) 4 3
hd (n) = , n  3 and hd (3) 
 (n  3) 4
The filter coefficients are,

hd (0) =0.0750
hd (1) =-0.1592
hd (2) =0.2251
hd (3) =0.75
hd (4) =0.2251
hd (5) =-0.1592
hd (6) =0.0750

The hamming window function is,

 2n
0.54  0.46 cos ,0  n  M  1
w(n)   M 1
0, otherwise

Therefore, for M=7

w(0)=0.08
w(1)=0.31
w(2)=0.77
w(3)=1
w(4)=0.77
w(5)=0.31
w(6)=0.08

The filter coefficients of the resultant filter are,

h(n)= hd (n) .w(n) n=0,1,2,3,4,5,6.


Therefore

h(0)=0.006
h(1)=-0.0494
h(2)=0.1733
h(3)=0.75
h(4)=0.1733
h(5)=-0.0494
h(6)=0.006

The frequency response is given by,


6
H (e j )   h(n)e  jn
n 0

=
e  j 3w
h(3)  2h(0) cos3  2h(1) cos 2  2h(2) cos 
e  j 3w 0.75  0.3466 cos  0.0988 cos 2  0.012 cos 

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