DSP Module4
DSP Module4
Module-4
Design of FIR filters
Filters are used to separate the desired signal from the unwanted disturbance. Two important
classes of digital filters based on their impulse response are
a. Finite impulse response (FIR) filter
b. Infinite impulse response (IIR) filter
Characteristics of practical frequency-selective filters
Filters are usually classified according to their frequency domain characteristic as LP, HP, BP, BS
filters. The ideal magnitude response characteristics of these filters are is as shown in figure 3.1.
Theses ideal filters have a constant gain (usually taken as unity gain) in the passband and zero
gain in the stopband. The range of the frequencies where the frequency response takes the value
of one is called passband and the range of frequency where the frequency response is equal to
zero is called stopband of the filter.
These ideal filters having non-casual impulse response and hence these filters are not used for
practical signal processing applications. In order to obtain stable practical, the ideal frequency
1
Prepared by Dr Harish M S
response are relaxed by including a transition band between the passband and stopband is as
shown in figure 3.2. And also a small amount of ripple in both passband and stopband are
introduced are known as tolerance.
Let 𝛿1 be the ripple in passband and magnitude varies between 1 ± 𝛿1 in passband. Let 𝛿2 be the
ripple in the stopband. To accommodate a large dynamic range in the graph of frequency
response of the filter, it is a common practice to use logarithmic scale for the magnitude|𝐻(𝜔)|.
Consequently the ripple in the passband is 𝑎𝑝 = 20 log10 𝛿1 decibels and in the stopband 𝑎𝑠 =
20 log10 𝛿2 decibels.
In any filter design problem we specify (1) the maximum passband ripple, (2) the maximum
stopband ripple, (3) the passband edge frequency𝜔𝑝 , and (4) the stopband edge frequency𝜔𝑠 .
Based on these specifications, we can select the filter coefficients {𝑎𝑘 } and {𝑏𝑘 }.
Where {𝑏𝑘 } is the set of filter coefficients, if we allow {𝑏𝑘 } = ℎ(𝑘), then
𝑀−1
𝑦(𝑛) = ∑ ℎ(𝑘)𝑥(𝑛 − 𝑘)
𝑘=0
2
Prepared by Dr Harish M S
Thus we can express the output 𝑦(𝑛) as convolution of the impulse response of the filter with the
input signal 𝑥(𝑛). The lower limit and upper limit on the convolution sum reflects the causality
and finite duration characteristic of the filter. The filter is also characterized by its transfer
function 𝐻(𝑧) as
𝑀−1
𝐻 (𝑧) = ∑ ℎ(𝑘)𝑧 −𝑘
𝑘=0
Which we view as a polynomial of degree M-1 in the variable𝑧 −1 , the roots of this polynomial
constitutes the zeros of the filter. All FIR filter has linear phase characteristics in the passband. If
the filter is linear phase, then it has to satisfy the condition
ℎ(𝑛) = ±ℎ(𝑀 − 1 − 𝑛) 0≤𝑛 ≤𝑀−1 + is for symmetric and – is for antisymmetric.
For example
i. If M is even say𝑀 = 6and ℎ(𝑛) is symmetric i.e. ℎ(𝑛) = ℎ(𝑀 − 1 − 𝑛)
ℎ (0 ) = ℎ (5)
ℎ (1 ) = ℎ (4)
ℎ(2) = ℎ (3)
ℎ (3 ) = ℎ (2)
𝑀−1 6−1
Thus ℎ(𝑛) is symmetric about the mid point = = 2.5 as shown in figure 3.3
2 2
iii. If M is even say M=6 and ℎ (𝑛) is antisymmetric i.e. ℎ(𝑛) = − ℎ(𝑀 − 1 − 𝑛)
ℎ(0 ) = − ℎ(5)
ℎ(1 ) = − ℎ(4)
ℎ(2 ) = − ℎ(3)
ℎ(3 ) = − ℎ(2)
𝑀−1 6−1
Thus ℎ(𝑛) is symmetric about the mid point = = 2.5 as shown in figure 3.3
2 2
3
Prepared by Dr Harish M S
ℎ(0 ) = − ℎ(6)
ℎ(1 ) = − ℎ(5)
ℎ(2 ) = − ℎ(4)
ℎ(3 ) = − ℎ (3) = 0
𝑀−1 7−1
Thus ℎ(𝑛) is symmetric about the mid point = = 3 as shown in figure 3.3
2 2
𝐻 (𝑧) = ∑ ℎ(𝑘)𝑧 −𝑘
𝑘=0
4
Prepared by Dr Harish M S
𝑧 −(𝑀−1) 𝐻 (𝑧 −1 ) = ±𝐻(𝑧)
The transfer function 𝐻(𝑧) is the transfer function of ℎ(𝑛) and 𝐻 (𝑧 −1 ) is the transfer function
of ℎ(𝑀 − 1 − 𝑛). This result implies that the roots of the polynomial 𝐻 (𝑧) are identical to the
roots of polynomial 𝐻 (𝑧 −1 ) and the filter is linear phase.
Problem: An FIR filter with linear phase has a zero at 0.5 + 𝑗0.5. Estimate the location of the
other zeros.
Solution: Let 𝑧1 = 0.5 + 0.5𝑗 = 0.707∠45°
1 1
The other zeros are 𝑧2 = 𝑧1−1 = 0.5+0.5𝑗 = 0.707∠45° = 1.414∠ − 45°
Problem: Consider the location of zeros in the z-plane as shown in below figure 3.4. (a) Does it
represent FIR filter? (b) Is it linear phase?
Solution: (a). In a pole-zero diagram on the z-plane has only zeros. Therefore it is an FIR filter.
(b) For linear phase FIR filter 𝐻 (𝑧) = 𝑧 −(𝑀−1) 𝐻(𝑧 −1 ), thus zeros of 𝐻(𝑧) are
5
Prepared by Dr Harish M S
3
𝑧1 = ∠60°
4
𝑧2 = 1
3
𝑧3 = ∠ − 60°
4
𝑧4 = −3/4
And zeros of 𝐻(𝑧 −1 ) are
−14
𝑧1 = 𝑧3∗ = ∠60°
3
𝑧2 = 𝑧2−1 = 1
−1 4
𝑧3 = 𝑧3∗ = ∠ − 60°
3
𝑧4 = 𝑧4−1 = −4/3
Frequency response of the FIR filter
Let ℎ(𝑛) be an impulse response of the FIR filter, whose transfer function is
𝑀−1
𝐻 (𝑧) = ∑ ℎ(𝑘)𝑧 −𝑘
𝑘=0
If the FIR filter is linear phase, then impulse response is symmetric or antisymmetric i.e. ℎ(𝑛) =
±ℎ(𝑀 − 1 − 𝑛), and length of the filter M may odd or even. If M is odd, say 𝑀 = 7, the impulse
response as shown in below figure.
ℎ(0) = ±ℎ(6)
ℎ(1) = ±ℎ(5)
ℎ(2) = ±ℎ(4)
ℎ(3) = ±ℎ(3)
ℎ(4) = ±ℎ(2)
ℎ(5) = ±ℎ(1)
ℎ(6) = ±ℎ(0)
𝑀−1
∴ 𝐻 (𝑧) = ∑ ℎ(𝑘)𝑧 −𝑘
𝑘=0
𝑀 − 3) −(𝑀−3) 𝑀 − 1 −(𝑀−1)
= ℎ(0) + ℎ(1)𝑧 −1 + ⋯ . ℎ ( 𝑧 2 +ℎ( )𝑧 2
2 2
𝑀 + 1 −(𝑀+1)
+ℎ( )𝑧 2 + ⋯ … ℎ(𝑀 − 2)𝑧 −(𝑀−2) + ℎ (𝑀 − 1)𝑧 −(𝑀−1)
2
𝑀−1 𝑀−1 𝑀−3 𝑀−3 𝑀−1 𝑀 + 1 −1
𝐻 (𝑧) = 𝑧 −( 2 ) {ℎ(0)𝑧 2 + ℎ(1)𝑧 2 + ⋯ . . ℎ ( )𝑧 +ℎ ( )+ℎ ( )𝑧
2 2 2
𝑀−3 𝑀−1
+ ⋯ . . +ℎ(𝑀 − 2)𝑧 −( 2
)
+ ℎ (𝑀 − 1)𝑧 −( 2
)
}
6
Prepared by Dr Harish M S
Magnitude of 𝐻(𝜔) is
𝑀−3
2
𝑀−1 𝑀−1
|𝐻(𝜔)| = ℎ ( ) + 2 ∑ ℎ(𝑛) 𝑐𝑜𝑠𝜔 ( − 𝑛)
2 2
𝑛=0
𝑀−1
Phase angle of 𝐻(𝜔) is ∠𝐻 ( 𝜔) = ∅(𝜔) = −𝜔( ) if |𝐻(𝜔)| > 0
2
7
Prepared by Dr Harish M S
𝑀−3
2
𝑀−1 𝑀−1−2𝑛 𝑀−1−2𝑛
∑ ℎ(𝑛)[𝑒 𝑗𝜔( )
𝐻 ( 𝜔) = 𝑒 −𝑗𝜔( 2
) 2 − 𝑒 −𝑗𝜔( 2
)
]
𝑛=0
𝑀−3
2
𝑀−1 𝑀−1
𝐻 ( 𝜔) = 𝑒 −𝑗𝜔( 2
)
2𝑗 ∑ ℎ(𝑛)𝑠𝑖𝑛𝜔(( −𝑛)
2
𝑛=0
Magnitude of 𝐻(𝜔) is
𝑀−3
2
𝑀−1
|𝐻(𝜔)| = 2 ∑ ℎ(𝑛) 𝑠𝑖𝑛𝜔 ( − 𝑛)
2
𝑛=0
𝜋 𝑀−1
Phase angle of 𝐻(𝜔) is ∠𝐻 ( 𝜔) = ∅(𝜔) = − 𝜔( ) if |𝐻(𝜔)| < 0
2 2
Magnitude of 𝐻(𝜔)is
𝑀
−1
2
𝑀−1
|𝐻(𝜔| = 2 ∑ ℎ(𝑛) 𝑐𝑜𝑠𝜔( − 𝑛)
2
𝑛=0
8
Prepared by Dr Harish M S
𝑀
−1
2
𝑀−1 𝑀−1−2𝑛 𝑀−1−2𝑛
∑ ℎ(𝑛)[𝑒 𝑗𝜔( )
𝐻(𝜔) = 𝑒 −𝑗𝜔( 2
) 2 − 𝑒 −𝑗𝜔( 2
)
]
𝑛=0
𝑀
−1
2
𝑀−1 𝑀−1
𝐻 (𝜔) = 2𝑗𝑒 −𝑗𝜔( )
2 ∑ ℎ(𝑛) 𝑠𝑖𝑛𝜔( − 𝑛)
2
𝑛=0
Magnitude of 𝐻(𝜔)is
𝑀
−1
2
𝑀−1
|𝐻(𝜔| = 2 ∑ ℎ(𝑛) 𝑠𝑖𝑛𝜔( − 𝑛)
2
𝑛=0
Problem: Determine the frequency response of the FIR filter of lengthM = 11.
𝑀−1 𝑀−3
𝑀−1 𝑀−1
Solution: 𝐻(𝜔) = 𝑒 −𝑗𝜔( 2
)
{ℎ ( ) + 2 ∑𝑛=0
2
ℎ(𝑛) 𝑐𝑜𝑠𝜔( − 𝑛)]}
2 2
4
−𝑗𝜔5
𝐻(𝜔) = 𝑒 { ℎ (5) + 2 ∑ ℎ(𝑛) 𝑐𝑜𝑠𝜔(5 − 𝑛)}
𝑛=0
Problem: The frequency response of the FIR filter is given by 𝐻(𝜔) = 𝑒 −𝑗𝜔3 { 1 + 1.8𝑐𝑜𝑠3𝜔 +
1.2𝑐𝑜𝑠2𝜔 + 0.5𝑐𝑜𝑠𝜔}. Determine the filter coefficients.
Solution: 𝐻(𝜔) = 𝑒 −𝑗𝜔3 { 1 + 1.8𝑐𝑜𝑠3𝜔 + 1.2𝑐𝑜𝑠2𝜔 + 0.5𝑐𝑜𝑠𝜔}
𝑀−1
=𝛼=3, ∴𝑀=7
2
𝑠𝑖𝑛𝜔𝑐 (𝑛 − 𝛼)
if 𝑛 ≠ 𝛼 −∞≤𝑛≤∞
∴ ℎ𝑑 (𝑛) = { 𝜋(𝑛 − 𝛼)
𝜔𝑐
if 𝑛 = 𝛼
𝜋
10
Prepared by Dr Harish M S
The impulse response ℎ𝑑 (𝑛) of the desired filter is non-causal and infinitely long. The finite
duration impulse response ℎ(𝑛) is obtained by multiplying ℎ𝑑 (𝑛) with finite duration window
function 𝑤(𝑛) of length 𝑀 i.e.
ℎ ( 𝑛 ) = ℎ 𝑑 ( 𝑛 ) 𝑤( 𝑛 ) 0≤𝑛 ≤ 𝑀−1
The magnitude response of the window function is shown in figure 3.6 for M=31 and M=61. The
4𝜋
width of the main lobe is 𝑀 . Hence as M increases, the main lobe become narrower and side lobe
11
Prepared by Dr Harish M S
The magnitude of the frequency response of the filter 𝐻 (𝜔) using rectangular window is as
shown in figure 3.7 for M=61 and M=101.We observe that relatively large oscillations or ripple
occur near the band edge of the filter. The oscillation increases as M increases. The oscillatory
behavior near the band edge of the filter is called Gibb’s phenomenon. This undesirable behavior
can be reduced by
12
Prepared by Dr Harish M S
i. Increasing the order of the filter M. As M increases main lobe width decreases, in the
mean time side lobe width decreases with increasing height. Thus there is a tradeoff
between the order of the filter M and height of the side lobe.
ii. By choosing tapered widows instead of rectangular.
Shape of the different windows such as Rectangular, Hanning, Hamming, and Blackman are
shown in figure 3.8.
Depending upon the minimum stopband attenuation, following window are used to design FIR
filter as mentioned in the table 3.1.
Table 3.1: Transition width and attenuation of different window functions
Name of the Transition Minimum Window function
window width stopband w(n) 0 ≤ 𝑛 ≤ 𝑀 − 1
attenuation
Rectangular 4𝜋 -13 dB =1 0≤𝑛≤𝑀−1
∆𝜔 ≥
𝑀
Bartlett 8𝜋 -27 dB 2[𝑛 −
𝑀−1
]
∆𝜔 ≥ 2
𝑀 = 1− 0 ≤𝑛 ≤𝑀−1
𝑀−1
Hamming 8𝜋 -32dB 2𝜋𝑛
∆𝜔 ≥ = 0.54 − 0.46cos( ) 0≤𝑛 ≤ 𝑀−1
𝑀 𝑀−1
Hanning 8𝜋 -43dB 1 2𝜋𝑛
∆𝜔 ≥ = (1 − cos ( ) 0 ≤𝑛 ≤𝑀−1
𝑀 2 𝑀−1
Blackman 12𝜋 -58dB 2𝜋𝑛 4𝜋𝑛
∆𝜔 ≥ = 0.42 − 0.5 cos ( ) + 0.08 cos ( )
𝑀 𝑀−1 𝑀−1
0≤𝑛≤𝑀−1
13
Prepared by Dr Harish M S
Design steps
1. Select the suitable window depending upon the minimum stopband attenuation in dB
2. Using the transition width ∆𝑤 of the corresponding window, determine the order of the
2𝜋𝑘
filter M using the formula 𝑀 ≥ .
∆𝑤
𝑀−1 7−1
𝛼= = =3
2 2
𝑠𝑖𝑛𝜔𝑐 (𝑛 − 𝛼) 𝑠𝑖𝑛1.2566(𝑛 − 3)
= if 𝑛 ≠ 𝛼
𝜋(𝑛 − 𝛼) 𝜋(𝑛 − 3)
∴ ℎ𝑑 (𝑛) =
1.25
{ if 𝑛 = 3
𝜋
The impulse response of the designed filter
ℎ ( 𝑛 ) = ℎ 𝑑 ( 𝑛 ) 𝑤( 𝑛 ) 0≤𝑛 ≤ 𝑀−1
If the window is rectangular window defined as
1 0≤𝑛≤6
𝑤 (𝑛 ) = {
0 𝑂𝑡ℎ𝑒𝑟𝑤𝑖𝑠𝑒
Then the impulse response of the filter is
14
Prepared by Dr Harish M S
𝑠𝑖𝑛1.2566(𝑛 − 3)
if 𝑛 ≠ 6 0≤𝑛≤7
𝜋 (𝑛 − 3)
ℎ(𝑛 ) =
1.25
{ if 𝑛 = 3
𝜋
ℎ(0) = ℎ(6) = 0.0623
ℎ(1) = ℎ(5) = 0.0935
ℎ(2) = ℎ(4) = 0.302
ℎ(3) = 0.3333
The magnitude frequency response of the filter is
𝑀−3
2
𝑀−1 𝑀−1
|𝐻(𝜔)| = ℎ ( ) + 2 ∑ ℎ(𝑛) 𝑐𝑜𝑠𝜔 ( − 𝑛)
2 2
𝑛=0
2
15
Prepared by Dr Harish M S
8𝜋 8𝜋
The order of the filter is 𝑀 ≥ ∆𝜔 ≥ 0.12𝜋 ≥ 66.66
𝑀−1 67−1
∴ 𝑀 = 67 And = = 𝛼 = 33
2 2
2𝜋𝑛
The window function is 𝑤 (𝑛) = 0.54 − 0.46cos(𝑀−1)
16
Prepared by Dr Harish M S
For LPF
sin 0.333𝜋 (𝑛 − 𝛼)
if 𝑛 ≠ 𝛼
ℎ𝑑 (𝑛) = { 𝜋(𝑛 − 𝛼)
0.333 if 𝑛 = 𝛼
1. Using rectangular window
sin 0.333𝜋(𝑛−3)
if 𝑛 ≠ 3
Impulse response ℎ(𝑛) = ℎ𝑑 (𝑛)𝑤(𝑛) = ℎ𝑑 (𝑛) = { 𝜋(𝑛−3)
0.333 if 𝑛= 3
ℎ(0) = ℎ(6) = 3.33 × 10−4
ℎ(1) = ℎ(5) = 0.1378
ℎ(2) = ℎ(4) = 0.2754
ℎ(3) = 0.333
Impulse response of the filter
ℎ(𝑛) = [3.33 × 10−4 , 0.1378, 0.2754, 0.333,0.2754, 0.1378,3.33 × 10−4 ]
Frequency response of the filter
2
−𝑗𝜔3
𝐻(𝜔) = 𝑒 { ℎ ( 3) + 2 ∑ ℎ(𝑛) 𝑐𝑜𝑠𝜔(3 − 𝑛)]
𝑛=0
17
Prepared by Dr Harish M S
Impulse response
ℎ ( 𝑛 ) = ℎ 𝑑 ( 𝑛 ) 𝑤( 𝑛 )
sin 0.333𝜋 (𝑛 − 3) 2𝜋𝑛
× [ 0.54 − 0.46 cos ( )] 0 ≤ 𝑛 ≤ 6 𝑎𝑛𝑑 𝑛 ≠ 3
𝜋(𝑛 − 3) 6
=
2𝜋𝑛
{ 0.333 ×× [0.54 − 0.46cos ( ) if 𝑛= 3
6
ℎ(0) = ℎ(6) = 3.33 × 10−4 × 0.141 = 4.71 × 10−5
ℎ(1) = ℎ(5) = 0.1378 × 0.31 = 0.0427
ℎ(2) = ℎ(4) = 0.2754 × 0.77 = 0.212
ℎ(3) = 0.333
Impulse response ℎ(𝑛) = [4.71 × 10−5 , 0.0427, 0.212, 0.333, 0.121, 0.0427, 4.71 × 10−5 ]
Frequency response 𝐻(𝜔) = 𝑒 −𝑗𝜔3 {0.333 + 2 × 4.71 × 10−5 𝑐𝑜𝑠3𝜔 + 2 × 0.0427𝑐𝑜𝑠2𝜔 +
2 × 0.212𝑐𝑜𝑠𝜔}
3. Using Hanning window
Hanning window function is
1 2𝜋𝑛
w(n) == (1 − cos ( ) 0 ≤𝑛 ≤ 𝑀−1
2 𝑀−1
2𝜋𝑛
w(n) = 0.5 − 0.5 cos ( ) 0≤𝑛≤6
6
Impulse response
ℎ ( 𝑛 ) = ℎ 𝑑 ( 𝑛 ) 𝑤( 𝑛 )
sin 0.333𝜋 (𝑛 − 3) 2𝜋𝑛
× [ 0.5 − 0.5 cos ( )] 0 ≤ 𝑛 ≤ 6 𝑎𝑛𝑑 𝑛 ≠ 3
𝜋(𝑛 − 3) 6
=
2𝜋𝑛
{ 0.333 ×× [0.5 − 0.5cos ( ) if 𝑛= 3
6
18
Prepared by Dr Harish M S
𝑒 −𝑗𝜔𝛼 𝜔𝑐 ≤ |𝜔| ≤ 𝜋
𝐻𝑑 (𝜔) = {
0 |𝜔| ≤ 𝜔𝑐
Determine the filter coefficients of a 7-tap filter based on rectangular window.
Solution:
19
Prepared by Dr Harish M S
And frequency response of the filter is 𝐻 (𝜔) = 𝑒 −𝑗3𝜔 {ℎ(3) + 2 ∑2𝑛=0 ℎ(𝑛)𝑐𝑜𝑠𝜔(𝑛 − 3)}
Problem: Using rectangular window design a linear phase HPF with desired frequency response
is given by
𝜋
𝑒 −𝑗𝜔2 ≤ |𝜔 | ≤ 𝜋
𝐻𝑑 (𝜔) = { 4
𝜋
0 |𝜔 | ≤
4
Solution:
𝑀−1
= 𝛼 = 2, 𝑀 = 5
2
𝜋
sin 4 (𝑛 − 2)
− 0≤𝑛≤4 𝑛≠2
ℎ (𝑛 ) = ℎ𝑑 (𝑛 )𝑤 (𝑛 ) = 𝜋 (𝑛 − 2)
3
𝑛=𝛼
{ 4
1
ℎ (0) = ℎ (4) = −
2𝜋
1
ℎ(1) = ℎ(3) = −
𝜋√2
3
ℎ (2) =
4
1 1 3 1 1
Impulse response ℎ(𝑛) = (− 2𝜋 , − 𝜋 , ,−𝜋 − 2𝜋 )
√2 4 √2
20
Prepared by Dr Harish M S
Where {𝑏𝑘 } is the set of filter coefficients, if we allow {𝑏𝑘 } = ℎ(𝑘) , then
𝑀−1
𝑦(𝑛) = ∑ ℎ(𝑘)𝑥(𝑛 − 𝑘)
𝑘=0
𝑀−1
𝑌 (𝑧) = ∑ ℎ(𝑘)𝑋(𝑧)𝑧 −𝑘
𝑘=0
𝑀−1
𝑌(𝑧)
= 𝐻 (𝑧) = ∑ ℎ(𝑘)𝑧 −𝑘
𝑋(𝑧)
𝑘=0
𝑀−1
𝑌(𝑧)
∴ 𝐻 (𝑧 ) = = ℎ(0) + ℎ(1)𝑧 −1 + ℎ(2)𝑧 −2 + ⋯ . +ℎ(𝑀 − 1)𝑧 −(𝑀−1)
𝑋(𝑧)
𝑦(𝑛) = ℎ(0)𝑥(𝑛) + ℎ(1)𝑥(𝑛 − 1) + ℎ(2)𝑥(𝑛 − 2) + ⋯ . . ℎ(𝑀 − 1)
∴ 𝑦(𝑛) = ℎ(0)𝑥(𝑛) + ℎ(1)𝑥(𝑛 − 1) + ℎ(2)𝑥(𝑛 − 2) + ⋯ . . ℎ(𝑀 − 1)𝑥(𝑛 − 𝑀 + 1)
The direct form structure of FIR filter is as shown in figure 3.11.
3 17 3
Problem: Realize 𝐻 (𝑧) = 1 + 4 𝑧 −1 + 𝑧 −2 + 4 𝑧 −3 + 𝑧 −4 .
8
3 17 3
Solution: The impulse response of the filter is ℎ(𝑛) = [1, 4 , , 4 , 1]
8
𝑌(𝑧) 3 17 3
𝐻 (𝑧 ) = = 1 + 𝑧 −1 + 𝑧 −2 + 𝑧 −3 + 𝑧 −4
𝑋(𝑧) 4 8 4
3 17 3
𝑌 (𝑧) = 𝑋 (𝑧){1 + 𝑧 −1 + 𝑧 −2 + 𝑧 −3 + 𝑧 −4 }
4 8 4
3 17 3
The difference equation is 𝑦(𝑛) = 𝑥(𝑛) + 𝑥(𝑛 − 1) + 𝑥(𝑛 − 2) + 𝑥(𝑛 − 3) + 𝑥(𝑛 − 4)}
4 8 4
21
Prepared by Dr Harish M S
1 𝑛
=( ) 0≤𝑛≤3
2
1 1 1
= (1, , , )
2 4 8
1 1 1
∴ 𝑦(𝑛) = 𝑥 (𝑛) + 𝑥(𝑛 − 1) + 𝑥(𝑛 − 2) + 𝑥(𝑛 − 3)
2 4 8
The structure is as shown in figure
22
Prepared by Dr Harish M S
𝐻(𝑧) = ∑ ℎ(𝑛)𝑧 −𝑛
𝑛=0
𝑀
−1
𝑀−1 2 𝑀−1
−𝑛 −𝑛
𝐻 (𝑧 ) = ∑ ℎ (𝑛 )𝑧 = ∑ ℎ (𝑛 )𝑧 + ∑ ℎ(𝑛)𝑧 −𝑛
𝑛=0 𝑛=0 𝑀
𝑛=
2
23
Prepared by Dr Harish M S
𝑀 𝑀
−1 −1
2 2
M M M
𝐻 (𝑧) = ℎ(0)[1 ± z −(M−1) ] + h(1)[z−1 ± z −(M−2) ]+. . +h ( − 1) [z −( 2 −1) ± z − 2 ]
2
M M M
𝑌(𝑧) = 𝑋(𝑧){ℎ(0)[1 ± z −(M−1) ] + h(1)[z −1 ± z −(M−2) ]+. . +h ( − 1) [z −( 2 −1) ± z − 2 ]}
2
𝑀
𝑦(𝑛) = ℎ(0){𝑥(𝑛) ± 𝑥(𝑛 − (𝑀 − 1))] + ℎ(1)[𝑥(𝑛 − 1) ± 𝑥(𝑛 − (𝑀 − 2)] + ⋯ . +ℎ(
2
𝑀 𝑀
− 1)[𝑥(𝑛 − ( − 1) ± 𝑥 (𝑛 − )}
2 2
The direct-form linear-phase FIR system realization for M even is as shown in figure 3.12.
Similarly
If M is odd
The z-transform of ℎ(𝑛) is
𝑀−1
𝐻(𝑧) = ∑ ℎ(𝑛)𝑧 −𝑛
𝑛=0
𝑀−3
𝑀−1 2 𝑀−1
−𝑛 −𝑛
𝑀 − 1 −(𝑀−1)
𝐻 (𝑧 ) = ∑ ℎ (𝑛 )𝑧 = ∑ ℎ (𝑛 )𝑧 +ℎ( ) 𝑧 2 + ∑ ℎ(𝑛)𝑧 −𝑛
2 𝑀+1
𝑛=0 𝑛=0 𝑛=
2
24
Prepared by Dr Harish M S
𝑀−3
2 0
𝑀 − 1 −(𝑀−1)
𝐻 (𝑧) = ∑ ℎ(𝑛)𝑧 −𝑛 + ℎ ( ) 𝑧 2 + ∑ ℎ(𝑀 − 𝑚 − 1)𝑧 −(𝑀−𝑚−1)
2 𝑀−3
𝑛=0 𝑚=
2
𝑀−3 𝑀−3
2 2
𝑀 − 1 −(𝑀−1)
𝐻 (𝑧) = ∑ ℎ(𝑛)𝑧 −𝑛 + ℎ ( ) 𝑧 2 + ∑ ℎ(𝑀 − 𝑚 − 1)𝑧 −(𝑀−𝑚−1)
2
𝑛=0 𝑚=0
25
Prepared by Dr Harish M S
3 17 3
Problem: Realize 𝐻 (𝑧) = 1 + 4 𝑧 −1 + 𝑧 −2 + 4 𝑧 −3 + 𝑧 −4 .
8
3 17 3
Solution: The impulse response of the filter is ℎ(𝑛) = [1, 4 , , 4 , 1]
8
M=5
Problem: Realize the linear –phase FIR filter having the following impulse response ℎ(𝑛) =
1 1 1
𝛿 (𝑛) + 4 𝛿 (𝑛 − 1) − 8 𝛿 (𝑛 − 2) + 4 𝛿 (𝑛 − 3) + 𝛿(𝑛 − 4)
1 1 1
Solution: The impulse response of the filter is ℎ(𝑛) = [1, 4 , − 8 , 4 , 1]
M=5
26
Prepared by Dr Harish M S
Problem: Realize the linear –phase FIR filter having the following impulse response ℎ(𝑛) =
1 1 1 1
𝛿 (𝑛) − 4 𝛿 (𝑛 − 1) + 2 𝛿 (𝑛 − 2) + 2 𝛿 (𝑛 − 3) − 4 𝛿 (𝑛 − 4) + 𝛿(𝑛 − 5)
1 1 1 1
Solution: The impulse response of the filter is ℎ(𝑛) = [1, − 4 , 2 , 2 , − 4 , 1]
M=6
Problem: Realize the linear –phase FIR filter having the following impulse response ℎ(𝑛) =
1 1 1 1 1 1
𝛿 (𝑛) + 4 𝛿 (𝑛 − 1) + 3 𝛿 (𝑛 − 2) + 2 𝛿 (𝑛 − 3) − 2 𝛿 (𝑛 − 5) − 3 𝛿 (𝑛 − 6) − 4 𝛿 (𝑛 − 7) − 𝛿(𝑛 −
8)
1 1 1 1 1 1
Solution: The impulse response of the filter is ℎ(𝑛) = [1, 4 , 3 , 2 , 0, − 2 , − 3 , − 4 1], M=9
27
Prepared by Dr Harish M S
28