0% found this document useful (0 votes)
31 views28 pages

DSP Module4

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
31 views28 pages

DSP Module4

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 28

Prepared by Dr Harish M S

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 {𝑏𝑘 }.

Symmetric and antisymmetric FIR filters


The FIR filter is an all zero filter, thus FIR filter is inherently stable and non-recursive. Consider
an FIR filter of length M with input 𝑥(𝑛) and output 𝑦(𝑛) is described by difference equation
𝑀−1

𝑦(𝑛) = 𝑏0 𝑥 (𝑛) + 𝑏1 𝑥 (𝑛 − 1) + ⋯ + 𝑏𝑀−1 𝑥(𝑛 − 𝑀 + 1) = ∑ 𝑏𝑘 𝑥(𝑛 − 𝑘)


𝑘=0

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

ii. If M is odd say 𝑀 = 7 and h (n) is symmetric i.e. ℎ(𝑛) = ℎ(𝑀 − 1 − 𝑛)


ℎ(0 ) = ℎ (6)
ℎ(1 ) = ℎ (5)
ℎ(2) = ℎ (4)
ℎ(3 ) = ℎ (3)
𝑀−1 7−1
Thus ℎ(𝑛) is symmetric about the mid point = = 3 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

iv. If M is odd say M=7and ℎ (𝑛) is antisymmetric i.e. ℎ(𝑛) = − ℎ(𝑀 − 1 − 𝑛)

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

Location of zeros for FIR filter


Let ℎ(𝑛) be the impulse response of the filter whose system function
𝑀−1

𝐻 (𝑧) = ∑ ℎ(𝑘)𝑧 −𝑘
𝑘=0

= ℎ(0) + ℎ(1)𝑧 −1 + ℎ(2)𝑧 −2 + ⋯ . . ℎ(𝑀 − 2)𝑧 −(𝑀−2) + ℎ(𝑀 − 1)𝑧 −(𝑀−1)


For linear phase ℎ(𝑛) = ±ℎ(𝑀 − 1 − 𝑛) 0 ≤ 𝑛 ≤ 𝑀 − 1, thus
ℎ (0) = ℎ(𝑀 − 1)
ℎ (1) = ℎ(𝑀 − 2)


ℎ 𝑀 − 2) = ℎ(1)
(
ℎ(𝑀 − 1) = ℎ(0)
∴ 𝐻 (𝑧) = ℎ(𝑀 − 1) + ℎ(𝑚 − 2)𝑧 −1 + ℎ(𝑀 − 3)𝑧 −2 +. . +ℎ(1)𝑧 −(𝑀−2) + ℎ(0)𝑧 −(𝑀−1)
𝐻 (𝑧) = 𝑧 −(𝑀−1) [ℎ(𝑀 − 1)𝑧 𝑀−1 + ℎ(𝑀 − 2)𝑧 𝑀−2 + ⋯ … ℎ(1)𝑧 + ℎ(0)]
𝑀−1
−(𝑀−1)
𝐻 (𝑧 ) = 𝑧 ∑ ℎ(𝑘)𝑧 𝑘
𝑘=0

𝐻 (𝑧) = 𝑧 −(𝑀−1) 𝐻(𝑧 −1 )

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°

𝑧3 = 𝑧1∗ = 0.5 − 0.5𝑗 = 0.707∠ − 45°


−1 1 1
𝑧4 = 𝑧1∗ = = = 1.414∠45°
0.5 − 0.5𝑗 0.707∠ − 45°
The 4 zeros located on the z-plane as shown in below figure

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

We know that ℎ(𝑛) = ±ℎ(𝑀 − 1 − 𝑛)


ℎ(0) = ±ℎ(𝑀 − 1)
ℎ(1) = ±ℎ(𝑀 − 2)


𝑀−3 𝑀+1
ℎ( ) = ℎ( )
2 2
𝑀−1 𝑀−1 𝑀−1 𝑀−3 𝑀−3 𝑀−1
{ℎ(0)[𝑧 ( )
± 𝑧 −( )
] + ℎ(1) [𝑧 ( )
± 𝑧 −( )
𝐻 (𝑧) = 𝑧 −( 2
) 2 2 2 2 ] + ⋯ . . +ℎ ( )}
2
𝑀−1 𝑀−3 𝑀−1−2𝑛 𝑀−1−2𝑛
𝑀−1
𝐻 (𝑧) = 𝑧 −( 2
)
{ℎ ( ) + ∑𝑛=0
2
ℎ(𝑛)[𝑧 ( 2
)
± 𝑧 −( 2
)
]}…….. (a)
2

i. For symmetric h(n) and if M is odd


𝑀−3
2
𝑀−1 𝑀−1 𝑀−1−2𝑛 𝑀−1−2𝑛
𝐻 (𝑧) = 𝑧 −( 2
)
{ℎ ( ) + ∑ ℎ(𝑛)[𝑧 ( 2 ) + 𝑧 −( 2 ) ]
2
𝑛=0

For the frequency response of the filter put 𝑧 = 𝑒 𝑗𝜔 , we get


𝑀−3
2
𝑀−1 𝑀−1 𝑗𝜔(
𝑀−1
−𝑛)
𝑀−1
𝐻(𝜔) = 𝑒 −𝑗𝜔( 2
)
{ℎ ( ) + ∑ ℎ(𝑛)[𝑒 2 + 𝑒 −𝑗𝜔( 2 −𝑛) ]}
2
𝑛=0
𝑀−3
2
𝑀−1 𝑀−1 𝑀−1
𝐻(𝜔) = 𝑒 −𝑗𝜔( 2
)
{ℎ ( ) + 2 ∑ ℎ(𝑛) 𝑐𝑜𝑠𝜔( − 𝑛)]}
2 2
𝑛=0

Magnitude of 𝐻(𝜔) is
𝑀−3
2
𝑀−1 𝑀−1
|𝐻(𝜔)| = ℎ ( ) + 2 ∑ ℎ(𝑛) 𝑐𝑜𝑠𝜔 ( − 𝑛)
2 2
𝑛=0
𝑀−1
Phase angle of 𝐻(𝜔) is ∠𝐻 ( 𝜔) = ∅(𝜔) = −𝜔( ) if |𝐻(𝜔)| > 0
2

ii. For antisymmetric h(n) and if M is odd


𝑀−1
For antisymmetric ℎ ( )=0
2
𝑀−3
2
𝑀−1 𝑀−1−2𝑛 𝑀−1−2𝑛
∑ ℎ(𝑛)[𝑧 ( )
∴ 𝐻 (𝑧) = 𝑧 −( 2
) 2 − 𝑧 −( 2
)
]
𝑛=0

For frequency response of the filter put 𝑧 = 𝑒 𝑗𝜔 , we get

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

iii. For symmetric h(n) and if M is even


𝑀
−1
2
𝑀−1 𝑀−1−2𝑛 𝑀−1−2𝑛
∑ ℎ(𝑛)[𝑧 ( )
𝐻 (𝑧) = 𝑧 −( 2
) 2 + 𝑧 −( 2
)
]
𝑛=0

For frequency response of the filter put 𝑧 = 𝑒 𝑗𝜔 , we get


𝑀
−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

Phase angle of 𝐻(𝜔) is


𝑀−1
Phase angle of 𝐻(𝜔) is ∠𝐻 ( 𝜔) = ∅(𝜔) = 𝜋 − 𝜔 ( ) if |𝐻(𝜔| < 0
2

iv. For antisymmetric if M is even


𝑀
−1
2
𝑀−1 𝑀−1−2𝑛 𝑀−1−2𝑛
∑ ℎ(𝑛)[𝑧 ( )
𝐻 (𝑧) = 𝑧 −( 2
) 2 − 𝑧 −( 2
)
]
𝑛=0

For frequency response of the filter put 𝑧 = 𝑒 𝑗𝜔 , we get

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

Phase angle of 𝐻(𝜔) is


3𝜋 𝑀−1
Phase angle of 𝐻(𝜔) is ∠𝐻 ( 𝜔) = ∅(𝜔) = −𝜔( ) if |𝐻(𝜔| < 0
2 2

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

Magnitude response |𝐻(𝜔| = ℎ (5) + 2 ∑4𝑛=0 ℎ(𝑛) 𝑐𝑜𝑠𝜔(5 − 𝑛)]


|𝐻(𝜔| = ℎ(5) + 2{ℎ(0)𝑐𝑜𝑠5𝜔 + ℎ(1)𝑐𝑜𝑠4𝜔 + ℎ(2)𝑐𝑜𝑠3𝜔 + ℎ(3)𝑐𝑜𝑠2𝜔 + ℎ(4)𝑐𝑜𝑠𝜔}
𝑀−1
Phase angle of 𝐻(𝜔) is ∠𝐻 ( 𝜔) = ∅(𝜔) = −𝜔 ( ) = −5𝜔
2

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

𝐻 (𝜔) = 𝑒 −𝑗𝜔3 { 1 + 1.8𝑐𝑜𝑠3𝜔 + 1.2𝑐𝑜𝑠2𝜔 + 0.5𝑐𝑜𝑠𝜔}


= 𝑒 −𝑗𝜔3 {ℎ(3) + 2ℎ(0)𝑐𝑜𝑠3𝜔 + 2ℎ(1)𝑐𝑜𝑠2𝜔 + 2ℎ(2)𝑐𝑜𝑠𝜔}
1.8
ℎ(0) = ℎ( 6) = = 0.9
2
1.2
ℎ(1) = ℎ( 5) = = 0.6
2
0.5
ℎ (2) = ℎ ( 4) = = 0.25
2
ℎ (3) = 1
9
Prepared by Dr Harish M S

Therefore the filter coefficients are ℎ(𝑛) = (0.9,0.6,0.25,1,0.25,0.6,0.9)


Design of linear- phase FIR filters using windows
Design of FIR filter using window is a simplest method. This method generally begins with the
desired frequency response specification 𝐻𝑑 (𝜔) and corresponding impulse response ℎ𝑑 (𝑛). For
example, if the desired frequency response of the LPF is characterized by
|𝜔|≤𝜔𝑐
𝑒 −𝑗𝜔𝛼
𝐻𝑑 (𝜔) = { , the magnitude and phase response as shown in figure 3.5.
0 𝜔𝑐 ≤ |𝜔| ≤ 𝜋

The ℎ𝑑 (𝑛) is related to 𝐻𝑑 (𝜔) by Fourier transform relation


1 𝜋
ℎ𝑑 (𝑛 ) = ∫ 𝐻 (𝜔)𝑒 𝑗𝜔𝑛 𝑑𝜔
2𝜋 −𝜋 𝑑
1 𝜔𝑐 −𝑗𝜔𝛼 𝑗𝜔𝑛
= ∫ 𝑒 𝑒 𝑑𝜔
2𝜋 −𝜔𝑐

1 𝜔𝑐 𝑗𝜔(𝑛−𝛼) 1 𝑒 𝑗𝜔(𝑛−𝛼) 𝜔𝑐 𝑠𝑖𝑛𝜔𝑐 (𝑛 − 𝛼)


= ∫ 𝑒 𝑑𝜔 = ( )−𝜔𝑐 =
2𝜋 −𝜔𝑐 2𝜋 𝑗(𝑛 − 𝛼) 𝜋(𝑛 − 𝛼)
𝑠𝑖𝑛𝜔𝑐 (𝑛 − 𝛼)
ℎ 𝑑 (𝑛 ) = if 𝑛 ≠ 𝛼
𝜋(𝑛 − 𝛼)

𝑠𝑖𝑛𝜔𝑐 (𝑛 − 𝛼)
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

If the window is rectangular window defined as


1 0≤𝑛≤𝑀−1
𝑤 (𝑛 ) = {
0 𝑂𝑡ℎ𝑒𝑟𝑤𝑖𝑠𝑒
Then the impulse response of the filter is
ℎ (𝑛 ) 0≤𝑛 ≤𝑀−1
ℎ (𝑛 ) = { 𝑑
0 𝑂𝑡ℎ𝑒𝑟𝑤𝑖𝑠𝑒
The Fourier transform of the window function is 𝐷𝑇𝐹𝑇(𝑤(𝑛) is 𝑊(𝜔)
𝑀−1

𝑊 (𝜔) = ∑ 𝑤(𝑛)𝑒 −𝑗𝜔𝑛


𝑛=0
𝑀−1 𝜔𝑀 𝜔𝑀 𝜔𝑀 𝜔𝑀
1 − 𝑒 −𝑗𝜔𝑀 𝑒 −𝑗 2 (𝑒 𝑗 2 − 𝑒 −𝑗 2 ) −𝑗𝜔(
𝑀−1 sin (
) 2
)
𝑊(𝜔) = ∑ 𝑒 −𝑗𝜔𝑛 = = 𝜔 𝑗𝜔 𝜔 = 𝑒 2
𝜔
1 − 𝑒 −𝑗𝜔 sin( 2 )
𝑛=0 𝑒 −𝑗 2 (𝑒 2 − 𝑒 −𝑗 2 )
𝜔𝑀
sin( )
2
|𝑊(𝜔)| = 𝜔
sin( 2 )

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

width decrease with increase of height.


The magnitude

11
Prepared by Dr Harish M S

The Frequency response of the filter is the DTFT of ℎ(𝑛) i.e.


𝐷𝑇𝐹𝑇(ℎ(𝑛)) = 𝐷𝑇𝐹𝑇[ℎ𝑑 (𝑛)𝑤(𝑛)]
𝐻(𝜔) = 𝐻𝑑 (𝜔) ∗ 𝑊(𝜔)

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 𝑀 ≥ .
∆𝑤

3. Specify the ideal frequency response 𝐻𝑑 (𝜔).


4. Determine ℎ𝑑 (𝑛) using 𝐻𝑑 (𝜔).
5. Determine the impulse response of the designed filter h(n) using window function w(n)
i.e. ℎ(𝑛) = ℎ𝑑 (𝑛)w(n).
Low pass filter
Problem: Using rectangular window technique, design a lowpass filter with passband gain of
unity cutoff frequency 1000Hz and working at a sampling frequency of 5 kHz. The length of
impulse response should be 7.
Solution:
𝛺𝑐 2𝜋𝐹𝑐 2𝜋×1000
Convert analog frequency to digital frequency 𝜔𝑐 = 𝛺𝑐 𝑇𝑠 = = = = 1.2566𝑟𝑎𝑑
𝐹𝑠 𝐹𝑠 5000

Order of the filter 𝑀 = 7


𝑠𝑖𝑛𝜔𝑐 (𝑛−𝛼)
if 𝑛 ≠ 𝛼 −∞ ≤𝑛 ≤∞
𝜋(𝑛−𝛼)
For lowpass filter desired impulse is ℎ𝑑 (𝑛) = { 𝜔𝑐
if 𝑛=𝛼
𝜋

𝑀−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

|𝐻(𝜔)| = ℎ ( 3) + 2 ∑ ℎ(𝑛) 𝑐𝑜𝑠𝜔(3 − 𝑛)


𝑛=0

|𝐻(𝜔)| = ℎ ( 3) + 2 [ℎ(0)𝑐𝑜𝑠3𝜔 + ℎ(1) cos 2𝜔 + ℎ(2)𝑐𝑜𝑠𝜔]


|𝐻(𝜔)| = 0.333 + 2 × 0.0623𝑐𝑜𝑠3𝜔 + 2 × 0.0935 cos 2𝜔 + 2 × 0.302𝑐𝑜𝑠𝜔
𝑀−1
The phase frequency response of the filter is ∠𝐻( 𝜔) = ∅(𝜔) = −𝜔 ( ) = −3𝜔
2

Problem: Design linear phase LPF for the following specifications


Passband edge frequency 1.3 kHz
Stopband edge frequency 1.9 kHz
Minimum stopband attenuation >40dB
Sampling frequency 10 kHz
Solution: Convert analog data to digital data
𝛺𝑃 2𝜋𝐹𝑃 2𝜋 × 1300
𝜔𝑃 = 𝛺𝑃 𝑇 = = = = 0.26𝜋𝑅𝑎𝑑
𝐹 𝐹 10000
𝛺𝑐 2𝜋𝐹𝑠 2𝜋 × 1900
𝜔𝑠 = 𝛺𝑠 𝑇 = = = = 0.38𝜋𝑅𝑎𝑑
𝐹 𝐹 10000
𝜔𝑠 + 𝜔𝑃 0.38𝜋 + 0.26𝜋
𝜔𝑐 = = = 0.32𝜋𝑅𝑎𝑑
2 2
Transition width ∆𝜔 = 𝜔𝑠 − 𝜔𝑃 = 0.38𝜋 − 0.26𝜋 = 0.12𝜋𝑅𝑎𝑑
For 40𝑑𝐵 stopband attenuation, suitable window is Hamming window. Therefore
8𝜋
∆𝜔 ≥
𝑀

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)

The desired impulse response is


𝑠𝑖𝑛𝜔𝑐 (𝑛 − 𝛼)
if 𝑛 ≠ 𝛼
∴ ℎ𝑑 (𝑛) = { 𝜋(𝑛 − 𝛼)
𝜔𝑐
if 𝑛 = 𝛼
𝜋
sin 0.32𝜋 (𝑛 − 33)
if 𝑛 ≠ 33
𝜋(𝑛 − 33)
=
0.32𝜋
{ if 𝑛 = 33
𝜋
The impulse response of the filter is
ℎ(𝑛) = ℎ𝑑 (𝑛)w(n)
sin 0.32𝜋 (𝑛 − 33) 2𝜋𝑛
[0.54 − 0.46 cos ( )] 𝑖𝑓 𝑛 ≠ 33
𝜋(𝑛 − 33) 66
( )
ℎ 𝑛 =
0.34𝜋 2𝜋𝑛
{ [0.54 − 0.46 cos ( )] 𝑖𝑓 𝑛 = 33
𝜋 66
The frequency response of the filter is
𝑀−3
2
𝑀−1 𝑀−1 𝑀−1
𝐻(𝜔) = 𝑒 −𝑗𝜔( 2
)
{ℎ ( ) + 2 ∑ ℎ(𝑛) 𝑐𝑜𝑠𝜔( − 𝑛)]
2 2
𝑛=0
32
−𝑗𝜔33
𝐻(𝜔) = 𝑒 { ℎ (33) + 2 ∑ ℎ(𝑛) 𝑐𝑜𝑠𝜔(33 − 𝑛)]
𝑛=0

Problem: The frequency response of a linear phase FIR filter is given by


𝐻(𝜔) = 𝑒 −𝑗𝜔3 [2 + 1.8𝑐𝑜𝑠3𝜔 + 1.2𝑐𝑜𝑠2𝜔 + 0.5𝑐𝑜𝑠𝜔]
𝑀−1
Solution:𝛼 = 3 = , 𝑀=7
2
2
−𝑗𝜔3
𝐻(𝜔) = 𝑒 { ℎ ( 3) + 2 ∑ ℎ(𝑛) 𝑐𝑜𝑠𝜔(3 − 𝑛)]
𝑛=0

𝐻(𝜔) = 𝑒 −𝑗𝜔3 { ℎ ( 3) + 2ℎ(0)𝑐𝑜𝑠3𝜔 + 2ℎ(1)𝑐𝑜𝑠2𝜔 + 2ℎ(2)𝑐𝑜𝑠𝜔

16
Prepared by Dr Harish M S

ℎ(0) = ℎ(6) = 0.9


ℎ(1) = ℎ(5) = 0.6

ℎ(2) = ℎ(4) = 0.25
ℎ (3) = 2
Therefore impulse response is ℎ(ℎ) = [0.9, 0.6, 0.25, 2, 0.25, 0.6, 0.9]
Problem: Design LPF for the following frequency response using rectangular, hamming and
𝜋
𝑒 −𝑗3𝜔 0 ≤ |𝜔 | ≤ 3
Hanning window 𝐻 (𝜔) = { 𝜋
0 ≤ |𝜔 | ≤ 𝜋
3
𝑀−1 𝜋
Solution:𝛼 = 3 = , 𝑀 = 7, 𝜔𝑐 = = 0.333𝜋𝑅𝑎𝑑
2 3

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

= 𝑒 −𝑗𝜔3 {ℎ(3) + 2ℎ(0)𝑐𝑜𝑠3𝜔 + 2ℎ(1)𝑐𝑜𝑠2𝜔 + 2ℎ(2)𝑐𝑜𝑠𝜔}


𝐻(𝜔) = 𝑒 −𝑗𝜔3 {0.333 + 2 × 3.33 × 10−4 𝑐𝑜𝑠3𝜔 + 2 × 0.1378𝑐𝑜𝑠2𝜔 + 2 × 0.2754𝑐𝑜𝑠𝜔}
2. Using Hamming window
Hamming window function is
2𝜋𝑛
w(n) = 0.54 − 0.46cos( ) 0≤𝑛 ≤𝑀−1
𝑀−1
2𝜋𝑛
w(n) = 0.54 − 0.46cos( ) 0≤𝑛≤6
6

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

ℎ(0) = ℎ(6) = 3.33 × 10−4 × 0.08 = 2.66 × 10−5


ℎ(1) = ℎ(5) = 0.1378 × 0.77 = 0.106
ℎ(2) = ℎ(4) = 0.2754 × 0.77 = 0.212
ℎ(3) = 0.333
Impulse response ℎ(𝑛) = [0.266 × 10−5 , 0.16, 0.212, 0.333, 0.121, 0.16, 0.266 × 10−5 ]
Frequency response 𝐻(𝜔) = 𝑒 −𝑗𝜔3 {0.333 + 2 × 2.66 × 10−5 𝑐𝑜𝑠3𝜔 + 2 × 0.106𝑐𝑜𝑠2𝜔 +
2 × 0.212𝑐𝑜𝑠𝜔}
High pass filter
Problem: Design a linear phase HPF with desired frequency response is given by

18
Prepared by Dr Harish M S

𝑒 −𝑗𝜔𝛼 𝜔𝑐 ≤ |𝜔| ≤ 𝜋
𝐻𝑑 (𝜔) = {
0 |𝜔| ≤ 𝜔𝑐
Determine the filter coefficients of a 7-tap filter based on rectangular window.
Solution:

High pass filter desired frequency response as shown in figure 3.9.


The impulse response of the designed filter is ℎ(𝑛) = ℎ𝑑 (𝑛)𝑤(𝑛).
Theℎ𝑑 (𝑛)is the impulse response of the desired filter, it is obtained from it Fourier transform
of𝐻𝑑 (𝜔).i.e.
1 𝜋 1 −𝜔𝑐 1 𝜋
ℎ𝑑 (𝑛 ) = ∫ 𝐻𝑑 (𝜔)𝑒 𝑗𝜔𝑛 = ∫ 𝐻𝑑 (𝜔) 𝑒 𝑗𝜔𝑛 𝑑𝜔 + ∫ 𝐻 (𝜔)𝑒 𝑗𝜔𝑛 𝑑𝜔
2𝜋 −𝜋 2𝜋 −𝜋 2𝜋 𝜔𝑐 𝑑
1 −𝜔𝑐 −𝑗𝜔𝛼 𝑗𝜔𝑛 1 𝜋 −𝑗𝜔𝛼 𝑗𝜔𝑛
ℎ𝑑 (𝑛 ) = ∫ 𝑒 𝑒 𝑑𝜔 + ∫ 𝑒 𝑒 𝑑𝜔
2𝜋 −𝜋 2𝜋 𝜔𝑐
1 −𝜔𝑐 𝑗(𝑛−𝛼)𝜔 1 𝜋 𝑗(𝑛−𝛼)𝜔
ℎ𝑑 (𝑛 ) = ∫ 𝑒 𝑑𝜔 + ∫ 𝑒 𝑑𝜔
2𝜋 −𝜋 2𝜋 𝜔𝑐
−𝜔𝑐 𝜋
1 𝑒 𝑗(𝑛−𝛼)𝜔 𝑒 𝑗(𝑛−𝛼)𝜔 𝑠𝑖𝑛𝜔𝑐 (𝑛 − 𝛼)
ℎ𝑑 (𝑛 ) = ( | + | )=− −∞≤𝑛≤∞ 𝑛≠𝛼
2𝜋 𝑗(𝑛 − 𝛼 ) −𝜋 𝑗( 𝑛 − 𝛼 ) 𝜔 𝜋(𝑛 − 𝛼)
𝑐
−𝜔𝑐 𝜋
1 1 𝜔𝑐
ℎ𝑑 (𝑛 ) = ∫ 𝑒 𝑗(𝑛−𝛼)𝜔 𝑑𝜔 + ∫ 𝑒 𝑗(𝑛−𝛼)𝜔 𝑑𝜔 = 1 − 𝑛=𝛼
2𝜋 −𝜋 2𝜋 𝜔𝑐 𝜋
𝑠𝑖𝑛𝜔𝑐 (𝑛 − 𝛼)
− −∞≤𝑛≤∞ 𝑛≠𝛼
∴ ℎ𝑑 (𝑛 ) = { 𝜋(𝑛 − 𝛼)
𝜔𝑐
1− 𝑛=𝛼
𝜋
The impulse response of the filter is
𝑠𝑖𝑛𝜔𝑐 (𝑛 − 𝛼)
− 𝑤(𝑛) 0≤𝑛≤𝑀−1 𝑛≠𝛼
ℎ (𝑛 ) = ℎ𝑑 (𝑛 )𝑤 (𝑛 ) = { 𝜋 (𝑛 − 𝛼 )
𝜔𝑐
(1 − )𝑤(𝑛) 𝑛=𝛼
𝜋

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

Frequency response of the filter is


1
−𝑗2𝜔
𝐻 (𝜔 ) = 𝑒 {ℎ(3) + 2 ∑ ℎ(𝑛)𝑐𝑜𝑠𝜔(𝑛 − 2)}
𝑛=0

𝐻 (𝜔) = 𝑒 −𝑗3𝜔 {ℎ(3) + 2 ℎ(0)𝑐𝑜𝑠2𝜔 + 2ℎ(1)𝑐𝑜𝑠𝜔}


3 1 √2
𝐻 (𝜔) = 𝑒 −𝑗3𝜔 { − 𝑐𝑜𝑠2𝜔 − 𝑐𝑜𝑠𝜔}
4 𝜋 𝜋
Structure of FIR systems:
Direct-form structure
The FIR filter is an all zero filter, thus FIR filter is inherently stable and non-recursive. Consider
an FIR filter of length M with input 𝑥(𝑛) and output 𝑦(𝑛) is described by difference equation
𝑀−1

𝑦(𝑛) = 𝑏0 𝑥 (𝑛) + 𝑏1 𝑥 (𝑛 − 1) + ⋯ + 𝑏𝑀−1 𝑥(𝑛 − 𝑀 + 1) = ∑ 𝑏𝑘 𝑥(𝑛 − 𝑘)


𝑘=0

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

𝑌(𝑧)
∴ 𝐻 (𝑧 ) = = ℎ(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

The structure is as shown in figure

21
Prepared by Dr Harish M S

Problem: realize an FIR filter with impulse response is given by


1 𝑛
ℎ(𝑛) = ( ) [𝑢(𝑛) − 𝑢(𝑛 − 4)]
2
1 𝑛
Solution: ℎ(𝑛) = (2) [𝑢(𝑛) − 𝑢(𝑛 − 4)]

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

Problem: Determine the direct-form realization of the system function: 𝐻 (𝑧) = 1 + 2𝑧 −1 −


3𝑧 −2 − 4𝑧 −3 + 5𝑧 −4
Solution: 𝐻 (𝑧) = 1 + 2𝑧 −1 − 3𝑧 −2 − 4𝑧 −3 + 5𝑧 −4
Impulse response h (n) is ℎ(𝑛) = [1, 2, −3, −4, 5]

22
Prepared by Dr Harish M S

Direct-form structure of linear-phase FIR system


When the FIR system has linear phase described by impulse response of the system satisfies
either the symmetry or antisymmetric condition ℎ(𝑛) = ±ℎ(𝑀 − 𝑛 − 1). For such a system the
number of multiplications is reduced from 𝑀 to 𝑀/2 for M even and to (𝑀 − 1)/2 for 𝑀 odd.
If M is even
The z-transform of ℎ(𝑛) is
𝑀−1

𝐻(𝑧) = ∑ ℎ(𝑛)𝑧 −𝑛
𝑛=0
𝑀
−1
𝑀−1 2 𝑀−1
−𝑛 −𝑛
𝐻 (𝑧 ) = ∑ ℎ (𝑛 )𝑧 = ∑ ℎ (𝑛 )𝑧 + ∑ ℎ(𝑛)𝑧 −𝑛
𝑛=0 𝑛=0 𝑀
𝑛=
2

Put 𝑚 = 𝑀 − 𝑛 − 1 in the second summation we get and 𝑛 = 𝑀 − 𝑚 − 1


𝑀
−1
2 0
−𝑛
𝐻 (𝑧 ) = ∑ ℎ (𝑛 )𝑧 + ∑ ℎ(𝑀 − 𝑚 − 1)𝑧 −(𝑀−𝑚−1)
𝑛=0 𝑀
𝑚= −1
2
𝑀 𝑀
−1 −1
2 2

𝐻 (𝑧) = ∑ ℎ(𝑛)𝑧 −𝑛 + ∑ ℎ(𝑀 − 𝑚 − 1)𝑧 −(𝑀−𝑚−1)


𝑛=0 𝑚=0

Since m is the dummy variable, it can be replaced by n,


𝑀 𝑀
−1 −1
2 2

𝐻 (𝑧) = ∑ ℎ(𝑛)𝑧 −𝑛 + ∑ ℎ(𝑀 − 𝑛 − 1)𝑧 −(𝑀−𝑛−1)


𝑛=0 𝑛=0

For linear phase symmetric or antisymmetric ℎ(𝑛) = ±ℎ(𝑀 − 𝑛 − 1)

23
Prepared by Dr Harish M S

𝑀 𝑀
−1 −1
2 2

𝐻 (𝑧) = ∑ ℎ(𝑛)𝑧 −𝑛 ± ∑ ℎ(𝑛)𝑧 −(𝑀−𝑛−1)


𝑛=0 𝑛=0
𝑀
−1
2

𝐻 (𝑧) = ∑ ℎ(𝑛)[𝑧 −𝑛 ± 𝑧 −(𝑀−𝑛−1) ]


𝑛=0

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

Put 𝑚 = 𝑀 − 𝑛 − 1 in the second summation we get and 𝑛 = 𝑀 − 𝑚 − 1

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

Since m is the dummy variable, it can be replaced by n,


𝑀−3 𝑀−3
2 2
𝑀 − 1 −(𝑀−1)
𝐻 (𝑧) = ∑ ℎ(𝑛)𝑧 −𝑛 + ℎ ( ) 𝑧 2 + ∑ ℎ(𝑀 − 𝑛 − 1)𝑧 −(𝑀−𝑛−1)
2
𝑛=0 𝑛=0

For linear phase symmetric or antisymmetric ℎ(𝑛) = ±ℎ(𝑀 − 𝑛 − 1)


𝑀−3 𝑀−3
2 2
𝑀 − 1 −(𝑀−1)
𝐻 (𝑧) = ∑ ℎ(𝑛)𝑧 −𝑛 + ℎ ( ) 𝑧 2 ± ∑ ℎ(𝑛)𝑧 −(𝑀−𝑛−1)
2
𝑛=0 𝑛=0
𝑀−3
2
𝑀 − 1 −(𝑀−1)
𝐻 (𝑧 ) = ℎ ( ) 𝑧 2 + ∑ ℎ(𝑛)[𝑧 −𝑛 ± 𝑧 −(𝑀−𝑛−1) ]
2
𝑛=0

𝑌(𝑧) 𝑀 − 3 −(𝑀−3) 𝑀+1


= ℎ(0)[1 ± 𝑧 −(𝑀−1) ] + ℎ(1)[𝑧 −2 ± 𝑧 −(𝑀−2 ] + ⋯ . +ℎ ( [𝑧 2 ± 𝑧 −( 2 ) ])
𝑋(𝑧) 2
𝑀 − 1 −(𝑀−1)
+ℎ( )𝑧 2
2
𝑀 − 3 −(𝑀−3) 𝑀+1
𝑌 (𝑧) = 𝑋 (𝑧){ℎ(0)[1 ± 𝑧 −(𝑀−1) ] + ℎ(1)[𝑧 −2 ± 𝑧 −(𝑀−2 ] + ⋯ . +ℎ ( [𝑧 2 ± 𝑧 −( 2 ) ])
2
𝑀 − 1 −(𝑀−1)
+ℎ( )𝑧 2 }
2
𝑀−1
𝑦(𝑛) = ℎ(0)[𝑥(𝑛) ± 𝑥(𝑛 − 𝑀 + 1)] + ℎ(1)[𝑥(𝑛 − 1) ± 𝑥(𝑛 − 𝑀 + 2] + ⋯ + ℎ( )𝑥(𝑛
2
𝑀−1
−( )
2
The direct-form linear-phase FIR system realization for M odd is as shown in figure 3.13.

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

Cascade form structures


An FIR transfer function can be realized as a cascade of Fir section, with each section
characterized by second order FIR systems i.e.
𝑘

𝐻 (𝑧) = ∏ 𝐻𝑘 (𝑧) = 𝐻1 (𝑧)𝐻2 (𝑧) … … 𝐻𝑘 (𝑧)


𝑘=1

Problem: Obtain the cascade realization of the system


1 1
𝐻 (𝑧) = (1 + 𝑧 −1 + 𝑧 −2 ) (1 + 𝑧 −1 + 𝑧 −2 ) = 𝐻1 (𝑧)𝐻2 (𝑧)
2 4
1 1
Solution: 𝐻 (𝑧) = (1 + 2 𝑧 −1 + 𝑧 −2 ) (1 + 4 𝑧 −1 + 𝑧 −2 ) = 𝐻1 (𝑧)𝐻2 (𝑧)
1 1
𝐻1 (𝑧) = 1 + 2 𝑧 −1 + 𝑧 −2 And 𝐻2 (𝑧) = 1 + 4 𝑧 −1 + 𝑧 −2

Problem: Obtain the cascade realization of the system


𝐻 (𝑧) = (1 + 2𝑧 −1 − 2𝑧 −2 )(1 + 𝑧 −1 − 𝑧 −2 ) = 𝐻1 (𝑧)𝐻2 (𝑧)
Solution: 𝐻 (𝑧) = (1 + 2𝑧 −1 − 2𝑧 −2 )(1 + 𝑧 −1 − 𝑧 −2 ) = 𝐻1 (𝑧)𝐻2 (𝑧)
𝐻1 (𝑧) = 1 + 2𝑧 −1 − 2𝑧 −2 And 𝐻2 (𝑧) = 1 + 𝑧 −1 − 𝑧 −2

28

You might also like