0% found this document useful (0 votes)
22 views91 pages

Designing FIR Filters Explained

Chapter 6 discusses FIR (Finite Impulse Response) filters, which are designed to selectively pass certain frequency components while attenuating others based on their frequency response characteristics. The design process involves choosing a desired frequency response, obtaining the impulse response through inverse Fourier transform, and deriving the transfer function via Z-transform. The chapter also outlines the advantages and disadvantages of FIR filters, including their ability to achieve linear phase and stability, while noting challenges such as the need for a large impulse response duration for sharp cutoffs.

Uploaded by

vaibhavpandit111
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)
22 views91 pages

Designing FIR Filters Explained

Chapter 6 discusses FIR (Finite Impulse Response) filters, which are designed to selectively pass certain frequency components while attenuating others based on their frequency response characteristics. The design process involves choosing a desired frequency response, obtaining the impulse response through inverse Fourier transform, and deriving the transfer function via Z-transform. The chapter also outlines the advantages and disadvantages of FIR filters, including their ability to achieve linear phase and stability, while noting challenges such as the need for a large impulse response duration for sharp cutoffs.

Uploaded by

vaibhavpandit111
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

Chapter 6

FIR Filters

6.1 Introduction
The filters are frequency selective devices. An LTI system performs a type of discrimination or
filtering among the various frequency components at its input. The nature of this filtering action is determined
by the frequency response characteristic H(ejw ), which in turn depends on the choice of the system parameters
[e.g., the coefficients ak and bk in the difference equation governing the system]. Thus by proper selection
of the coefficients, we can design frequency selective filters that pass signals with frequency components
in some bands while they attenuate signals that contain frequency components in other frequency bands.
In general, the specification of a digital filter will be desired frequency response, Hd(ejw ). The desired
impulse response, hd(n) of the digital filter can be obtained by taking inverse Fourier transform of Hd(ejw ). Now,
the hd(n) will be an infinite duration discrete time signal defined for all values of n in the range – ¥ to +¥ .
The transfer function, H(z) of the digital filter is obtained by taking Z-transform of impulse response.
Since hd(n) is an infinite duration signal, the transfer function obtained from hd(n) will have infinite terms,
which cannot be realized or implemented in a digital system. Therefore, finite number of samples of hd(n) are
selected to form the impulse response, h(n) of the filter. The transfer function, H(z) is obtained by taking
Z-transform of finite sample impulse response, h(n). The filters designed by using finite samples of impulse
response are called FIR (Finite Impulse Response) filters.
Various Steps in Designing FIR Filter

i) Choose an ideal (desired) frequency response, Hd(ejw ).


ii) Take inverse Fourier transform of Hd(ejw ) to get hd(n) or sample Hd(ejw ) at finite number of
points (N-point) to get H ( k ) .
Chapter 6 - FIR Filters 6. 2
iii) If hd(n) is determined then convert the infinite duration hd(n) to a finite duration h(n),
[usually h(n) is an N-point sequence] or if H ( k ) is determined then take N-point inverse
DFT to get h(n).
iv) Take Z-transform of h(n) to get H(z), where H(z) is the transfer function of the digital filter.
v) Choose a suitable structure and realize the filter.
vi) Verify the design. In order to verify the design, determine the actual frequency response, H(ejw )
of the filter, by letting z = ejw in H(z) and sketch the magnitude response, |H(ejw )|.
Advantages of FIR Filters
1. FIR filters with exactly linear phase can be easily designed.
2. Efficient realizations of FIR filter exist as both recursive and nonrecursive structures.
3. FIR filters realized nonrecursively, i.e., by direct convolution are always stable.
4. Roundoff noise, which is inherent in realizations with finite precision arithmetic can easily
be made small for nonrecursive realization of FIR filters.
Disadvantages of FIR Filters
1. The duration of the impulse response should be large (i.e., N should be large) to adequately
approximate sharp cutoff filter. Hence a large amount of processing is required to realize
such filters when realized via slow convolution.
2. The delay of linear phase FIR filters need not always be an integer number of samples. This
non-integral delay can lead to problems in some signal processing applications.
6.2 LTI System as Frequency Selective Filters
Let us consider a discrete time signal x(n) with frequency content in a band of frequencies w 1 < w < w 2 .
Let, X(ejw ) be Fourier transform of x(n). Now, X(ejw ) will be a bandlimited signal that is,
X(ejw ) ¹ 0 ; w 1 £ w £ w2
= 0 ; w < w1 and w > w 2.
Let, this signal is passed through an LTI system with frequency response,

H ( e jω ) = C e − jαω ; ω1 ≤ ω ≤ ω 2
.....(6.1)
= 0 ; otherwise

where, C and a are positive constants.


Let, h(n) be impulse response of the LTI system, which is obtained by inverse Fourier transform of
H(ejw ). Now, the response, y(n) of LTI system is given by,
y(n) = x(n) * h(n)
On taking Fourier transform of above equation we get,
Y(ejw ) = F{x(n) * h(n)} Y(ejw ) = F{y(n)}

\ Y(ejw ) = X(ejw ) H(ejw ) Using convolution property of


Fourier transform.
= X(ejw ) C e-ja w
Using equation (6.1).
= C X(ejw ) e-ja w
6. 3 Digital Signal Processing
On taking inverse Fourier transform of above equation we get,

y(n) = C F–1{X(ejw )e-jaw } Using shifting property of Fourier transform.


If F{x(n)} = X(ejw ), then F{x(n –a)} = X(ejw ) e–jaw
\ y(n) = C x(n - a) .....(6.2)

From equation (6.2) we can say that the LTI system output is simply a delayed and amplitude scaled
version of the input signal. A pure delay is usually tolerable and is not considered as distortion of the signal.
Likewise the amplitude scaling. Hence, the LTI system with frequency response defined by equation (6.1)
represents an ideal filter (in this example it is bandpass filter).

In general, an LTI system modifies the input spectrum X(ejw ) according to its frequency response
H(e ) to yield an output signal with spectrum, Y(ejw ) = H(ejw ) X(ejw ). In a sense, H(ejw ) acts as a weighting
jw

function or a spectral shaping function to the different frequency components in the input signal. When
viewed in this context any LTI system can be considered to be a frequency shaping filter, even though it may
not completely block any or all frequency components. Consequently the terms LTI system and filter are
synonymous, and are often used interchangeably. The frequency selective filters must be designed to
introduce negligible distortion in the signals that pass through them.

The frequency response, H(ejw ) is a complex quantity, hence we can write,

H ( e jω ) = H(e jω ) ∠H( e jω ) = C e − jαω .....(6.3)

where, | H(ejw )| = C Magnitude

ÐH(ejw ) = -aw Phase

From equation (6.3) we can say that the magnitude of frequency response is constant and its phase is
a linear function of frequency. Therefore, if the phase function of frequency response of a filter is linear
function of frequency, then the filter is called linear phase filter.

In general, any deviation of the frequency response characteristics of a linear filter from the ideal
results in signal distortion. If the filter has a frequency variable magnitude response characteristic in the
passband then the filter introduces amplitude distortion. If the phase characteristic is not linear within the
desired frequency band, the signal undergoes phase distortion.

In order to examine the linear and nonlinear phase characteristics, two delay functions are defined and
they are phase delay and group delay.

Let, ÐH(ejw ) = q(w)

θ( ω )
Phase delay, τ p = − .....(6.4)
ω

d
Group delay, τ g = − θ( ω ) .....(6.5)

Chapter 6 - FIR Filters 6. 4
From equation (6.3),
θ(ω ) = −αω
θ( ω ) − αω
∴ τp = − =− =α
ω ω
d d
τg = − θ( ω ) = − ( − αω ) = α
dω dω
From the above equations it is observed that for a linear-phase filter, the delay is a constant, independent
of frequency. Consequently a filter that causes phase distortion has a variable frequency delay and one that
has linear phase has a constant delay within the desired frequency range. If the delay is not a constant within
the desired frequency range, we say that the filter introduces delay distortion. Thus delay distortion is
synonymous with phase distortion.
6.3 Ideal Frequency Response of Linear Phase FIR Filters
The filters are classified according to their frequency response characteristics. The ideal (desired)
frequency response Hd(ejw ) of four major types of filters are given below. The Hd(ejw ) is periodic, with
periodicity of 0 to 2p (or –p to +p). Also any analog frequency W will map (or can be converted) to frequency
of digital system w within the range 0 to 2p (or –p to +p). Hence the frequency response of digital filters are
defined in the interval 0 to 2p (or –p to +p).
Note : For conversion from analog frequency to frequency of digital system refer Impulse invariant transformation
or Bilinear transformation in Chapter 7.

Ideal frequency
response of lowpass filter , H d ( e jω ) = 0 ; for ω = − π to − ω c
− jαω
=Ce ; for ω = − ω c to + ω c
=0 ; for ω = + ω c to + π .....(6.6)
Ideal frequency
response of highpass filter , H d ( e jω ) = C e − jαω ; for ω = − π to − ω c
=0 ; for ω = − ω c to + ω c
=Ce − jαω
; for ω = + ω c to + π .....(6.7)
Ideal frequency
response of bandpass filter , H d (e jω ) = 0 ; for ω = − π to − ω c2
− jαω
=Ce ; for ω = − ω c2 to − ω c1
=0 ; for ω = − ω c1 to + ω c1
− jαω
=Ce ; for ω = + ω c1 to + ω c2
=0 ; for ω = + ω c2 to + π .....(6.8)
Ideal frequency
response of bandstop filter , H d (e jω ) = C e − jαω ; for ω = − π to − ω c2
=0 ; for ω = − ω c2 to − ω c1
− jαω
=Ce ; for ω = − ω c1 to + ω c1
=0 ; for ω = + ω c1 to + ω c2
=Ce − jαω
; for ω = + ω c2 to + π .....(6.9)
6. 5 Digital Signal Processing

|H d ( ω)| |H d ( ω)|
C C

−π −ω C 0 +ω +π C ω −π −ω C 0 +ω +πC ω
F ig 6.1 : M a g n itu de resp on se o f id ea l F ig 6.2 : M a g n itu de resp on se o f id ea l
low p a ss filter. h ig h p a ss filter.


|H d (e jω)| |H d (e )|

C C

−ωC2 −ωC1 +ωC1 +ωC2 −π −ωC2 −ωC1 +ωC1 +ωC2 +π ω


−π 0 ω +π 0
F ig 6.3 : M a g n itu de respo n se o f ide a l F ig 6.4 : M a g n itu de respo n se o f ide a l
b a nd p a ss filte r. b a nd sto p filte r.
The ideal filters are noncausal and hence physically unrealizable for the real time signal processing
applications. Causality implies that the frequency response characteristic H(ejw ) of the filter cannot be zero,
except at a finite set of points in frequency. In addition H(ejw ) cannot have an infinitely sharp cutoff from
passband to stopband, that is H(ejw ) cannot drop from unity to zero abruptly.

In practice it is not necessary to insist that the magnitude H ( e ) be constant in the entire passband
of the filters. A small amount of ripple in the passband is usually tolerable. Similarly it is not necessary for the

filter response H ( e ) to be zero in the stopband. A small amount of ripple in the stopband is also tolerable.
The transition of the frequency response from passband to stopband defines the transition band or
transition region of the filter. The passband edge frequency w p defines the edge of the passband, while the
stopband edge frequency w s denotes the beginning of the stopband.

|H (e jω)|
1+ δp

Passband ripple

1−δp

Transition band
δs
Passband
Stopband

Stopband
ripple
0
ωp ωs π ω
δp - Passband ripple ; ωp - P assband edge frequency
δs - Stopband ripple ; ωs - Stopba nd edge frequency

F ig 6 .5 : M a g n itu d e resp o nse of a p ra ctic al lo w p a ss filter.


Chapter 6 - FIR Filters 6. 6

6.4 Characteristics of FIR Filters With Linear Phase


Let h(n) be a causal finite duration sequence defined over the interval 0 £ n £ N – 1 and the samples
of h(n) be real.
The Fourier transform of h(n) is,
N−1
H (e jω ) = ∑ h( n) e− jωn .....(6.10)
n=0
which is periodic in frequency with period 2p.
\ H(ejw ) = H (ejw + 2pm) ; for m = 0, ±1, ±2, ..... .....(6.11)
With the restriction that h(n) is real, additional constraints of H(ejw ) are obtained as shown below.
Since H(ejw ) is complex it can be expressed as amplitude function, magnitude function and phase
function as shown in equation (6.12).
jω )
H ( e j ω ) = ± H ( e j ω ) e j∠H ( e = A ( ω ) e jθ ( ω ) .....(6.12)
where, A(ω ) = ± H (e jω ) = Amplitude function

θ( ω ) = ∠H (e jω ) = Phase function
H ( e jω ) = Magnitude function

Note : The magnitude is strictly positive, but the amplitude can be positive or negative.
From the property of Fourier transform when h(n) is real we can say that the magnitude function is a
symmetric function and the phase function is an antisymmetric function.
\ |H(ejw )| = |H (-ejw )|
|q(w)| = - |q (-w)|
Linear Phase and Symmetric Impulse Response
For many practical FIR filter, exact linearity of phase is a desired goal. Let us assume that the phase of
H(ejw ) is a linear function of w. Hence q(w) is directly proportional to w.
\ q(w) µw or q(w) = -aw ; for -p £ w £ +p .....(6.13)
where, a is a constant phase delay in samples
From equation (6.10) we get,
N−1
H(e jω ) = ∑ h( n) e− jωn .....(6.14)
n=0

From equation (6.12) and (6.13) we get,


H ( e jω ) = ± H (e jω ) e − jαω .....(6.15)
On equating equations (6.14) and (6.15) we get,
N−1

∑= h( n) e− jωn = ± H (e jω ) e − jαω e − jθ = cos θ − j sin θ


n 0
N−1

∑= h( n) cos ωn − jsin ωn = ± H (e jω ) cos αω − jsin αω


n 0
6. 7 Digital Signal Processing
On equating the real part and imaginary part of the above equation we get,
N−1
± | H(e jω )| cos αω = ∑ h( n) cos ωn .....(6.16)
n=0
N−1
±|H(e jω )| sin αω = ∑ h( n) sin ωn .....(6.17)
n=0

On dividing equation (6.17) by equation (6.16) we get,


N−1

sin αω
∑ h( n) sin ωn
n=0
= N−1
cos αω
∑ h( n) cos ωn
n=0

On cross multiplying the above equation we get,


N−1 N−1
sin αω ∑ h( n) cos ωn = cos αω ∑ h( n) sin ωn
n=0 n= 0
N−1 N−1

∑ h( n) sin αω cos ωn = ∑ h( n) cos αω sin ωn


n=0 n= 0
N−1

∑ h( n) sin αω cos ωn − cos αω sin ωn = 0 sin(A – B) = sin A cos B – cosA sinB


n=0
N−1
.....(6.18)
∑ h( n) sin (α − n) ω = 0
n=0

One solution of equation (6.18) exists when,


N −1
α = and h(n) = h(N − 1 − n) ; for 0 ≤ n ≤ N − 1 .....(6.19)
2
Proof :

h( n) sin (α − n)ω = h( n) sin e jω


N –1
2
−n
α= N−1
2

= h( n) sin e jω
N – 1 − 2n
2
n = N −1 − n
= h( n) sin e jω
N –1−n−n
2

= h( n) sin e jωn–n
2

= h( n) sin 0
=0

From the condition, a = (N - 1)/2 we can say that for every value of N there is only one value of phase
delay a for which linear phase can be obtained easily.
From the condition h(n) = h(N - 1 - n) we can say that for this value of a, [i.e., a = (N - 1)/2] the h(n)
has a special kind of symmetry. The impulse response h(n), when a = (N - 1)/2 and for odd and even values
of N are shown in fig 6.6 and 6.7 respectively. It can be observed that the impulse response is symmetric about
the centre of the sequence.
Chapter 6 - FIR Filters 6. 8
C entre of sy m m etry
h (n ) h (n ) C entre of sy m m etry

N = 11, α = − = 5
N 1 N −1
N = 10, α = = 4.5
2 2

0 1 2 3 4 5 6 7 8 9 10 n 0 1 2 3 4 5 6 7 8 9 n
F ig 6.6 : E xa m p le of sym m etric im p ulse F ig 6.7 : E xa m p le of sym m etric im p ulse
resp o n se for o d d N . response for even N .
Linear Phase and Antisymmetric Impulse Response
The definition of linear phase filter q(w) = -aw requires the filter to have both constant group delay
and constant phase delay. If only constant group delay is required an another type of linear phase filter is
defined in which the phase of H(ejw ) is a piece-wise linear function of w. For this case H(ejw ) can be expressed
in the Euler form as shown in equation (6.20).
H ( e jω ) = ± H ( e jω ) e j(β − αω ) .....(6.20)
jw
When H(e ) is expressed in the form of equation (6.20), we can prove that the only possible solution
of h(n) exists if,
N−1 π
α = 2
; β = ± 2
and h(n) = –h(N – 1 – n) ; for 0 £ n £ (N – 1) .....(6.21)
The filters that satisfy the three conditions of equation (6.21) have a delay of [(N - 1)/2] samples but
their impulse responses are antisymmetric around the centre of the sequence, as opposed to the true linear
phase sequences that are symmetric around the centre of the sequence.
h (n ) C entre of antisym m etry
h (n ) C entre of antisym m etry

N −1
N −1 N = 10, α = = 4.5
N = 11, α = =5 2
2

0 0
1 2 3 4 5 6 7 8 9 10 n 1 2 3 4 5 6 7 8 9 n

F ig 6.8 : E xa m p le of a n tisym m etry im p u lse F ig 6.9 : E xa m p le of a n tisym m etry im p u lse


resp o n se for o d d N . response for even N .
6.5 Frequency Response of Linear Phase FIR Filters
Depending on the value of N (odd or even) and the type of symmetry of the filter impulse response
sequence (symmetric or antisymmetric) there are six possible types of linear phase FIR filters.
The following are the six cases of impulse response for linear phase FIR filters.
Case (i) : Symmetric impulse response and N is odd with centre of symmetry at (N – 1)/2.
Case (ii) : Symmetric impulse response and N is even with centre of symmetry at (N – 1)/2.
Case (iii) : Antisymmetric impulse response and N is odd with centre of antisymmetry at (N – 1)/2.
Case (iv) : Antisymmetric impulse response and N is even with centre of antisymmetry at (N – 1)/2.
Case (v) : Symmetric impulse response and N is odd with centre of symmetry at n = 0.
Case (vi) : Antisymmetric impulse response and N is odd with centre of antisymmetry at n = 0.
6. 9 Digital Signal Processing
The frequency response of the filter is the Fourier transform of the impulse response. If h(n) is impulse
response of FIR filter then fourier transform of h(n) is denoted as H(ejw ), which is the frequency response of
FIR filter. The H(ejw ) is a complex function of w and so it can be expressed as, magnitude function |H(ejw )| and
phase function Ð H(ejw ).
Case (i) : Frequency response of linear phase FIR filter when impulse response is symmetric and N is odd
with centre of symmetry at (N – 1)/2

The frequency response of linear phase FIR filter when impulse response is symmetric and N is odd
with centre of symmetry at (N – 1)/2 is given by,
LM N −1
2
OP − jω N −1
e2j
H ee j = M hd

i + ∑ 2h d
N −1
2
N −1
2
− ni cos ωn P e .....(6.22)
MN n=1 PQ
Let, H(ejw ) = A(w) e jq(w) .....(6.23)
where, A(w) = Amplitude function
q(w) = Phase function
On comparing equations (6.22) and (6.23) we get,
N −1
2
Amplitude function, A(ω ) = hd i + ∑ 2 h d − ni cos ωn
N −1
2
N −1
2 .....(6.24)
n=1

Phase function, θ(ω ) = – ωd i = –ωα ; where, α =


N −1
2
N −1
2 .....(6.25)
N −1
2

Magnitude function, H(e ) = A(ω ) = h d i + ∑ 2 hd
N −1
2
N −1
2 i
− n cos ωn
.....(6.26)
n=1

A typical sketch of symmetric impulse response when N = 9 and its corresponding amplitude function
of frequency response are shown in fig 6.10 and fig 6.11 respectively. From these sketches it can be observed
that the amplitude function of H(ejw ) is symmetric with w = p, when the impulse response is symmetric and N
is odd number.
When impulse response is symmetric and N is odd, the frequency response is non-zero at
w = 0 and w = p, and so this frequency response can be used to design lowpass, highpass, bandpass and
bandstop filters.

N −1
α= =4
2
Chapter 6 - FIR Filters 6. 10
Proof:
The Fourier transform of h(n) is,
h( n) is defined
+∞ N −1
jω − jωn − jωn
H(e ) = ∑ h( n) e = ∑ h(n) e for n = 0 to N − 1
n = −∞ n=0
When N is odd number the symmetric impulse response will have the centre of symmetry at n = (N - 1)/2.
Hence H(ejw ) is expressed as,

N –3
− jω N − 1 N−1
2
e j

H(e ) = ∑ h(n) e− jωn + he N 2– 1 j e 2
+ ∑ h(n) e− jωn
n= 0 n= N+1
2

N− 3
2 − jω N − 1
e j Let, m = N – 1 – n ; \ n = N – 1 – m
= ∑ h(n) e− jωn +h e N –1
2 je 2
When, n = N + 1 ; m = N − 1− N + 1 = N − 3
n= 0 2 2 2
N− 3 When, n = N – 1 ; m = N – 1 – (N – 1)= 0
2
+ ∑ h(N − 1 − m) e− jω(N − 1 − m)
m= 0

N−3 N−3
2 − jω N − 1 e j 2
= ∑
n=0
h( n) e − jωn
+h e N –1
2 je 2
+ ∑ h(N − 1 − n) e− jω(N − 1 − n)
n=0
Put, m = n

N−3 N−3
− jω N − 1
For symmetric
2
e j 2
= ∑
n=0
h( n)e − jωn
+h e N –1
2 je 2
+ ∑ h( n)e− jω(N − 1 - n)
n=0
impulse response,
h(N – 1 – n) = h(n).

R| N−3
2 L e j jω N − 1 e j O U| e j jω N − 1 − jω N − 1
= She h( n) Me PPV e
|T j ∑ MN
N –1 − jωn 2 − jω ( N − 1 − n ) 2 2
+ e +e e
2
n=0 Q|W
R| N−3
2 L e jω N − 1 − n
j+e e
U
j O| e e j − jω (N − 1) − N − 1 − n − jω N − 1
= S he + ∑ h( n) Me P
j PQV|W
N –1 2 2 2

|T 2
n=0 MN
R| N−3
2 L e jω N − 1 − n
j+e e
U
j O| e e j − jω N − 1 − n − jω N − 1
= She + ∑ h( n) Me P
j PQV|W
N –1 2 2 2 jθ − jθ
e +e
|T
2
n=0 MN cosθ =
2
R| N−3
2
U| e j − jω N − 1
= S he F I
K jV e
|T j ∑ eH
N –1 N−1 −n 2
+ h ( n) 2 cos ω
2
n=0 |W 2

N −1 N −1
−n ; n= −k
R| N−1
2
U| e j Let, k=
When, n = 0 ; k = − jω N − 1
2 2
N −1
= She − kj cos ωkV e
|T j ∑ e
N –1 N –1 2 2
+ 2h
2
k=1
2
|W When, n = ; k= =1 N −3
2
N −1 N − 3
2

2

R| N−1
2
U| e j − jω N − 1
= She
|T j ∑ e
N –1
2
+ 2 h − n j
N –1
cos
2
ω n V| e Put, k = n 2

n=1
W
6. 11 Digital Signal Processing
Case (ii) : Frequency response of linear phase FIR filter when impulse response is symmetric and N is even with
centre of symmetry at (N – 1)/2
The frequency response of linear phase FIR filter when impulse response is symmetric and N is even
with centre of symmetry at (N – 1)/2 is given by,

LM N O F N − 1I
2
H ee j = M ∑ 2 h e

j cos FGH IjJ P e− jω H 2 K
N −n
2
ω n− 1
e 2 KP .....(6.27)
MN n=1 PQ
Let, H(ejw ) = A(w) ejq(w) .....(6.28)
where, A(w) = Amplitude function
q(w) = Phase function
On comparing equation (6.27) and (6.28) we get,
N
2
Amplitude function, A ω = b g ∑ 2 he j cose e N −n
2
ω n− 1
2 jj .....(6.29)
n=1

Phase function, θ(ω ) = − ω e j=


N −1
2
– ωα ; where, α =
N −1
2 .....(6.30)
N
2
e j
Magnitude function, H e jω = A ω bg = ∑ 2 he N2 − nj coseωen − 12 jj .....(6.31)
n=1

The sketch of symmetrical impulse response when N = 8 and its corresponding amplitude function of
frequency response are shown in fig 6.12 and 6.13 respectively. From these sketches it can be observed that
the amplitude function of H(ejw ) is antisymmetric with w = p, when impulse response is symmetric and N is
even number.
When impulse response is symmetric and N is even, the frequency response is non-zero at
w = 0 and zero at w = p, and so this frequency response can be used to design lowpass and bandpass filters
but cannot be used to design highpass and bandstop filters.

Centre of antisymmetry
Centre of symmetry

N=8
N−1
α= = 3 .5
2

F ig 6.1 2 : S y m m etric im p u lse resp o n se , N = 8 . F ig 6.1 3 : A m p litu de fu n ctio n o f H (e jω).


Chapter 6 - FIR Filters 6. 12
Proof:

The Fourier transform of h(n) is,

+∞ N−1
H(e jω ) = h(n) is defined for
∑ h(n) e− jωn = ∑ h(n) e− jωn n = 0 to N – 1
n = −∞ n=0

For symmetric impulse response with even number of samples (i.e., when N is even), the centre of
symmetry lies between n = (N/2)–1 and n = N/2. Hence H(ejw ) is expressed as,
N −1
2 N−1

H(e ) = ∑ h( n) e− jωn + ∑ h(n) e− jωn
n= 0 n = N/2

N −1 N −1
Let, m = N − 1 − n ; ∴ n = N − 1 − m
2 2
= ∑ h( n) e − jωn
+ ∑ h(N − 1− m) e − jω (N −1− m)
When, n = N ; m = N −1− N = N − 1
n= 0 m= 0
2 2 2
When, n = N − 1 ; m = N − 1 − (N − 1) = 0
N −1 N −1
2 2
= ∑ h( n) e − jωn
+ ∑ h(N − 1 − n) e − jω (N − 1 − n)
Put, m = n
n= 0 n= 0

N − 1 N − 1 For symmetric
2 2
impulse response,
= ∑ h(n) e− jωn + ∑ h(n) e− jω (N−1−n)
h(N – 1 – n) = h(n).
n = 0 n = 0

LM
N − 1
F FG IJ N−1 FG IJ I O FG IJ N−1 N−1
2
= M ∑ h(n) G e − jωn H jω
K 2
e H
− jω (N−1−n)KJP e H K

2
− jω
2

MN G
H
e +e
JK PP
n = 0
Q
N − 1
L FG N−1IJ F IJ O N−1 F I N−1
2
= ∑ h(n) Me H

2 K + e GH b g
−n − jω
K P e GH JK
N− 1 −
2
−n − jω
2

n = 0
MN PQ
LM N −1
2 F F IK + e FH IK I OP e FH IK

N −1
−n − jω
N −1
−n − jω
N −1

= M ∑ h( n) G e H JK P
2 2 2

MN n=0 H PQ
jθ − jθ
LM N −1
2
OP FH IK − jω
N −1
cosθ = e + e
2
= M ∑ h( n) 2 cos e e jjP e 2
ω N −1 − n
2
MNn=0 PQ
LM
N −1 O F I
ijPP e H K
2 N −1
− jω
= M ∑ 2 h( n) cose d N 1 2
ω − n −
2 2
MN
n=0 PQ
LM N
2
OP FG IJ − jω
N −1 Let, k = − n ; ∴ n= −k N
2
N
2

= M∑ 2 he H K
MNk=1
2j cose e jjPP e
N− k ω k− 1
2
2
When, n = 0 ; k= N
2

Q When, n = − 1 ; k = − d − 1i =1 N
2
N
2
N
2
LM
N
2
OP FG IJ − jω
N −1

= M ∑ 2 he
MM
n=1
2 j cose e jjPP e H K
N − n ω n− 1
2
2
Put, k = n
N PQ
6. 13 Digital Signal Processing

Case (iii) : Frequency response of linear phase FIR filter when impulse response is antisymmetric and N
is odd with centre of antisymmetry at (N – 1)/2
The frequency response of linear phase FIR filter when impulse response is antisymmetric and N is
odd with centre of antisymmetry at (N – 1)/2 is given by,
LM N −1
2
OP FG
j π−
ω ( N −1) IJ
H ee j = M ∑ 2 h e j sin ωn e H K
jω 2 2

MN
N −1 − n
2 PP .....(6.32)
n=1
Q
Let, H(ejw ) = A(w) ejq(w) .....(6.33)
where, A(w) = Amplitude function
q(w) = Phase function
On comparing equations (6.32) and (6.33) we get,
N−1
2
Amplitude function, A (ω ) = ∑ 2 he N 2− 1 − nj sin ωn .....(6.34)
n=1

ω
Phase function, θ(ω ) = π – (N2 – 1) = β – αω .....(6.35)
2

π N − 1
where, β = and α =
2 2
N−1
2
Magnitude function, H ( e jω ) = A (ω ) = ∑ 2 he N 2− 1 − nj sin ωn .....(6.36)
n=1

A typical sketch of antisymmetric impulse response when N = 9 and its corresponding amplitude
function of frequency response are shown in fig 6.14 and fig 6.15 respectively. From these sketches it can be
observed that the amplitude function is antisymmetric with w = p when the impulse response is antisymmetric
and N is odd number.
The term ejp/2 makes the frequency response imaginary. Hence this frequency response is suitable for
designing Hilbert transformers and differentiators.

Centre of antisymmetry Centre of antisymmetry

N=9
N −1
α= =4
2

F ig 6 .1 4 : A n tisym m etric im p ulse respo n se, N = 9 . F ig 6 .1 5 : A m p litu d e fu n ctio n of H (e jω).


Chapter 6 - FIR Filters 6. 14
Proof:
The Fourier transform of h(n) is,
+∞
h(n) is defined for
N−1
jω − jωn n = 0 to N – 1
H(e ) = ∑ h(n) e = ∑ h(n) e − jωn

n = −∞ n=0
N−3
− jω N − 1 N−1 The impulse response is
2
e j+
= ∑
n=0
h( n) e− jωn + h e j N−1
2
e 2
∑ N+1
h( n) e− jωn antisymmetric with centre of
N −1
n= 2 antisymmetry at n = 2
N− 3
2 N−1
= ∑ h(n) e− jωn + ∑ h(n) e− jωn
N+1
h
N −1
e j=0
2
n=0 n= 2

N−3 N −3
2 2 Let, m = N – 1 – n ; \ n = N – 1 – m
= ∑ h( n) e− jωn + ∑ h(N −1 − m) e − jω( N −1− m)

n=0 m=0 When, n = N+1


2
; m = N − 1− e j=
N+1
2
N−3
2
N−3 N−3 When n = N – 1 ; m = N – 1 – (N – 1) = 0
2 2
− jωn − jω( N − 1 − n )
= ∑ h( n) e + ∑ h(N − 1 − n) e
n=0 n=0
Put, m = n
N −3 N−3
2 2
= ∑ h( n) e− jωn + ∑ b− h(n)g e− jω(N − 1 − n) For antisymmetric
impulse response,
n=0 n=0

LM N−3
2 F FG IJ

N−1

FG N − 1IJ I OP − jω
FG N − 1IJ
h(N – 1 – n) = –h(n).

= M ∑ h( n) G e − jωn
e
H K−e 2 − jω ( N − 1 − n )
e
H 2 K JJ P e H 2 K
MM n=0 G
H K PPQ
N
LM
N−3
2 F FHG

N−1
−n
IJ FG
− jω ( N −1) − n −
N−1 IJ I OP − jω
FG N − 1IJ
= M ∑ h( n) e G 2 K − e
H 2 K JJ P e H 2 K
MM
n=0 G
H K PPQ
N
LM N−3
F FHG N−1 IJ F N−1 IJ I OP F N −1I
2
= M ∑ h( n) G e

2
−n
K − e HG − jω
2
−n
JJ P e HG KJ
K − jω
2
e jθ − e− jθ
MM n=0 GH K PPQ sinθ =
N 2j

L OP I LM OP
N– 3
N–3
F N −1 2 jπ FG N −1IJ
= M
− jω −jω
2 H 2 K= F I H 2K
MM ∑ h( n) 2j sin ee
ω
N–1
2
– njjPP e MM ∑ 2 h(n)e
n=0
2
e
sin ω GH N2−1 − nJK jPP e
n=0
N Q N Q j= e
j
π
2

N−3
2
LM OP FG j
π

ω(N − 1) IJ Let, k =
N−1
− n ; ∴ n=
N−1
− k
eH K 2 2
= M ∑ 2 h( n) sineω e N−1
−n jj P 2 2
N−1
n=0 MN 2
PQ When, n = 0 ; k= 2
N −1
2
LM OP FG j
π

ω(N −1) IJ When, n =
N−3
2
; k=
N−1 N−3
2
− 2 =1
= M ∑ 2 he N −1
−k j sin ω k P eH 2 2 K
k=1 MN 2
PQ
LM
N −1
2
OP FG j
π

ω(N −1) IJ
= M∑ 2 he
MN
n =1
N −1
2
−n j sin ωnPP e H 2 2 K Put, k = n

Q
6. 15 Digital Signal Processing
Case (iv) : Frequency response of linear phase FIR filter when impulse response is antisymmetric and N is even
with centre of antisymmetry at (N – 1)/2
The frequency response of linear phase FIR filter when impulse response is antisymmetric and N is
even with centre of antisymmetry at (N – 1)/2 is given by,
LM N
2
OP FGH j π−
ω ( N −1) IJ
K
He e j = M ∑ 2 h e j e e jjP e
jω 1 2 2
sin
2
ω
N −n n−
2
MN n=1 PQ .....(6.37)

Let, H(ejw ) = A(w) ejq(w) .....(6.38)


where, A(w) = Amplitude function
q(w) = Phase function
On comparing equations (6.37) and (6.38) we get,
N
2
Amplitude function, A(ω ) = ∑ 2 he N2 − nj sinFH ωFGH n − 21 IJK IK .....(6.39)
n=1

π
Phase function, θ(ω ) =
2 2
e j
– ω N – 1 = β – αω

π N−1 .....(6.40)
where, β = and α = 2
2
N
2
Magnitude function, H (e jω ) = A (ω ) = ∑ 2 he N2 − nj sinFH ωFGH n − 21 IJK IK .....(6.41)
n=1

The sketch of antisymmetric impulse response when N = 8 and its corresponding amplitude function
of frequency response are shown in fig 6.16 and fig 6.17 respectively. From these sketches it can be
observed that the amplitude function of H(ejw ) is symmetric with w = p, when the impulse response is
antisymmetric and N is even number.
The term ejp/2 makes the frequency response imaginary. Hence this frequency response is suitable for
designing Hilbert transformers and differentiators.

Centre of antisymmetry Centre of symmetry

N=8
α= N − 1 = 3 .5
2

F ig 6.1 6 : A n tisym m etric im p u lse jω


resp o n se , N = 8 . F ig 6.1 7 : A m p litu de fu n ctio n o f H (e ).
Chapter 6 - FIR Filters 6. 16
Proof:
The Fourier transform of h(n) is,
h(n) is defined only
+∞ N−1 for n = 0 to N – 1
H(e jω ) = ∑ h(n) e− jωn = ∑ h(n) e− jωn
n = −∞ n=0 The impulse response is antisymmetric
N
−1
with centre of antisymmetry
2 N−1
N−1 N
lies between n = and .
= ∑ h( n) e− jωn + ∑ h(n) e− jωn 2 2

n=0 N
n=
2 Let, m = N–1– n ; \ n = N –1–m
N N
−1 −1 N N N
2 2
When, n = ; m = N − 1 − = −1
= ∑ h( n) e− jωn + ∑ h(N − 1 − m) e− jω(N −1− m) 2 2 2
n=0 m=0 When, n = N–1 ; m = N –1– (N – 1) = 0
N N
−1 −1
2 2
= ∑ h( n) e− jωn + ∑ h(N − 1− n) e− jω(N −1− n) Put, m = n
n=0 n=0
N N
−1 −1 For antisymmetric
2 2
= ∑ h( n) e − jωn
+ ∑ b− h( n)ge − jω( N − 1 − n) impulse response,
h(N – 1 – n) = –h(n).
n=0 n=0
LM N
2
−1 F FG IJ

N−1

FG N − 1IJ I OP − jωFG N − 1IJ
= M ∑ h( n) G e − jωn
e
H K –e 2 − jω(N − 1 − n)
e
H 2 K JP e H 2 K
MM n=0 GH JK P
N PQ
LM N
−1 F FGH N−1 IJ N−1 I OP FG N − 1IJ
2
= M ∑ h( n) G e

2 K −e b g
−n − jω N − 1 − n −
2 JJ P e − jω
H 2 K
MM n=0 GH K PPQ
N
LMN
−1 F FGH N−1 IJ F N−1 IJ I OP − jω FG N – 1IJ e jθ − e− jθ
2
= M ∑ h( n) G e

2
–n
K – e GH − jω
2
–n
KJP e H 2 K sinθ =
MM
n=0 GH JK P 2j
N PQ
LM
N
−1 OP FG N–1 IJ
2
= M ∑ h( n) 2j sin ωe F N–1
j I P e
− jω
H 2 K
MM
n=0
H 2
–n
K PP
N Q
N
−1 LM jπ
OP FG N –1IJ
2
= M ∑ h( n) 2e sin H ω e 2 F N
–n–
1 I
jK PP e
− jω
H 2K
n =0 MM 2 2

PQ
N π
N LM
−1 OP FG π ω( N − 1) IJ j= e
j
2
2
= M ∑ 2 h(n) sinH ωe F N
−n−
1I
jK PP e H
j
2

2 K
MM
n= 0
2 2
PQ
N Let, k = N
2
−n ; ∴ n= N
2
−k
N
LM O F IJ N
FG IJ P e GH
2 π ω (N −1) When, n = 0 ; k=
j −
= M ∑ 2 he K 2

MN
N
2
−kj sin e ω H K jP k−
PQ
1
2
2 2
When, n = N
2
−1 ; k = N
2
− d −1i =1
N
2
k=1

N
2
LM OP FG j
π

ω(N −1) IJ Put, k = n
= M ∑ 2 he
n=1 MN
N
2
−n j sineωe jjPP e H n−
1
2
2 2 K
Q
6. 17 Digital Signal Processing
Case (v) : Frequency response of linear phase FIR filter when impulse response is symmetric and N is odd
with centre of symmetry at n = 0
The frequency response of linear phase FIR filter when impulse response is symmetric and N is odd
with centre of symmetry at n = 0, is given by,
N −1
2
.....(6.42)
e j
H e jω = h(0) + ∑ 2 h( n) cos ωn
n=1

Let, H(ejw ) = A(w) e jq(w) .....(6.43)


where, A(w) = Amplitude function
q(w) = Phase function
On comparing equations (6.42) and (6.43) we get,
N −1
2
Amplitude function, A(ω ) = h(0) + ∑ 2 h(n) cos ωn .....(6.44)
n=1

Phase function, θ(ω ) = 0 .....(6.45)


N −1
2

Magnitude function, H(e ) = A(ω ) = h(0) + ∑ 2 h(n) cos ωn .....(6.46)
n=1

A typical sketch of symmetric impulse response when N = 9 and its corresponding amplitude function
of frequency response are shown in fig 6.18 and fig 6.19 respectively. From these sketches it can be observed
that the amplitude function of H(ejw ) is symmetric with w = p, when the impulse response is symmetric and N
is odd number.
When impulse response is symmetric and N is odd, the frequency response is non-zero at
w = 0 and w = p, and so this frequency response can be used to design lowpass, highpass, bandpass and
bandstop filters.

Centre of symmetry Centre of symmetry

N −1 = 4
2

F ig 6.1 8 : S y m m etric im p u lse resp o n se for N = 9 . F ig 6.1 9 : A m p litu d e fu n ctio n o f H (e jω).


Chapter 6 - FIR Filters 6. 18
Proof:
The Fourier transform of h(n) is,
+∞ +N − 1 h( n) is defined only
2
jω − jωn − jωn
H(e ) = ∑ h(n) e = ∑ h(n) e for n = − N 2− 1 to + N 2− 1 .
n = −∞ n= − N - 1
2

N−1
−1 2 Here, centre of
= ∑ h(n) e − jωn
+ h(0) + ∑ h(n) e − jωn
symmetry is n = 0.
N−1 n=1
n= −
2
N−1 N−1
2 2 Using symmetry
= ∑ h(− n) e jωn + h(0) + ∑ h(n) e− jωn condition h(– n) = h(n).
n=1 n=1
N−1 N−1
2 2
jωn
= ∑ h(n) e + h(0) + ∑ h(n) e− jωn
n=1 n=1
N−1
2
e jθ + e− jθ
= h(0) + ∑ h(n) e jωn + e− jωn cosθ =
2
n=1
N−1
2
= h(0) + ∑ h(n) 2 cos ωn
n=1
N−1
2
= h(0) + ∑ 2 h(n) cos ωn
n=1

Case (vi) : Frequency response of linear phase FIR filter when impulse response is antisymmetric and N
is odd with centre of antisymmetry at n =0
The frequency response of linear phase FIR filter when impulse response is antisymmetric and N is
odd with centre of antisymmetry at n = 0, is given by,
LM N −1
2
OP −jπ
Hee j = M ∑ 2 h( n) sin ωn P e
jω 2
.....(6.47)
MN n=1 PQ
Let, H(ejw ) = A(w) ejq(w) .....(6.48)
where, A(w) = Amplitude function
q(w) = Phase function
On comparing equations (6.47) and (6.48) we get,
N−1
2
Amplitude function, A (ω ) = ∑ 2 h( n) sin ωn .....(6.49)
n=1

π
Phase function, θ(ω ) = − .....(6.50)
2
N−1
2
Magnitude function, H ( e jω ) = A (ω ) = ∑ 2 h( n) sin ωn .....(6.51)
n=1
6. 19 Digital Signal Processing
A typical sketch of antisymmetric impulse response when N = 9 and its corresponding amplitude
function of frequency response are shown in fig 6.20 and fig 6.21 respectively. From these sketches it can be
observed that the amplitude function is antisymmetric with w = p when the impulse response is antisymmetric
and N is an odd number.
The term ejp/2 makes the frequency response imaginary. Hence this frequency response is suitable for
designing Hilbert transformers and differentiators.
Centre of antisymmetry Centre of antisymmetry

N −1
=4
2

F ig 6 .2 0 : A n tisym m etric im p u lse F ig 6 .2 1 : A m p litu d e fu n ctio n of H (e jω) .


resp o n se , N = 9 .

Proof:
The Fourier transform of h(n) is,
h( n) is defined only
+∞ +N − 1
2
H(e jω ) = for n = − N 2− 1 to + N 2− 1 .
∑ h(n) e− jωn = ∑ h(n) e− jωn N −1
n = −∞ n= −
2

N−1
−1 2 Here, centre of
− jωn
= ∑ h(n) e + h(0) + ∑ h(n) e− jωn antisymmetry is n = 0.
N−1 n=1
n= −
2
N−1 N−1
2 2 Here, h(0) = 0
jωn
= ∑ h(− n) e + ∑ h( n) e− jωn
n=1 n=1
N−1 N−1
Using symmetric
2 2
jωn − jωn condition h(– n) = –h(n).
= ∑ (− h(n)) e + ∑ h(n) e
n=1 n=1
N−1 N−1
2 2 e jθ − e− jθ
jωn − jωn sinθ =
= − ∑ h(n) e −e = − ∑ h(n) 2 j sin ωn 2j
n=1 n=1

LM N−1
2
OP LM OP
N−1
2 −j
π π
−j
= M ∑ 2h( n) sin ωn P (− j) = M ∑ 2h( n) sin ωn P e 2
−j= e 2
MM n=1 PP MM PP
n=1
N Q N Q
Chapter 6 - FIR Filters 6. 20

Table 6.1 : Summary of Frequency Response Characteristics of Linear Phase FIR Filters
Case h(n) N A(w
w)
[Impulse Response] [Number of Symmetry [Amplitude
samples of h(n)] condition function of H(ejww )]
i Symmetric Odd h(N – 1 – n) = h(n) Symmetric
ii Symmetric Even h(N – 1 – n) = h(n) Antisymmetric
iii Antisymmetric Odd h(N – 1 – n) = – h(n) Antisymmetric
iv Antisymmetric Even h(N – 1 – n) = – h(n) Symmetric
v Symmetric Odd h(– n) = h(n) Symmetric
vi Antisymmetric Odd h(– n) = –h(n) Antisymmetric
Table 6.2 : Summary of A(w
w ) for Linear Phase FIR Filters
Case h(n) N Symmetry Magnitude function,
[Impulse response] condition |H(ejww )| = |A(w
w )|
N−1
2
N −1
i Symmetric Odd h(N – 1 – n) = h(n)
he j + ∑ 2 he
N –1
2
n=1
2 j
– n cos ωn

N
2

ii Symmetric Even h(N – 1 – n) = h(n) ∑


n=1
2h e j coseωe jj
N
2
–n n–
1
2

N–1
2

iii Antisymmetric Odd h(N – 1 – n) = – h(n) ∑


n=1
2he N –1
2
–n j sin ωn
N
2

iv Antisymmetric Even h(N – 1 – n) = – h(n) ∑ 2 he N2 – nj sineωen – 21 jj


n =1

N −1
2

v Symmetric Odd h(– n) = h(n)


h( 0) + ∑ 2 h( n) cosωn
n =1

N −1
2

vi Antisymmetric Odd h(– n) = –h(n) ∑ 2 h( n) sin ωn


n =1

6.6 Design Techniques for Linear Phase FIR Filters


There are three well known method of design techniques for linear phase FIR filters.
1. Fourier series method and Window method.
2. Frequency sampling method.
3. Optimal filter design methods.
6. 21 Digital Signal Processing

Design of Linear Phase FIR Filters by Fourier Series Method


The following two concepts leads to the design of FIR filters by Fourier series method.
1. The frequency response of a digital filter is periodic with period equal to 2p.
2. Any periodic function can be expressed as a linear combination of complex exponentials.
In this method the desired frequency response, Hd(ejw ) can be converted to a Fourier series representation.
Then using this expression the Fourier coefficients are evaluated which is the desired impulse response of the
filter, hd(n). On taking Z-transform of hd(n) we get Hd(z) which is the transfer function of digital filter.
The Hd(z) obtained from hd(n) will be a transfer function of unrealizable noncausal digital filter of
infinite duration. A finite duration impulse response h(n) can be obtained by truncating the infinite duration
N −1 N −1
impulse response hd(n) to N-samples. The samples of hd(n) are selected for n = − 2 to + 2 . Now take
Z-transform of h(n) to get H(z) and then multiply H(z) by z - (N - 1) / 2 to get the transfer function of realizable
causal digital filter of finite duration.
The abrupt truncation of the Fourier series results in oscillations in the passband and stopband.
These oscillations are due to slow convergence of the Fourier series, particularly near the points of
discontinuity. This effect is known as the Gibbs phenomenon. It can be shown that the undesirable oscillations
can be reduced by multiplying the desired impulse response coefficients by an appropriate window function.
This leads to the method of FIR filter design using windows.
Design of Linear Phase FIR Filters Using Windows
In this method we begin with the desired frequency response specification Hd(ejw ) and determine the
corresponding unit sample response hd(n). The hd(n) is given by inverse Fourier transform of Hd(ejw ). The
unit sample response h d(n) will be an infinite sequence and must be truncated at some point say
at n = N – 1 to yield an FIR filter of length N. The truncation is obtained by multiplying hd(n) by a window
sequence w(n). [w(n) is also called window function]. The resultant sequence will be of length N and can be
denoted by h(n).
The Fourier transform of h(n) is the frequency response of the filter to be implemented in software or
in hardware. The frequency response of the filter is denoted by H(ejw ). The Z-transform of h(n) will give the
filter transfer function H(z). The frequency response of the filter H(ejw ) depends on the frequency response
of the window function.
The desirable characteristics of the frequency response of window function are the following.
1. The width of the main-lobe should be small and it should contain as much of the total energy as possible.
2. The side-lobes should decrease in energy rapidly as w tends to p.
There have been many windows proposed, that approximates the desired characteristics. In the
following sections, the Rectangular window, Hanning window, Hamming window, Blackman window and
Kaiser window are discussed.
Design of Linear Phase FIR Filters by Frequency Sampling Method
In frequency sampling method of filter design, we begin with the desired frequency response
specification Hd(ejw ) and it is sampled at N-points to generate a sequence H(k). The N-point inverse DFT of
the sequence H(k) gives the impulse response of the filter h(n). The Fourier transform of h(n) gives the
frequency response, H(ejw ) and Z-transform of h(n) gives the transfer function H(z) of the filter.
Design of Optimum Equiripple Linear-Phase FIR Filter
The FIR filter design by window and frequency sampling method does not have precise control over the
critical frequencies such as w p (passband edge frequency) and w s (stopband edge frequency). This drawback
can be overcome by using Chebyshev approximation technique. In this method, the weighed approximation
Chapter 6 - FIR Filters 6. 22
error between the desired frequency response and the actual frequency response is spread evenly across the
passband and evenly across the stopband of the filter. This results in the reduction of maximum error. The
resulting filter have ripples in both the passband and the stopband. This concept of design is called optimum
equiripple design criterion.
6.7 Fourier Series Method of FIR Filter Design
The frequency response of a digital filter is periodic, with period equal to 2p. From Fourier series
analysis, we know that any periodic function can be expressed as a linear combination of complex exponentials.
Therefore, the desired frequency response, Hd(ejw ) of an FIR digital filter can be represented by the Fourier
series as shown in equation (6.52).
+∞
e j ∑ h ( n) e
H d e jω =
n = −∞
d
− jωn
.....(6.52)

where, the Fourier coefficients hd(n) are the desired impulse response sequence of the filter.
The samples of hd(n) can be determined using equation (6.53), which is inverse Fourier transform of Hd(ejw ).
π
hd ( n) =
1
2π − πz e j
H d e jω e jωn dω .....(6.53)

The impulse response obtained from equation (6.53) is an infinite duration sequence. For FIR filters we
truncate this infinite impulse response to a finite duration sequence of length N, where N is odd.
N −1
∴ h( n) = hd ( n) ; for n = − e j to + e j
N −1
2 2
Let, HN(z) = Z{h(n)}
By definition of Z-transform,
N−1
2
H N ( z) = ∑ h( n) z − n .....(6.54)
N−1
n=−
2
The transfer function of equation (6.54) represents noncausal filter (due to the presence of positive
powers of z). Hence the transfer function of equation (6.54) is multiplied by z-(N - 1)/2 .


N −1
N −1
2

N −1
LM −1
N −1
2
OP
\ H(z) = z –(N – 1)/2
HN(z) = z 2
∑ h( n) z
N −1
−n
=z 2
MM ∑ h(n) z
N −1
−n
+ h(0) + ∑ h( n) z −n
PP
n= −
2 N
n= −
2
n=1
Q

N −1
LM
N −1
2
N −1
2
OP The Fourier coefficients h(n)
= z 2
MM ∑ h(−n) z + h(0) + ∑ h(n) z
n −n
PP is symmetric, with n = 0.
n=1
N n=1
Q \ h(–n) = h(n)


N −1
LM N −1
2
OP
= z 2
MM h ( 0) + ∑ h ( n ) z + z n
PP −n
.....(6.55)
N n=1
Q
Hence we see that causality is brought about by multiplying the transfer function by the delay factor
a = (N - 1)/2. This modification does not affect the amplitude response of the filter, however the abrupt
truncation of the Fourier series results in oscillations in the passband and stopband. These oscillations are
due to the slow convergence of the Fourier series, particularly near the points of discontinuity. This effect is
known as Gibbs phenomenon. The undesirable oscillations can be reduced by multiplying the desired impulse
response coefficients by an appropriate window function.
6. 23
Table 6.3 : Specification and Desired Impulse Response for FIR Filter Design by Fourier Series Method

Type of filter Specifications Impulse response

π +ω c

Lowpass H d ( e jω
R|1 ; for
) = S0 ; for
– ωc ≤ ω ≤ + ωc
−π ≤ ω < – ωc
h d ( n) =
1
2π z
−π

H d (e ) e jωn
dω =
1
2π z
−ω c
e jωn dω

||0 ; for jω
T ωc < ω ≤ π Q H d (e ) = 0 in the range − π ≤ ω < − ω c and + ω c < ω ≤ π

π −ω c π

Highpass H d (e jω
R|1 ; for
) = S1 ; for
– π ≤ ω ≤ – ωc
ωc ≤ ω ≤ π
h d ( n) =
1
2π z
−π
H d (e jω ) e jωn dω =
1
2π z
−π
e jωn dω +
1
2π z
ωc
e jωn dω

||0 ; for jω
T – ωc < ω < + ωc Q H d ( e ) = 0 in the range − ω c < ω < +ω c

R|1 ; for – ω c2 ≤ ω ≤ – ω c1 π − ω c1 ω c2

Bandpass H d ( e jω
||1 ; for
) = S0 ; for –π
ω c1 ≤ ω ≤ ω c2
≤ ω < − ω c2
h d ( n) =
1
2π z
−π
H d ( e jω ) e jωn dω =
1
2π z
−ω c2
e jωn dω +
1

ω c1
z e jωn dω

||0 ; for – ω c1 < ω < + ω c1 Q H d ( e jω ) = 0 in the range − π ≤ ω < −ω c 2 ; − ω c1 < ω < + ω c1 and + ω c2 < ω ≤ π
||0 ; for
T ω c2 < ω ≤ π

R|1 ; for –π ≤ ω ≤ – ω c2 −ω c2 ω c1

Bandstop
|1 ; for
|
) = S1 ; for
– ω c1 ≤ ω ≤ + ω c1 h d ( n) =
1
2π z
π

H d ( e jω ) e jωn dω =
1
2π z e jωn dω +
1
2π z e jωn dω +
1
2π z

e jωn dω

Digital Signal Processing


−π −π − ω c1 ω c2
H d ( e jω ω c2 ≤ ω ≤ π
||0 ; for – ω c2 < ω < – ω c1 Q H d ( e jω ) = 0 in the range − ω c 2 < ω < −ω c1 and + ω c1 < ω < +ω c 2
||0 ; for
T ω c1 < ω < ω c2
Chapter 6 - FIR Filters 6. 24
The specifications of lowpass, highpass, bandpass and bandstop filters and their desired impulse
response for FIR filter design by Fourier series method are listed in table 6.3.
Procedure for digital FIR filter design by Fourier series method
1. The specifications of digital FIR filter are,
i) The desired frequency response, Hd(ejw ).
ii) The cutoff frequency w c for lowpass and highpass, and w c1 & w c2 for bandpass and bandstop
filters.
Note: If analog filter cutoff frequency Fc and sampling frequency Fs are specified, then calculate
the cutoff frequency of digital filter wc using the equation,
2πFc
ωc = .
Fs
iii) The number of samples of impulse response, N.
2. Determine the desired impulse response, hd(n) by taking inverse Fourier transform of the desired
frequency response, Hd(ejw ).
π
hd ( n) =
1
z
2π − π
e j
H d e jω e jωn dω

(For limits of integration in the above equation, refer table 6.3)


3. Calculate N samples of hd(n) for n = –(N – 1)/2 to +(N – 1)/2 and form the impulse response, h(n)
of FIR filter.

∴ Impulse response, h(n) = h d ( n)


N −1 N −1
n= − to +
2 2

The impulse response is symmetric with n = 0, and so h(–n) = h(n). Hence it is sufficient if we,
calculate h(n) for n = 0 to +(N – 1)/2.
4. Take Z-transform of the impulse response to get the noncausal transfer function of FIR filter, HN(z).
N −1
+
2
l q
∴ H N ( z) = Z h ( n ) = ∑ h( n ) z − n
N −1
n=−
2

5. Convert the noncausal transfer function, HN(z) to causal transfer function, H(z) by multiplying
HN(z) by z –(N – 1)/2
N −1
+
N −1 2

∴ Transfer function, H(z) = z 2
∑ h( n) z − n
N −1
n=−
2
Alternatively,


N −1
LM N −1
2
OP Applying symmetry
condition, h(–n) = h(n).
Transfer function, H(z) = z 2
MMh(0) + ∑ h(n) z n
+z −n
PP Refer equation (6.55).
N n=1
Q
6. Draw a suitable structure for realization of FIR filter.
6. 25 Digital Signal Processing
Design verification
1. Determine the frequency response, H(ejw ).
Method - 1 : Choose a linear phase magnitude function |H(ejw )| from table 6.2. Using h(n),
obtain an equation for |H(ejw )|.
Method - 2 : The frequency response, |H(ejw )| can be obtained by replacing z by ejw in the
transfer function, H(z).

∴ Frequency response, H e jω = H ( z) e j z = e jω

2. Calculate frequency response for various values of w in the range 0 to p.


3. Calculate the magnitude response, |H(ejw )| and sketch the magnitude response to verify the design.

Example 6.1
Design a FIR lowpass filter with cutoff frequency of 1 kHz and sampling frequency of 4 kHz with 11
samples using Fourier series method. Determine the frequency response and verify the design by sketching the
magnitude response.

Solution
Given that, Fc = 1 kHz ; Fs = 4 kHz
Ωc 2 πFc 2π × 1 × 10 3
∴ ω c = Ω cT = = = = 0.5 π rad / sample
Fs Fs 4 × 103

The desired frequency response Hd(ejw ) of lowpass filter is,

Hd (e jω ) = 1 ; for – ω c ≤ ω ≤ + ω c
= 0 ; for – π ≤ ω < − ω c and ωc < ω ≤ π

The desired impulse response hd(n) of the lowpass filter is,


+π +ω c

hd (n) =
1
2π z
−π
Hd (ejω ) e jωn dω =
1
2π z
−ω c
1 × e jωn dω

=
LM e OP = 1 LM e − e OP
1 jωn +ω c jω cn
e − e
− jω cn
jθ jθ
When n = 0, the factor
sinω cn
N jn Q 2π MN jn jn PQ sinθ = 2j
2π −ω c πn
becomes 0 / 0,
which is indeterminate.
1 Le −e OP = 1 sin ω n ; for all n, except n = 0.
jω cn − jω cn
=
πn N
M 2j Q πn c
U sin g L' Hospital rule,
sin ω cn 1 sin ω cn ω c sin Aθ
When, n = 0 ; hd (n) = hd (0) = Lt = Lt = Lt =A
n→ 0 πn π n→0 n π θ→ 0 θ
The impulse response h(n) of FIR filter is obtained by truncating hd(n) to 11 samples.
sin ω cn N−1 N−1
∴ h(n) = hd (n) = ; for n = − 2 to +
2
, except n = 0

ωc
= ; for n = 0
π
N − 1 11 − 1
Here, N = 11, ∴ = =5
2 2
Hence, calculate h(n) for n = –5 to +5
Since, the impulse response h(n) satisfies the symmetry condition, h(–n) = h(n), calculate h(n) for n = 0 to 5.
Chapter 6 - FIR Filters 6. 26
ωc
When n = 0 ; h(0) = = 0.5
π

When n = 1 ; h(1) =
c
sin 0.5π × 1 h = 0.3183
π ×1 Note : Calculate sin q by keeping the
calculator in radian mode.
When n = 2 ; h(2) =
c
sin 0.5π × 2 h=0
π ×2

When n = 3 ; h(3) =
c
sin 0.5π × 3 h = −0.1061
π ×3

When n = 4 ; h(4) =
c
sin 0.5π × 4 h=0
π×4

When n = 5 ; h(5) =
c
sin 0.5π × 5 h = 0.0637
π×5

When n = −1 ; h(−1) = h(1) = 0.3183


Using symmetry
When n = −2 ; h( −2) = h(2) = 0 condition, h(–n) = h(n).
When n = −3 ; h( −3) = h(3) = −0.1061
When n = −4 ; h( −4) = h(4) = 0
When n = −5 ; h( −5) = h(5) = 0.0637

The transfer function H(z) of the digital lowpass filter is given by,


N−1

N−1
LM+
N−1
2
OP 5
H(z) = z 2 l q
Z h(n) = z 2
MM ∑ h(n) z
N−1
−n −5
PP = z ∑ h(n) z −n

n = −5
N
n= −
2 Q
= z−5 [h(−5) z5 + h( −4) z4 + h(−3) z3 + h(−2) z2 + h( −1) z + h(0) z0 + h(1)z−1 + h(2) z −2

+ h(3) z−3 + h(4) z −4 + h(5) z−5 ]


= z−5 [h(5) z5 + h(4) z4 + h(3) z3 + h(2) z2 + h(1) z + h(0) Using symmetry
condition, h(–n) = h(n).
+ h(1)z−1 + h(2) z−2 + h(3) z−3 + h(4) z−4 + h(5) z −5 ]

= z−5 h(0) + h(1) z + z−1 + h(2) z2 + z−2 + h(3) z3 + z−3 + h(4) z4 + z−4 + h(5) z5 + z−5

= h(0) z−5 + h(1) z −4 + z −6 + h(2) z −3 + z−7 + h(3) z −2 + z −8 + h(4) z −1 + z −9 + h(5) z0 + z −10

= 0.5 z−5 + 0.3183 z −4 + z −6 − 0.1061 z−2 + z −8 + 0.0637 1 + z−10 h(2) = 0


h(4) = 0
Structure

Y(z)
Let , H(z) = = 0.5 z −5 + 0.3183 z−4 + z−6 − 0.1061 z−2 + z−8 + 0.0637 1 + z −10
X(z)

∴ Y(z) = 0.5 z−5 X(z) + 0.3183 z−4 X(z) + z−6 X(z) − 0.1061 z−2 X(z) + z−8 X(z)

+ 0.0637 X(z) + z −10 X(z)

The above equation can be used to draw the FIR filter structure as shown in fig 1.
6. 27 Digital Signal Processing

−1 −2 −3 −4 −5
X (z ) −1
z X (z ) −1
z X (z ) −1
z X (z )
−1
z X (z ) −1
z X (z )
z z z z z
w
+ + +
−1 −1 −1 −1 −1
z z z z z
−10 −9 −8 −7 −6
z X (z ) z X (z ) z X (z ) z X (z ) z X (z )

0 .0 6 37 −0.1061 0.31 83
0 .5

−2 −8 −4 −6 −5
−10 −0.1061[z X (z ) + z X (z )] 0.3183[z X (z ) + z X (z )] 0.5z X (z)
0.0637[X (z) + z X (z )]

+ + + Y (z)
F ig 1 : L in ea r ph a se stru c tu re o f F IR lo w p a ss filter.

Frequency Response

When impulse response is symmetric and N is odd with centre of symmetry at n = 0, the magnitude
response, |H(ejww )| is given by |A(w
w )|,
N− 1
2
where, A(ω ) = h(0) + ∑ 2 h(n) cos ωn Refer table 6.2 case (v)
n =1

5
= h(0) + ∑ 2 h(n) cos ωn
n =1

= h(0) + 2 h(1) cos ω + 2 h(2) cos 2ω + 2 h(3) cos 3ω + 2 h(4) cos 4ω + 2 h(5) cos 5ω
= 0.5 + 2 × 0.3183cosω + 2 × 0 cos2ω + 2 × −0.1061 cos 3ω + 2 × 0cos 4ω
+ 2 × 0.0637cos5ω
= 0.5 + 0.6366 cosω − 0.2122 cos 3ω + 0.1274 cos 5ω
Using the above equation the amplitude response A(w) and magnitude function |H(ejw )| are calculated for
various values of w and listed in table 1. Using the tabulated values, the magnitude response is sketched as
shown in fig 2.

w ) and |H(ejww )| for various values of w .


Table 1: A(w
w A(w
w) |H(ejww )| = |A(w
w )| w A(w
w) |H(ejww )| = |A(w
w )|
0× π 9× π
16
1.0518 1.0518 16
0.1520 0.1520
1×π 10 × π
16
1.0187 1.0186 16
–0.0574 0.0574
2×π 11×π
16
0.9581 0.9581 16
–0.0866 0.0866
3×π 12× π
16
0.9457 0.9457 16
–0.0101 0.0101
4× π 13× π
16
1.0101 1.0102 16
0.0542 0.0542
5×π 14 × π
16
1.0866 1.0866 16
0.0418 0.0418
6× π 15× π
16
1.0573 1.0574 16
–0.0187 0.0187
7× π 16 × π
16
0.8480 0.8479 16
–0.0518 0.0518
8× π
16
0.5 0.5
Chapter 6 - FIR Filters 6. 28

|H (e )|
1.1

1.0

0.9

0.8

0.7

0.6

0.5

0.4

0.3

0.2

0.1

ω
0 π 2π 3π 4π 5π 6π 7π 8π 9π 10 π 11π 12 π 13 π 14 π 15 π 16 π
16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16
( π/2 ) ( π)
F ig 2 : M a gn itu d e resp o n se o f F IR low p a ss filte r.
Alternate Method for Frequency Response

e j
Frequency response, H e jω = H ( z)
z = e jω

e j
∴ H e jω = 0.5z −5 + 0.3183 z −4 + z −6 − 01061
. z −2 + z −8 + 0.0637 1 + z −10
z = e jω

= 0.5e − j5ω + 0.3183 e − j4ω + e − j6ω − 01061


. e − j2ω + e − j8ω + 0.0637 1 + e − j 10ω

= 0.5 cos5ω − j sin 5ω + 0.3183 cos 4ω − j sin 4ω + cos 6ω − j sin 6ω

− 01061
. cos 2ω − j sin 2ω + cos8ω − j sin 8ω + 0.0637 1 + cos10ω − jsin 10ω

= [0.5cos5ω + 0.3183 cos 4ω + 0.3183 cos 6ω − 0.1061cos 2ω − 0.1061cos8ω + 0.0637 + 0.0637 cos10ω ]

+ j[ −0.5 sin 5ω − 0.3183 sin 4ω − 0.3183 sin 6ω + 0.1061sin 2ω + 01061sin8


. ω − 0.0637 sin 10ω ]
Using the above equation, the frequency response H(ejw ) and magnitude function |H(ejw )| of lowpass filter are calculated for various values
of w and listed in table 2. It is observed that the magnitude response obtained by both the methods are same.
Table 2: H(ejww ) and |H(ejww )| for various values of w
w H(ejw ) |H(ejw )| w H(ejw ) |H(ejw )|
0× π 9×π
1.0518 + j0 1.0518 –0.1264 – j0.0844 0.1520
16 16
1× π 10 × π
0.5659 – j0.8470 1.0186 0.0530 – j0.022 0.0574
16 16
2×π 11 × π
–0.3667 – j0.8852 0.9581 0.0169 – j0.0850 0.0866
16 16
3× π 12 × π
–0.9276 – j0.1845 0.9457 –0.0071 – j0.0071 0.0100
16 16
4×π 13 × π
–0.7143 + j0.7143 1.0102 0.0532 – j0.0106 0.0542
16 16
5× π 14 × π
0.2120 + j1.0657 1.0866 0.0160 – j0.0386 0.0418
16 16
6× π 15 × π
0.9769 + j0.4046 1.0574 0.0104 + 0.0155 0.0186
16 16
7×π 16 × π
0.7050 – j0.4711 0.8479 0.0518 + j0 0.0518
16 16
8×π
0 – j0.5 0.5
16
6. 29 Digital Signal Processing
Example 6.2
Design a FIR highpass filter with cutoff frequency of 1.5 kHz and sampling frequency of 5 kHz with 7
samples using Fourier series method. Determine the frequency response and verify the design by sketching the
magnitude response.
Solution
Given that, Fc = 1.5 kHz ; Fs = 5 kHz
Ω 2πFc 2π × 1.5 × 103
ω c = Ω cT = c = = = 0.6π rad / sample
Fs Fs 5 × 103
The desired frequency response Hd(ejw ) of highpass filter is,

e j
Hd ejω = 1 ; for − π ≤ ω ≤ −ω c and ωc ≤ ω ≤ π

= 0 ; otherwise
The desired impulse response hd(n) of the highpass filter is,
π −ω c π
hd (n) =
1
2π z
−π
e j
Hd e jω e jωn dω =
1
2π z
−π
1 × e jωn dω +
1
2π z
ωc
1 × e jωn dω

=
1 LM e OP
jωn − ω c
+
1 LM e OP
jωn π
=
1 LM e
− jω cn

OP
e − jπn
+
1 LM e
jπn

e jω cn OP
2π MN jn PQ −π
2π MN jn PQ ωc
2π MN jn jn PQ 2π MN jn jn PQ
=
1 LM e − e
jπn − jπn

e jω cn
− e− jω cn OP
πn MN 2j 2j PQ e jθ − e− jθ
sinθ =
2j
1
= sin πn − sin ω cn ; for all n, except n = 0.
πn

When n = 0 ; hd (n) = hd (0) = Lt


LM sin πn − sin ω n OP c
When n = 0 ; the hd(n) become
n→ 0 N πn Q 0/0, which is indeterminate.
sin πn sin ω cn
= Lt − Lt
n→ 0 πn n→ 0 πn U sin g L' Hospital rule,
1 sin πn 1 sin ω cn
= Lt − Lt sin Aθ
π n→ 0 n π n→ 0 n Lt =A
θ→ 0 θ
1 1 ω
= ×π − × ωc = 1− c
π π π
The impulse response h(n) of FIR filter is obtained by truncating hd(n) to 7 samples.

sin πn − sin ω cn sin ω cn N 1 N− 1


∴ h(n) = hd (n) = =− ; for n = − 2− to + 2
, except n = 0
πn πn
ω For any integer n,
= 1 − c ; for n = 0 sin pn = 0
π

N−1 7 −1
Here, N = 7, ∴ = =3
2 2
Hence, calculate h(n) for n= –3 to 3.

Since, the impulse response h(n) satisfies the symmetry condition, h(–n) = h(n), calculate h(n) for n = 0 to 3.
Chapter 6 - FIR Filters 6. 30

ωc
When n = 0 ; h(0) = 1 − = 0.4
π

When n = 1 ; h(1) = −
b
sin 0.6π × 1 g = −0.3027
π ×1

When n = 2 ; h(2) = −
b
sin 0.6π × 2 g = 0.0935
π×2

When n = 3 ; h(3) = −
b
sin 0.6π × 3 g = 0.0623
π×3

When n = –1 ; h(–1) = h(1) = –0.3027


Using symmetry
When n = –2 ; h(–2) = h(2) = 0.0935 condition,
h(– n) = h(n)
When n = –3 ; h(–3) = h(3) = 0.0623

The transfer function H(z) of the digital highpass filter is given by,
N−1
+
(N−1) (N−1) 2 +3
− −
H(z) = z 2 Z lh(n)q = z 2
∑N−1h(n) z−n = z−3 ∑ h(n) z−n
n= − n =−3
2

= z −3 h(−3) z3 + h(−2) z2 + h( −1) z + h(0) z0 + h(1)z−1 + h(2) z−2 + h(3) z −3


Using symmetry
=z −3 3 2
h(3) z + h(2) z + h(1) z + h(0) + h(1)z −1
+ h(2) z −2
+ h(3) z −3 condition,
h(– n) = h(n)
= z −3 h(0) + h(1) z + z−1 + h(2) z2 + z−2 + h(3) z3 + z−3

= h(0) z−3 + h(1) z−2 + z−4 + h(2) z −1 + z−5 + h(3) z0 + z−6

= 0.4 z−3 − 0.3027 z−2 + z−4 + 0.0935 z−1 + z −5 + 0.0623 1 + z−6


Structure

Y(z)
Let , H(z) = = 0.4 z −3 − 0.3027 z−2 + z−4 + 0.0935 z−1 + z −5 + 0.0623 1 + z−6
X(z)
Y(z) = 0.4z−3X(z) − 0.3027 z−2 X(z) + z−4X(z) + 0.0935 z−1X(z) + z −5X(z) + 0.0623 X(z) + z−6 X(z)

The above equation can be used to draw the FIR filter structure as shown in fig 1.

−1 −2 −3
z X(z) z X(z) z X(z)

+ + +

−6 −5 −4
z X(z) z X(z) z X(z)

−3
0.0623 X(z) + z −6 X(z) 0.0935 z −1X(z) + z −5 X(z) −0.3027 z −2 X(z) + z −4 X(z)
NM QP 0.4z X(z)

+ + +
F ig 1 : L in e ar p h a se struc ture o f F IR h ig h p a ss filter.
6. 31 Digital Signal Processing
Frequency Response
When impulse response is symmetric and N is odd with centre of symmetry at n = 0, the magnitude
response |H(ejww )| is given by |A(w
w )|,
N−1
2 3
Refer table 6.2 case (v)
where, A(ω ) = h(0) + ∑ 2 h(n) cos ωn = h(0) + ∑ 2 h(n) cos ωn
n =1 n =1

= h(0) + 2 h(1) cos ω + 2 h(2) cos 2ω + 2 h(3) cos 3ω


= 0.4 + 2 × −0.3027cosω + 2 × 0.0935 cos2ω + 2 × 0.0623 cos3ω
= 0.4 − 0.6054 cosω + 0.187 cos2ω + 0.1246 cos3ω
Using the above equation, the amplitude response A(w) and magnitude function |H(ejw )| are calculated for
various values of w and listed in table 1. Using the tabulated values, the magnitude response is sketched as shown
in fig 2.
w ) and |H(ejww )| for various values of w .
Table 1: A(w
w A(w
w) |H(ejww )| = |A(w
w )| w A(w
w) |H(ejww )| = |A(w
w )|
0× π 9× π
16
0.1062 0.1062 16
0.4145 0.4145
1×π 10 × π
16
0.0825 0.0826 16
0.6145 0.6146
2×π 11× π
16
0.0205 0.0205 16
0.7869 0.7869
3×π 12× π
16
–0.0561 0.0560 16
0.9161 0.9161
4× π 13× π
16
–0.1161 0.1161 16
0.9992 0.9991
5×π 14 × π
16
–0.1301 0.1300 16
1.0438 1.0438
6× π 15× π
16
–0.0790 0.0790 16
1.0629 1.0629
7× π 16 × π
16
0.0399 0.0399 16
1.0678 1.0678
8× π
16
0.213 0.213

|H (e jω)|
1.1

1.0

0.9

0.8

0.7

0.6

0.5

0.4

0.3

0.2

0.1

ω
0 π 2π 3π 4π 5π 6π 7π 8π 9π 10 π 11π 12 π 13π 14 π 15π 16π
16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16
( π/2 ) ( π)
F ig 2 : M a gn itu d e resp o n se o f F IR h igh p a ss filte r.
Chapter 6 - FIR Filters 6. 32

Alternate Method for Frequency Response

e j
Frequency response, H e jω = H ( z)
z = e jω

e j
∴ H e jω = 0.4 z −3 − 0.3027 z −2 + z −4 + 0.0935 z −1 + z −5 + 0.0623 1 + z −6
z = e jω

= 0.4e − j3ω − 0.3027 e − j2ω + e − j4ω + 0.0935 e − jω + e − j5ω + 0.0623 1 + e − j 6ω

= 0.4 cos3ω − j sin 3ω − 0.3027 cos2ω − j sin 2ω + cos 4ω − j sin 4ω

+ 0.0935 cos ω − j sin ω + cos5ω − j sin 5ω + 0.0623 1 + cos 6ω − j sin 6ω

= [0.4 cos3ω − 0.3027 cos 2ω − 0.3027 cos 4ω + 0.0935 cos ω + 0.0935 cos5ω + 0.0623 + 0.0623 cos 6ω ]

+ j[ −0.4 sin 3ω + 0.3027 sin 2ω + 0.3027 sin 4ω − 0.0935 sin ω − 0.0935 sin 5ω − 0.0623 sin 6ω ]

Using the above equation, the frequency response H(ejw ) and magnitude function |H(ejw )| of highpass filter are calculated for various values
of w and listed in table 2. It is observed that the magnitude response obtained by both the methods are same.

Table 2 : H(ejww ) and |H(ejww )| for various values of w

w H(ejww ) |H(e jww )| w H(ejww ) |H(e jww )|


0× π 9×π
0.1062 + j0 0.1062 0.2303 + j0.3447 0.4145
16 16
1× π 10 × π
0.0687 – j0.0459 0.0826 0.5678 + j0.2352 0.6146
16 16
2×π 11 × π
0.0078 – j0.0190 0.0205 0.7718 – j0.1535 0.7869
16 16
3× π 12 × π
0.0109 – j0.0550 0.0560 0.6478 – j0.6478 0.9161
16 16
4×π 13 × π
0.0821 + j0.0821 0.1161 0.1949 – j0.9800 0.9991
16 16
5× π 14 × π
0.1276 + j0.0253 0.1300 –0.3994 – j0.9644 1.0438
16 16
6× π 15 × π
0.0730 – j0.0302 0.0790 –0.8838 + j0.5905 1.0629
16 16
7×π 16 × π
–0.0221+ j0.0331 0.0397 –1.0678 + j0 1.0678
16 16
8×π
0+ j0.213 0.213
16

Example 6.3
Design an FIR bandpass filter to pass frequencies in the range 1.5 kHz to 3 kHz and sampling frequency
of 8 kHz with 7 samples using Fourier series method. Determine the frequency response and verify the design by
sketching the magnitude response.

Solution
Given that, Fc1 = 1.5 kHz ; Fc2 = 3 kHz ; Fs = 8 kHz
Ω c1 2πFc1 2π × 1.5 × 103
∴ ω c1 = Ω c1T = = = = 0.375π
Fs Fs 8 × 103
Ω c2 2πFc2 2π × 3 × 103
ω c2 = Ωc2T = = = = 0.75π
Fs Fs 8 × 103

The desired frequency response Hd(ejw ) of bandpass filter is,

e j
Hd e jω = 1 ; for − ω c2 ≤ ω ≤ −ω c1 and ω c1 ≤ ω ≤ ω c2

= 0 ; otherwise
6. 33 Digital Signal Processing
The desired impulse response hd(n) of the bandpass filter is,
π − ω c1 ω c2
hd (n) =
1
2π z
−π
e j
Hd e jω e jωn dω =
1
2π z
− ω c2
1 × e jωn dω +
1
2π z
ω c1
1 × e jωn dω

=
1 LM e OP
jωn − ω c1
+
1 LM e OPjωn ω c 2
=
LM
1 e− jω c1n e− jω c2n
− +
OP
1 ejω c2n e jω c1n

LM OP
2π MN jn PQ −ω c2
2π MN jn PQ ω c1
2π MN
jn jn 2π jn PQ
jn MN PQ
=
1 e LM jω c 2n
−e − jω c 2n

e jω c1n
− e− jω c1n OP sinθ =
e jθ − e− jθ
πn MN 2j 2j PQ 2j
sin ω c2n − sin ω c1n
= ; for all n, except n = 0. When n = 0, the hd(n) become
πn
0/0, which is indeterminate.

When n = 0 ; hd (n) = hd (0) = Lt


LM sin ω c2n − sin ω c1n OP
n→ 0 N πn Q U sin g L' Hospital rule,
=
1 LM Lt sin ω c2n
− Lt
sin ω c1n OP sin Aθ
π N n→ 0 n n→ 0 n Q θ→ 0
Lt
θ
=A
1
=
π
bω c2 − ω c1 g
The impulse response h(n) of FIR filter is obtained by truncating hd(n) to 7 samples.
sin ω c2n − sin ω c1n
∴ h(n) = hd (n) = ; for n = − N2−1 to + N−1
2
, except n = 0
πn
ω c2 − ω c1
= ; for n = 0
π
N−1 7 −1
Here, N = 7, ∴ = =3
2 2
Hence, calculate h(n) for n= –3 to 3.
Since, the impulse response h(n) satisfies the symmetry condition, h(–n) = h(n), calculate h(n) for n = 0 to 3.
ω c2 − ω c1 0.75π − 0.375π 0.375π
When n = 0 ; h(0) = = = = 0.375
π π π
sin (0.75π × 1) − sin (0.375π × 1)
When n = 1 ; h(1) = = −0.069
π ×1
sin(0.75π × 2) − sin(0.375π × 2)
When n = 2 ; h(2) = = −0.2716
π ×2
sin(0.75π × 3) − sin(0.375π × 3)
When n = 3 ; h(3) = = 0.1156
π ×3
When n = –1 ; h(–1) = h(1) = –0.069
When n = –2 ; h(–2) = h(2) = –0.2716
When n = –3 ; h(–3) = h(3) = 0.1156
The transfer function H(z) of the digital FIR bandpass filter is given by,
N− 1
+
(N−1) (N−1) 2 +3
− −
H(z) = z 2 Z lh(n)q = z 2
∑N−1h(n) z−n = z −3 ∑ h(n) z−n
n= − n = −3
2
−3
=z h( −3) z + h( −2) z + h( −1) z + h(0) z0 + h(1)z−1 + h(2) z −2 + h(3) z −3
3 2
Chapter 6 - FIR Filters 6. 34

∴ H(z) = z−3 h(3) z3 + h(2) z2 + h(1) z + h(0) + h(1)z−1 + h(2) z −2 + h(3) z −3 Using symmetry
condition,
= z−3 h(0) + h(1) z + z−1 + h(2) z2 + z−2 + h(3) z3 + z−3 h(– n) = h(n)

= h(0) z−3 + h(1) z−2 + z−4 + h(2) z−1 + z−5 + h(3) z0 + z−6

= 0.375 z−3 − 0.069 z −2 + z−4 − 0.2716 z−1 + z−5 + 0.1156 1 + z −6


Structure
Y(z)
Let , H(z) = = 0.375 z −3 − 0.069 z−2 + z−4 − 0.2716 z−1 + z−5 + 0.1156 1 + z −6
X(z)
Y(z) = 0.375z −3X(z) − 0.069 z −2 X(z) + z−4X(z) − 0.2716 z−1X(z) + z−5X(z)

+ 0.1156 X(z) + z−6 X(z)

The above equation can be used to draw the FIR filter structure as shown in fig 1.
−1 −2 −3
z X(z) z X(z) z X(z)

+ + +

−6 −5 −1
−4
z X(z) z X(z) z X(z)

−6 −1 −5 −2 −4 −3
0.1156[X(z) + z X(z)] −0.2716[z X(z) + z X(z)] −0.069[z X(z) + z X(z)] 0.375z X(z)

+ + +
F ig 1: L in ea r ph a se stru c tu re o f F IR b an d p a ss filter.

Frequency Response
When impulse response is symmetric and N is odd with centre of symmetry at n = 0, the magnitude
response |H(ejww )| is given by |A(w
w )|,
N−1
2
where, A(ω ) = h(0) + ∑ 2 h(n) cos ωn Refer table 6.2 case (v)
n = 1

3
= h(0) + ∑ 2 h(n) cos ωn
n =1

= h(0) + 2 h(1) cos ω + 2 h(2) cos 2ω + 2 h(3) cos 3ω


= 0.375 + 2 × −0.069cosω + 2 × −0.2716 cos2ω + 2 × 0.1156 cos3ω
= 0.375 − 0.138 cosω − 0.5432 cos2ω + 0.2312 cos3ω
Using the above equation, the amplitude response A(w) and magnitude function |H(ejw )| are calculated for
various values of w and listed in table 1. Using the tabulated values, the magnitude response is sketched as shown
in fig 2.
6. 35 Digital Signal Processing
w ) and |H(ejww )| for various values of w .
Table 1 : A(w
w H(ejww ) |H(ejww )| = |A(w
w )| w H(ejww ) |H(ejww )| = |A(w
w )|
0× π 9× π
16
–0.075 0.075 16
1.0322 1.0321
1×π 10 × π
16
–0.0699 0.0699 16
1.0255 1.0254
2×π 11×π
16
–0.0481 0.0481 16
0.8862 0.8862
3×π 12× π
16
0.0081 0.0081 16
0.6360 0.6359
4× π 13× π
16
0.1139 0.1138 16
0.3269 0.3269
5×π 14 × π
16
0.2794 0.2793 16
0.0299 0.0298
6× π 15× π
16
0.4926 0.4925 16
–0.1837 0.1836
7× π 16 × π
16
0.7215 0.7215 16
–0.2614 0.2614
8× π
16
0.9182 0.9182

|H (e jω)|
2.0

1.8

1.6

1.4

1.2

1.0

0.8

0.6

0.4

0.2

ω
0
π 2π 3π 4π 5π 6π 7π 8π 9π 10 π 11π 12 π 13 π 14 π 15 π 16 π
16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16
( π/2 ) ( π)
F ig 2 : M a g n itu de resp on se o f F IR b a n d p ass filter.
Alternate Method for Frequency Response

e j
Frequency response, H e jω = H ( z)
z = e jω

e j
∴ H e jω = 0.375z −3 − 0.069 z −2 + z −4 − 0.2716 z −1 + z −5 + 01156
. 1 + z −6
z = e jω

= 0.375e − j3ω − 0.069 e − j2 ω + e − j4ω − 0.2716 e − jω + e − j5ω + 01156


. 1 + e − j 6ω

= 0.375 cos3ω − j sin 3ω − 0.069 cos2ω − j sin 2ω + cos 4ω − j sin 4ω

− 0.2716 cos ω − j sin ω + cos5ω − j sin 5ω + 0.1156 1 + cos 6ω − j sin 6ω

= [0.375cos3ω − 0.069 cos 2ω − 0.069 cos 4ω − 0.2716 cos ω − 0.2716 cos5ω + 0.1156 + 01156
. cos 6ω ]

+ j[ −0.375 sin 3ω + 0.069 sin 2ω + 0.069 sin 4ω + 0.2716 sin ω + 0.2716sin 5ω − 01156
. sin 6ω ]
Chapter 6 - FIR Filters 6. 36
Using the above equation, the frequency response H(ejw ) and magnitude function |H(ejw )| of bandpass filter are calculated for various values
of w and listed in table 2. It is observed that the magnitude response obtained by both the methods are same.

Table 2 : H(ejww ) and |H(ejww ) for various values of w

w H(ejww ) |H(e jww )| w H(ejww ) |H(e jww )|


0× π 9×π
–0.075 + j0 0.075 0.5734 + j0.8582 1.0321
16 16
1× π 10 × π
–0.0581 + j0.0389 0.0699 0.9474 + j0.3924 1.0254
16 16
2×π 11 × π
–0.0184 + j0.0445 0.0481 0.8692 – j0.1729 0.8862
16 16
3× π 12 × π
–0.0041 – j0.0071 0.0081 0.4497 – j0.4497 0.6359
16 16
4×π 13 × π
–0.0806 – j0.0805 0.1138 0.0637 – j0.3207 0.3269
16 16
5× π 14 × π
–0.2740 – j0.0545 0.2793 –0.0114 – j0.0276 0.0298
16 16
6× π 15 × π
–0.4551 + j0.1885 0.4925 0.1527 + j0.1020 0.1836
16 16
7×π 16 × π
–0.4008 + j0.5999 0.7215 0.2614 + j0 0.2614
16 16
8×π
0 + j0.9182 0.9182
16

Example 6.4
Design a FIR bandstop filter to reject frequencies in the range 1.5 kHz to 3 kHz and sampling frequency
of 8kHz with 7 samples using Fourier series method. Determine the frequency response and verify the design by
sketching the magnitude response.

Solution
Given that, Fc1 = 1.5 kHz ; Fc2 = 3 kHz ; Fs = 8 kHz

. × 103
Ω c1 2 πFc1 2π × 15
∴ ω c1 = Ω c1T = = = = 0. 375 π
Fs Fs 8 × 103
Ω c2 2πFc2 2π × 3 × 103
ω c2 = Ω c2T = = = = 0.75 π
Fs Fs 8 × 103
The desired frequency response Hd(ejw ) of bandstop filter is,

Hd (ejω ) = 1 ; − π ≤ ω ≤ −ω c2 & − ω c1 ≤ ω ≤ ω c1 & + ω c2 ≤ ω ≤ π


= 0 ; otherwise
The desired impulse response hd(n) of the bandstop filter is,
π
hd (n) =
1
2π z
−π
e j
Hd e jω e jωn dω

−ω c2 ω c1 π
=
1
2π z −π
1 × e jωn dω +
1
z
2π − ω
1 × e jωn dω +
c1
1
2π z
+ω c2
1 × ejωn dω

=
1 e LM jωnOP
−ω c2

+
1 e LM jωnOP
ω c1

+
LM
1 e jωn OP π

2π jn MN PQ −π
2π jn MN PQ − ω c1 MN
2π jn PQ ω c2
6. 37 Digital Signal Processing

∴ hd (n) =
LM
1 e − jω c2n e− jπn
− +
OP
1 ejω c1n e − jω c1n
− +
LM
1 e jπn ejω c2n

OP LM OP
MN
2π jn jn 2π jn PQ
jn 2π jn MN jn PQ MN PQ
=
1 Le
M
jπn
− e− jπn ejω c1n − e− jω c1n e jω c2n − e− jω c2n
+ −
OP e jθ − e− jθ
sinθ =
πn N 2j 2j 2j Q 2j
sin πn + sin ω c1n − sin ω c2n
= ; for all n, except n = 0
πn When n = 0, the

When n = 0 ; hd (n) = hd (0) = Lt


LM sin πn + sin ω n − sin ω n OP
c1 c2 hd(n) become 0/0,
n→0 N πn πn πn Q which is indeterminate.
1 sin πn 1 sin ω c1n 1 sin ω c2n
= Lt + Lt − Lt
π n → 0 n π n → 0 n π n → 0 n
U sin g L' Hospital rule,
1 1 1
= × π + × ω c1 − × ω c2 sin Aθ
π π π Lt =A
θ→ 0 θ
= 1−
FG ω c2 − ω c1 IJ
H π K
The impulse response h(n) of FIR filter is obtained by truncating hd(n) to 7 samples.

sin ω c1n − sin ω c2n N−1 N−1


∴ h(n) = hd (n) = ; for n = − 2 to +
2
, except n = 0
πn

= 1−
FG ω c2 − ω c1 IJ ; for n = 0
H π K
N−1 7 −1
Here, N = 7, ∴ = =3
2 2

Hence, calculate h(n) for n = –3 to +3.

Since, the impulse response h(n) satisfies the symmetry condition, h(n) = h(–n), calculate h(n) for n = 0 to 3.

When n = 0 ; h(0) = 1 −
FG ω c2 − ω c1
= 1−
IJ
0.75π − 0.375π FG
= 0.625
IJ
H π K π H K
sin (0.375π × 1) − sin(0.75π × 1)
When n = 1 ; h(1) = = 0.069
π ×1
sin (0.375π × 2) − sin(0.75π × 2)
When n = 2 ; h(2) = = 0.2716
π ×2
sin (0.375π × 3) − sin(0.75π × 3)
When n = 3 ; h(3) = = −0.1156
π×3
When n = −1 ; h(−1) = h(1) = 0.069
When n = −2 ; h(−2) = h(2) = 0.2716
When n = −3 ; h(−3) = h(3) = −0.1156

The transfer function H(z) of the digital bandstop filter is given by,
N−1
N−1 N−1
+ 3
2
− −
H(z) = z 2 l q
Z h(n) = z 2
∑ h(n) z−n = z−3 + ∑ h(n) z−n
N−1
n = − n = −3
2

= z−3 h( −3) z3 + h(−2) z2 + h(−1) z + h(0) z0 + h(1) z−1 + h(2) z−2 + h(3)z−3
Chapter 6 - FIR Filters 6. 38

∴ H(z) = z−3 h(3) z3 + h(2) z2 + h(1) z + h(0) + h(1) z−1 + h(2) z−2 + h(3)z−3 Using symmetry
condition,
= z−3 h(0) + h(1) z + z−1 + h(2) z2 + z−2 + h(3) z3 + z−3 h(– n) = h(n)

= h(0) z −3 + h(1) z−2 + z−4 + h(2) z−1 + z −5 + h(3) z0 + z−6

= 0.625z−3 + 0.069 z−2 + z−4 + 0.2716 z−1 + z−5 − 0.1156 1 + z−6

Structure

Y(z)
Let , H(z) = = 0.625 z −3 + 0.069 z−2 + z−4 + 0.2716 z−1 + z−5 − 0.1156 1 + z −6
X(z)

∴ Y(z) = 0.625z−3 X(z) + 0.069 z−2 X(z) + z−4 X(z) + 0.2716 z −1 X(z) + z−5 X(z)

− 0.1156 X(z) + z−6 X(z)


The above equation can be used to draw the FIR filter structure as shown in fig 1.

−1
z X(z) z −3X(z)
z
−1
z−1 z−1

+ + +

−1
−6
z −1 z −1 z
z X(z)

−3
−0.1156[X(z) + z−6X(z)]
−1 −5
0.2716[z X(z) + z X(z)] 0.069[z −2X(z) + z −4X(z)] 0.625z X(z)

+ + +
F ig 1 : L in ea r ph a se stru c ture of F IR ba n d sto p filte r.

Frequency Response
When impulse response is symmetric and N is odd with centre of symmetry at n = 0, the magnitude
function |H(ejww )| is given by |A(w
w )|,
N−1
2
where, A(ω ) = h(0) + ∑ 2 h(n) cos ωn Refer table 6.2 case (v)
n =1

3
A(ω ) = h(0) + ∑ 2 h(n) cos ωn
n =1

= h(0) + 2 h(1) cos ω + 2 h(2) cos 2ω + 2 h(3) cos 3ω


= 0.625 + 2 × 0.069cosω + 2 × 0.2716 cos2ω + 2 × −0.1156 cos3ω
= 0.625 + 0.138 cosω + 0.5432 cos2ω − 0.2312 cos3ω
Using the above equation, the amplitude response A(w) and magnitude function |H(ejw )| are calculated for
various values of w and listed in table 1. Using the tabulated values, the magnitude response is sketched as
shown in fig 2.
6. 39 Digital Signal Processing
w ) and |H(ejww )| for various values of w .
Table 1 : A(w

w H(ejww ) |H(ejww )| = |Aw


w| w H(ejww ) |H(ejww )| = |Aw
w|
0× π 9× π
16
1.075 1.075 16
–0.0322 0.0321
1×π 10 × π
16
1.0699 0.0699 16
–0.0255 0.0255
2×π 11× π
16
1.0481 0.0481 16
0.1137 0.1136
3×π 12× π
16
0.9927 0.9926 16
0.3639 0.3638
4× π 13× π
16
0.8860 0.8841 16
0.6730 0.6729
5×π 14 × π
16
0.7205 0.7205 16
0.9700 0.9700
6× π 15× π
16
0.5073 0.5073 16
1.1837 1.1836
7× π 16 × π
16
0.2785 0.2784 16
1.2614 1.2614
8× π
16
0.0818 0.0818

|H (e jω)|
1.3

1.2

1.1

1.0

0.9

0.8

0.7

0.6

0.5

0.4

0.3

0.2

0.1

ω
0 π 2π 3π 4π 5π 6π 7π 8π 9π 10 π 11π 12 π 13 π 14 π 15 π 16 π
16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16
( π/2 ) ( π)
F ig 2 : M a gn itu d e resp o n se o f F IR b a n d sto p filter.

Alternate Method for Frequency Response

e j
Frequency response, H e jω = H ( z)
z = e jω

e j
∴ H e jω = 0.625z −3 + 0.069 z −2 + z −4 + 0.2716 z −1 + z −5 − 01156
. 1 + z −6
z = e jω

= 0.625e − j3ω + 0.069 e − j2ω + e − j4ω + 0.2716 e − jω + e − j5ω − 01156


. 1 + e − j 6ω
Chapter 6 - FIR Filters 6. 40

e j
∴ H e jω = 0.625 cos3ω − j sin 3ω + 0.069 cos 2ω − j sin 2ω + cos 4ω − j sin 4ω

+ 0.2716 cos ω − j sin ω + cos5ω − j sin 5ω − 0.1156 1 + cos 6ω − j sin 6ω

= [0.625cos 3ω + 0.069 cos 2ω + 0.069 cos 4ω + 0.2716 cos ω + 0.2716 cos5ω − 01156
. − 01156
. cos 6ω ]

+ j[ −0.625 sin 3ω − 0.069 sin 2ω − 0.069 sin 4ω − 0.2716 sin ω − 0.2716 sin 5ω + 0.1156 sin 6ω]

Using the above equation, the frequency response H(ejw ) and magnitude function |H(ejw )| of bandstop filter are calculated for various values
of w and listed in table 2. It is observed that the magnitude response obtained by both the methods are same.

Table 2: H(ejww ) and |H(ejww )| for variouse values of w

w H(ejww ) |H(e jww )| w H(ejww ) |H(e jww )|


0× π 9×π
1.075 + j0 1.075 –0.0179 – j0.0267 0.0321
16 16
1× π 10 × π
0.8896 – j0.5944 1.0699 –0.0235 – j0.0097 0.0255
16 16
2×π 11 × π
0.4010 – j0.9683 1.0480 0.1115 – j0.0221 0.1136
16 16
3× π 12 × π
–0.1936 – j0.9736 0.9926 0.2573 – j0.2573 0.3638
16 16
4×π 13 × π
–0.6265 – j0.6254 0.8841 0.1313 – j0.6600 0.6729
16 16
5× π 14 × π
–0.7067 – j0.1405 0.7205 –0.3712 – j0.8962 0.9700
16 16
6× π 15 × π
–0.4687 + j0.1941 0.5073 –0.9842 – j0.6576 1.1836
16 16
7×π 16 × π
–0.1547 + j0.2315 0.2784 –1.2614 – j0 1.2614
16 16
8×π
0 + j0.0818 0.0818
16

6.8 Windows
The windows are finite duration sequences used to modify the impulse response of the FIR filters in
order to reduce the ripples in the passband and stopband, and also to achieve the desired transition from
passband to stopband.
The FIR filter design starts with desired frequency response, Hd(ejw ). The desired impulse response,
hd(n) is obtained by taking inverse Fourier transform of Hd(ejw ). The desired impulse response will be an
infinite duration sequence. On multiplying finite duration window sequence with infinite duration impulse
response, we get a finite duration impulse response with modified samples, which is used to design FIR filter.
The different types of window sequences discussed in this book are,
1. Rectangular window, wR(n)
2. Bartlett or Triangular window, wT(n)
3. Hanning window, wC(n)
4. Hamming window, wH(n)
5. Blackman window, wB(n)
6. Kaiser window, wK(n)
6. 41 Digital Signal Processing

6.8.1 Rectangular Window


The N-point rectangular window, wR(n) is defined as,
−1 N−1
Rectangular window, w R (n) = 1 ; n = − N2 to + 2
=0 ; other n .....(6.56)

Alternatively,
Rectangular window, w R (n) = 1 ; n = 0 to N − 1
.....(6.57)
=0 ; other n
The rectangular window sequence defined by equation (6.56) can be used only for odd values of N, but
the window sequence defined by equation (6.57) can be used for both odd and even values of N.
The frequency response or frequency spectrum of rectangular window WR(ejw ) is obtained by taking
Fourier transform of rectangular window sequence wR(n).
ωN

sin 2
∴ WR (e ) = F {w R (n)} = ω
.....(6.58)
sin 2

Proof :
N−1
2 N −1 FG
− jω n −
N−1 IJ
H K
WR (e jω ) = F { w R (n)} = ∑ e− jωn = ∑e 2

n= −
N−1 n=0 Using finite
2
geometric series
N−1 jω
FG N − 1IJ jω
FG N − 1IJ N−1 sum formula,
H 2 K H 2 K
= ∑ e− jωn e = e ∑e − jωn
N −1
1 − CN
n= 0 n=0 ∑C
n=0
n
=
1− C
− jωN jωN − jωN − jωN

FG N − 1IJ − jωN jω
FG N − 1IJ
H 2 K 1 − e H 2 K e 2 e 2 − e 2 e 2
= e = e
1 − e− jω − jω jω − jω − jω
e 2 e2 − e 2 e 2

− jωN Fe jωN − jωN I


jωN − jω
e 2
GH 2 −e 2
JK
= e 2 e 2 − jω Fe jω − jω I e jθ e− jθ = 1
e 2
GH 2 − e 2
JK
jωN − jωN
ωN
e 2 – e 2 sin 2 e jθ − e− jθ
= jω − jω
= ω
sinθ =
sin 2j
e2 – e 2 2

The magnitude and log-magnitude response of rectangular window for N = 31 are shown in fig 6.22(c)
and (d). The spectrum of WR(ejw ) has two features that are important, they are the width of the main-lobe and
side-lobe amplitude. The main-lobe width is defined as the distance between the two points closest to w = 0
where |WR(ejw )| in dB is zero. For the rectangular window the main-lobe width is equal to 4p/N. The maximum
side-lobe magnitude for WR(ejw ) occurs for the first side-lobe and is equal to approximately -13 dB.
The magnitude response |H(ejw )| and log-magnitude response of the lowpass filter designed using
rectangular window are shown in fig 6.22(e) and (f). The approximated filter response differs from the ideal
desired response in several ways. The sharp transition in the ideal response at w = w c has been converted into
a gradual transition. In the passband a series of overshoots and undershoots occur. In the stopband the ideal
desired response is zero, but the FIR filter has a nonzero response called leakage. These features can be
explained in terms of the features of the window spectrum.
Chapter 6 - FIR Filters 6. 42

N = 31
N = 31 N = 31
w

N

F ig a : R ecta ng u lar w in d ow seq uen ce. F ig b : A m plitud e respo nse F ig c: M ag nitud e respo nse o f
o f recta ng u lar w ind ow. recta ng u lar w ind ow.

N = 31 N = 31
−13 dB N = 31 ωc =0.5 π rad/sam ple ωc =0.5 π rad/sam ple


|H d (e )|

F ig d : L og -m a g nitu d e resp o nse F ig e: M ag nitud e respo nse o f F IR low pa ss F ig f: L og -m a g nitu d e resp o nse of F IR low pa ss
o f recta ng u lar w ind ow. filter d esig ned u sin g rectang ula r w in do w. filter d esig ned u sin g rectang ula r w in do w.

F ig 6.2 2 : R ec ta n g u la r w in d ow seq ue n ce a n d its fre q uen cy respo n se (w h en N = 3 1 ).

The main-lobe of WR(ejw ) causes the smearing of the desired transfer function features. The discontinuity in
Hd(e ) is converted into a gradual transition in H(ejw ). The width of the transition region is related to the width
jw

of the main-lobe of WR(ejw ). Since the main-lobe width of WR(ejw ) is equal to 4p/N, the size of this transition
region can be reduced to any desired size by increasing the size (N), of the window sequence. The increase in N
also increases the number of computations necessary to implement the FIR filter.
Since the side-lobes of WR(ejw ) extend over a wide frequency range, large magnitude components in
Hd(e ) becomes smeared over a wide range of frequencies in H(ejw ). In the passband this side-lobe effects appear
jw

both as overshoots and undershoots to the desired response. In the stopband, these effects appear as a
nonzero response. These side-lobe effects do not diminish significantly, but remain almost constant as the
duration of rectangular window is increased.
It is observed that whatever be the number of elements of hd(n) included in the h(n), the magnitudes of the
overshoot and leakage will not change significantly, when the rectangular window is used. This result is known as
the Gibbs phenomenon, after the American Mathematician Josiak Willard Gibbs of Yale, who first noted this effect.
To reduce these side-lobe effects, we must consider alternate window sequences having spectrum exhibiting
smaller side-lobes. We can observe that the side-lobes of the window spectrum W(ejw ) represent the contribution
of the high frequency components in the window sequence. For the rectangular window, these high frequency
components are due to the sharp transitions from 0 to 1 at the edges of window sequence. Hence the amplitudes
of these high frequency components, (i.e., the side-lobe level) can be reduced by replacing these sharp transitions
by more gradual ones. This is the motivation for development of the triangular window, cosine window, etc.
6. 43 Digital Signal Processing

6.8.2 Bartlett or Triangular Window


The triangular window have been chosen such that it has tapered sequences form the middle on either
sides. The N-point triangular window, wT(n) is defined as,

2 |n| N−1 N−1


Triangular window , w T ( n) = 1 − N−1
; for −
2
≤ n ≤ 2
.....(6.59)
=0 ; other n

Alternatively,
N−1
2 n−
2
Triangular window , w T ( n) = 1− N−1
; for n = 0 to N − 1
.....(6.60)
=0 ; other n
The triangular window sequence defined by equation (6.59) can be used only for odd values of N, but
the window sequence defined by equation (6.60) can be used for both odd and even values of N.
The frequency response or frequency spectrum of triangular window WT(ejw ) is obtained by taking
Fourier transform of triangular window sequence wT(n).

F sin eωe jj I
N−1
2

) = F lw ( n)q = G
GG sin JJJ
4 .....(6.61)
∴ WT ( e jω T ω
H K
2

N = 31 N = 31
N = 31


N

F ig a : B a rtlett w in do w F ig b : A m plitud e respo nse F ig c: M ag nitud e respo nse o f


seq uen ce. o f B artlett w in do w. B artlett w ind o w.

N = 31 N = 31 N = 31
ωc =0.5 π rad/sam ple ωc =0.5 π rad/sam ple

−25 dB jω
|H d (e )|

F ig d : L og -m a g nitu d e resp o nse F ig e: M ag nitud e respo nse o f F IR low pa ss F ig f: L og -m a g nitu d e resp o nse of F IR low pa ss
o f B artlett w in do w. filter d esig ned u sin g B artlett w ind ow. filter d esig ned u sin g B artlett w ind ow.

F ig 6.2 3 : B a rtlett w ind o w seq u en c e an d its freq u en c y resp o nse (w h e n N = 31 ).


Chapter 6 - FIR Filters 6. 44

The magnitude and log-magnitude response of triangular window for N = 31 are shown in fig 6.23(c) and
(d). In log-magnitude response of triangular window the first side-lobe level is smaller than that of the rectangular
window, being reduced from –13 to – 25 dB. But the mainlobe width is 8p/N or twice that of the rectangular
window having the same duration. This result illustrates that there is a trade off between main-lobe width and
sidelobe level.

The magnitude response |H(ejw )| and log-magnitude response of the lowpass filter designed using
triangular window are shown in fig 6.23(e) and (f). The triangular window produces a smoother magnitude response
for FIR filter. The transition from passband to stopband is not as steep as that for FIR filters designed using the
rectangular window. In the stopband, the response is smoother, but the attenuation is less than that produced by
the rectangular window. Because of these characteristics the triangular window is not usually a good choice.

6.8.3 Raised Cosine Windows


The raised cosine windows are smoother at the ends, but closer to one at the middle. The smoother ends
and the broader middle section produces less distortion of hd(n) around n = 0. It is also called generalized
Hamming window.
The N-point raised cosine window wRC(n) is defined as,

w RC ( n) = a + (1 − a) cos e j ; for n = −
2 πn
N−1
N−1
2
to +
N−1
2
.....(6.62)
= 0 ; other n

Alternatively,
w RC ( n) = a − (1 − a) cos e j ; for n = 0 to N − 1
2 πn
N−1 .....(6.63)
= 0 ; other n
The raised cosine window sequence defined by equation (6.62) can be used only for odd values of N, but
the window sequence defined by equation (6.63) can be used for both odd and even values of N.
The frequency response or frequency spectrum of raised cosine window WRC(ejw ) is obtained by taking
Fourier tansform of raised cosine window sequence wRC(n).


l
∴ WRC ( e ) = F w RC ( n) = a q sin
ωN
2
+
1 − a sin e ωN
2

πN
N −1 j
ω
sin 2
2 sin e ω

π
2 N −1 j
sin e j
ωN πN
+
1− a 2 N −1
+ .....(6.64)
sin e j
2 ω π
+
2 N −1

Proof :
+∞
m
WH (e jω ) = F w RC( n) = r ∑ wRC(n) e– jωn
n = –∞
N–1
2
IJ O e– jωn UUsing equation (6.62)U
= ∑ LNMa + (1 – a)cosFGH 2πn
N–1 K QP
N–1
n= –
2
L
N–1 F FG N–1 IJ I O FG N–1 IJ
= ∑ MMa + (1 – a) cosG K P
2π n – – jω n –
H 2 JJ P e H 2 K
NM
n=0 GH N–1
K PQ
6. 45 Digital Signal Processing

N–1 FG N – 1IJ
∑ LMNa + (1 – a) cose – π jO e

∴ WH (e jω ) =
2 πn – jωn H 2 K
n=0
PQ N–1
e
cos(θ – π) = – cosθ
FG IJN–1 N–1

∑ LMNa – (1 – a) cose jOPQ e



= e H K2 2πn – jωn
N–1
n=0


FG N – 1IJ N–1 jω
FG N – 1IJ N–1
e jθ + e− jθ
H 2 K – jωn H 2 K e je
2 πn – jωn cosθ =
= ae ∑e – (1– a) e ∑ cos
N–1 2
n=0 n=0
F N – 1IJ
jω G
H 2 K
N–1 F N – 1IJ
jω G
H 2 K
N–1 LM j2πn − j2πn
OP
= ae ∑ e– jωn – (1– a) e ∑ MN e N–1 + eN – 1 PQ e
– jωn

n=0 n=0
2
F N – 1IJ
jω G N–1
H 2 K
= ae ∑ e– jωn
n=0
F N – 1IJ LM j2 πn − j2 πn OP
1– a jω GH
N–1 N–1
2 K
e N – 1 e– jωn + e N – 1 e– jωn
–
2
e
MN ∑
n=0

n=0 PQ
F N – 1IJ
jω G N–1
H 2 K
= ae ∑ (e– jω )n
n=0

F N – 1IJ LM F FG 2π IJ I n F FG 2π IJ I n O
1– a jω GH K J PP
N–1 −j ω – N–1 −j ω +
–
2
e 2 K
MM ∑ GG e H N–1 KJ +
JK ∑ GG e H N–1
JK P
n=0
N H n=0 H Q

FG N – 1IJ
H 2 K 1 – e– jωN
= ae
1 – e – jω
Using finite

FG N – 1IJ LM FGH –j ω –
IJ

K N
FG 2π IJ N O
H N – 1K P
–j ω + geometric series
1– a H 2 K N–1
–
2
e MM1 – e FG –j ω –
2π I
J
+
1 – e
F 2π IJ PP
– jG ω +
sum formula,
N −1
N1– e H N – 1K 1– e H N – 1K Q ∑C n
=
1 − CN
n=0 1− C
– jωN F jωN – jωN I
e 2 GG e 2 – e 2 JJ

FG N −1IJ GH JK
= ae H 2K e jθ e− jθ = 1
– jω F jω – jω I
e 2 GG e 2 – e 2 JJ
GH JK
FG
–j ω –
2π N IJ F FGH j ω–
2π N IJ FG
–j ω –
2π NIJ I
F N − 1IJ e H N–1 2 K GG e N–1 2 K – e H N–1 2 K JJ
–
1 – a jω GH
e 2 K H K
2 FG
–j ω –
H
2π 1 IJ
K
F FGH j ω–
2π 1 IJ
K
FG
–j ω –
H
2π 1IJ I
K J
e N–1 2 GG e N–1 2
– e N–1 2
JK
H
FG
–j ω +
2π N IJ F FGH j ω+
2π N IJ –j ω +
FG 2π N IJ I
F N − 1IJ e
H N–1 2 K GG e N–1 2 K – e H N–1 2 K J
JK
–
1 – a jω GH
e 2 K H
2 FG
–j ω +
2π 1 IJ F FGHj ω+
2π 1 IJ FG
–j ω +
2π 1 IJ I
e H N–1 2 K GG e N–1 2 K – e H N–1 2 K J
JK
H
Chapter 6 - FIR Filters 6. 46

LM jω FG N − 1IJ − jωN
+
jω OP sinωN
a eN
H 2 K Q e jθ − e− jθ
∴ WH e e j= jω 2 2 2
sin ω
sin θ =
2j
2

L F N − 1IJ − jFG ω – 2π IJ N + jFG ω – IJ OP


2π 1
sin ee 2π N
j j
1– a MN jω GH 2 K H N – 1K 2 H K Q
N–1 2
ω–
N–1 2
– e
2 sinee jj
2π 1
ω–
N–1 2

1– a MN jω GH
L F N − 1IJ − jFG ω + 2π IJ N + jFG ω + 2π IJ 1 OP sinFH e ω+
2π N
j IK
2 K H N – 1K 2 H N – 1K 2 Q N–1 2
– e
2 sinFH e j IK
2π 1
ω+
N–1 2

LM jωN – jω
–
jωN
+
jω OP sin ωN
= a eN 2 2 2 2 Q 2
ω
sin
2
L jωN – jω jωN jπN jω jπ OP e
sin ωN πN
j
1– a MN 2 2
–
2
+
N−1
+
2

N−1 Q 2

N−1
– e
2 sine ω

π
j
2 N−1

L jωN – jω jωN jπN jω jπ OP sine ωN πN


j
1– a MN 2 2
–
2

N−1
+
2
+
N−1 Q 2
+
N−1
– e
2 sine ω
+
π
j
2 N−1

= a
sin ωN
2
–
jπ ωN
1– a N – 1(N – 1) sin 2 −
e
e πN
N−1 j
ω
sin
2
2 sin ω − e 2
π
N−1 j e ± jπ = − 1

– e
– jπ ωN
1– a N – 1(N – 1) sin 2 + e πN
N−1
j
2 sin ω + e 2
π
N−1
j
= a
sin ωN
2
+
ωN
1 − a sin 2 − e πN
N−1
j +
ωN
1– a sin 2 + e πN
N−1
j
ω
sin
2
2 sin ω − e 2
π
N−1
j 2 sin ω + e 2
π
N−1
j
6.8.4 Hanning Window
The Hanning window is one type of raised cosine window. The equation for Hanning window sequence
wC(n) is obtained by putting a = 0.5 in equations (6.62) and (6.63).
2 πn N−1 N−1
Hanning window, w C ( n) = 0.5 + 0.5 cos N − 1 ; for − 2
to + 2
=0 ; other n .....(6.65)

Alternatively,
2 n π
Hanning window , w C ( n) = 0.5 − 0.5 cos N − 1 ; for n = 0 to N − 1
.....(6.66)
=0 ; other n

The Hanning window sequence defined by equation (6.65) can be used only for odd values of N, but the
window sequence defined by equation (6.66) can be used for both odd and even values of N.
The frequency response or frequency spectrum of Hanning window WC(ejw ) is obtained by taking
Fourier transform of Hanning window sequence wC(n), which can also be obtained from equation (6.64) by
putting a = 0.5.
6. 47 Digital Signal Processing


l
∴ WC ( e ) = F w C ( n) = 0.5 q sin
ωN
2
+ 0.25
e sin
ωN
2

πN
N −1 j
ω
sin e j
ω π
sin 2

2 N −1

sin e j
ωN πN
+
2 N −1
+ 0.25
sin e .....(6.67)
ω
+
π
2 N −1 j
N = 31 N = 31
N = 31


N

F ig a : H a n nin g w in do w seq uen ce. F ig b : A m plitud e respo nse o f H a nn ing w in do w. F ig c: M ag nitud e respo nse o f
H a nn in g w in do w.

N = 31
N = 31 N = 31 ωc =0.5 π rad/sam ple
ωc =0.5 π rad/sam ple
−31 dB

|H d (e jω)|

F ig d : L og -m ag nitud e respo nse F ig e: M ag nitud e respo nse o f F IR low pa ss F ig f: L og -m ag nitud e respo nse o f F IR low pa ss
o f H a nn in g w in do w,. filter d esig ned usin g H an n ing w ind ow. filter d esig ned usin g H an n ing w ind ow.

F ig 6 .2 4 : H an n in g w in d o w seq ue n ce a n d its fre q uen cy resp on se (w h en N = 31 ).

The magnitude and log-magnitude response of Hanning window for N =31 are shown in fig 6.24(c) and (d).
In the log-magnitude response of WC(ejw ) the magnitude of the first side-lobe is –31 dB. An improvement of 6 dB
over the triangular window. When compared to triangular window, the main-lobe width is same but the magnitude
of side-lobe is reduced, hence the Hanning window is preferrable to triangular window.
The magnitude response |H(ejw )| and log-magnitude response of the lowpass filter designed by using
Hanning window are shown in fig 6.24(e) and (f). Most notable is the improved stopband attenuation characteristic.
The largest peak is approximately 44 dB relative to the passband level. At higher frequencies the stopband
attenuation is even greater.

6.8.5 Hamming Window

Hamming noted that a reduction in the first side-lobe level can be achieved by adding a small constant
value to the raised cosine window. The equation for Hamming window sequence wH(n) is obtained by putting
a = 0.54 in equations (6.62) and (6.63).
Chapter 6 - FIR Filters 6. 48

π −1 N−1
∴ Hamming window, w H ( n) = 0.54 + 0.46 cos N2 −n1 ; for n = − N 2 to +
2
=0 ; other n .....(6.68)

Alternatively,
2 πn
Hamming window, w H ( n) = 0.54 − 0.46 cos N − 1 ; for n = 0 to N − 1
.....(6.69)
=0 ; other n

The Hamming window sequence defined by equation (6.68) can be used only for odd values of N, but the
window sequence defined by equation (6.69) can be used for both odd and even values of N.

The frequency response or frequency spectrum of Hamming window WH(ejw ) is obtained by taking Fourier
transform of Hamming window sequence wH(n), which can also be obtained from equation (6.64) by putting a = 0.54.


∴ WH (e ) = F w H ( n) = 0.54l q sin
ωN
2
+ 0.23
e sin
ωN
2

πN
N −1 j
ω
sin e j
ω π
sin 2

2 N −1

sin e j
ωN πN
+
2 N −1
+ 0.23
sin e .....(6.70)
ω
+
π
2 N −1 j

N = 31 N = 31
N = 31


N

F ig a : H a m m in g w in do w F ig b : A m plitud e respo nse F ig c: M ag nitud e respo nse o f


seq uen ce. o f H a m m in g w in do w. H a m m in g w in do w.

N = 31 N = 31
N = 31
ωc=0.5 π rad/sam ple
ωc=0.5 π rad/sam ple

−41 dB
|H d (e jω)|

F ig d : L og -m a g nitu d e resp o nse F ig e: M ag nitud e respo nse o f F IR low pa ss filter F ig f: L og -m a g nitu d e resp o nse of F IR low pa ss
o f H a m m in g w in do w,. d esig ned u sin g H am m in g wind ow. filter d esig ned u sin g H am m ing w ind ow.

F ig 6.2 5 : H am m in g w in do w seq u en c e an d its freq u en c y resp o n se (w h e n N = 3 1).


6. 49 Digital Signal Processing

The magnitude and log-magnitude response of hamming window for N = 31 are shown in fig 6.25(c) and (d).
Hamming reduced the side-lobe magnitude while maintaining the main-lobe width, equal to 8p/N. The magnitude
of the first side-lobe has been reduced to –41dB, an improvement of 10 dB relative to the Hanning window. But this
improvement is achieved at the expense of the side-lobe magnitudes at higher frequencies, which are almost
constant with frequency. [With the Hanning window, the side-lobe amplitudes decrease with frequency].
The magnitude response |H(ejw )| and log-magnitude response of lowpass filter designed using the Hamming
window are shown in fig 6.25(e) and (f). It is noted that the first side-lobe peak is reduced to –––51 dB, an
improvement of 7 dB relative to the Hanning window filter. However, as the frequency increases, the stopband
attenuation does not increase as much as with the filter produced by the Hanning window.
The stopband attenuation in the lowpass filter magnitude response is limited by the side-lobe level of the
window function. Even though the Hamming window achieved an attenuation of 51 dB (or gain of –51 dB) in the
stopband for our lowpass filter, it may not be sufficient for some applications.

6.8.6 Blackman Window


The Blackman window wB(n) is another type of cosine window defined by the equation,

2 πn 4 πn N–1 N–1
Blackman window, w B ( n) = 0.42 + 0.5 cos N–1
+ 0.08 cos N–1
; for – 2
to + 2
=0 ; other n .....(6.71)

Alternatively,
2 πn 4 πn
Blackman window, w B ( n) = 0.42 − 0.5 cos N–1
+ 0.08 cos N–1
; for n = 0 to N – 1
.....(6.72)
=0 ; other n

The Blackman window sequence defined by equation (6.71) can be used only for odd values of N, but the
window sequence defined by equation (6.72) can be used for both odd and even values of N.
The frequency response or frequency spectrum of Blackman window WB(ejw ) is obtained by taking
Fourier tranform of Blackman window sequence wB(n).


l q
∴ WB ( e ) = F w B ( n) = 0.42
sin
ωN
2
+ 0.25
sine ωN
2


N −1 j + 0.25 sin e ωN
2
+

N −1 j
ω
sin e j sin e j
ω π ω π
sin 2
− +
2 N −1 2 N −1

sin e j + 0.04 sin e j .....(6.73)


ωN 2 Nπ ωN 2 Nπ
− +
2 N −1 2 N −1
+ 0.04
sin e j sin e j
ω 2π ω 2π
− +
2 N −1 2 N −1

The magnitude and log-magnitude response of Blackman window for N = 31 are shown in fig 6.26(c)
and (d). In Blackman window the width of main-lobe is 12p/N, which is highest among windows. It can be
observed that the magnitude of the first side-lobe is –58 dB and the side-lobe magnitude decreases with frequency.
This desirable feature is achieved at the expense of increased main-lobe width. However, the main-lobe width can
be reduced by increasing the value of N.
The magnitude response |H(ejw )| and log-magnitude response of lowpass filter designed using blackman
window are shown in fig6.26 (e) and (f). It is observed at the first side-lobe peak is –78 dB, an improvement of 27
dB relative to Hamming window filter. However, as the frequency increases, the stopband attenuation does not
increase as much as with the filter produced by the Hanning window.
Chapter 6 - FIR Filters 6. 50

N = 31
N = 31
N = 31

12 π
N

F ig a : B la ckm an w ind o w sequ ence. F ig b : A m plitud e respo nse F ig c: M ag nitud e respo nse o f
o f B la ckm a n w ind ow. B la ckm a n w ind o w.

N = 31
N = 31 N = 31
ωc =0.5 π rad/sam ple
ωc =0.5 π rad/sam ple

|H d (e jω)|
−58 dB

F ig d : L og -m ag nitu d e respo nse F ig e: M ag nitud e respo nse o f F IR low pa ss F ig f: L og -m ag nitu d e respo nse of F IR low pa ss
o f B la ckm an w ind ow,. filter d esig ned u sin g B la ckm an w in do w. filter d esig ned u sin g B la ckm an w in do w.

F ig 6 .2 6 : B la ck m a n w in d ow seq u e nce a n d its freq u e ncy resp o n se (w h en N = 3 1 ).

6.8.7 Kaiser Window


The design of window function is basically a mathematical problem of finding a time-limited function
whose Fourier Transform best approximates a bandlimited function. The approximation should be such that the
maximum energy is confined to mainlobe for a given peak side-lobe amplitude. The prolate spheroidal functions
have this desirable property but these functions are difficult to compute. Kaiser has developed a simple
approximation to these functions in terms of zero-order modified Bessel functions of the first kind, which is
denoted by I0(x). The kaiser window function is in the form,
I 0 ( β1 ) N−1 N−1
Kaiser window function, w K ( n) = I 0 (a )
; for n = − 2
to + 2

=0 ; other n .....(6.74)

where, β1 = a 1 –
LM e j OP
2n
2
0.5

N Q
N–1

Alternatively,
I 0 (β2 )
Kaiser window function, w K ( n) = I0 (a2 )
; for n = 0 to N − 1
.....(6.75)
=0 ; other n

where, β 2 = a
LMe j − en −
N–1
2
N–1 2
j OPQ
0.5
; a2 = a
N–1

N 2 2 2

The Kaiser window sequence defined by equation (6.74) can be used only for odd values of N, but the
window sequenced defined by equation (6.75) can be used for both odd and even values of N.
The parameter "a" is an independent variable that can be varied to control the side-lobe levels with
respect to the main-lobe peak. The modified Bessel function of the first kind I0(x) is given by,
6. 51 Digital Signal Processing

LMb0.5xg2 OP k
L FG IJ k O
∞ 2 ∞
= 1+ ∑ N Q
1 x
I 0 ( x) = 1 + ∑ MN k! 2H K PQ b k !g 2
k=1 k=1

∞ FH 0.25x2 IK k 0.25x 2
FH 0.25x2 IK 2 FH 0.25x2 IK 3 .....(6.76)
= 1 + ∑ b k!g2
= 1+
b1!g2
+
b2!g2
+
b3!g2
+.....
k=1

The series of equation (6.76) can be used to compute I0(b1), I0(a), I0(b2), I0(a2) and can be computed for any
desired accuracy. Usually 25 terms of the series are sufficient for most practical purposes.
The frequency response or frequency spectrum of Kaiser window, WK(ejw ) is obtained by taking Fourier
transform of Kaiser window sequence wK(n).
F N −1 F F II
2a
2 0.5 I
2
sin GH 2
GH GH JK JK
ω2 −
N −1 JK
∴ WK (e jω ) = F w K ( n) = l q I0 (a) F 2 F 2 a I 2 I 0.5 .....(6.77)
GH ω − GH N −1JK JK
Fig 6.27 to 6.29 shows the Kaiser window sequence and its frequency response for three different values
of "a". With increase in value of "a" the magnitude of first side-lobe reduces, but the width of main-lobe
increases. The width of the main-lobe can be reduced by increasing the length N of the window sequence. In the
lowpass filter designed using Kaiser window the stopband attenuation increases with increase in the value
of "a".

N = 31 N = 31
N = 31

F ig a : K aiser w in do w sequen ce. F ig b : A m plitud e respo nse F ig c: M ag nitud e respo nse o f


o f K a iser w ind o w. K a iser w ind o w.

N = 31 N = 31
N = 31 ωc =0.5 π rad/sam ple ωc =0.5 π rad/sam ple


|H d (e )|

F ig d : L og -m a g nitu d e resp o nse F ig e: M ag nitud e respo nse o f F IR low pa ss F ig f: L og -m a g nitu d e resp o nse of F IR low pa ss
o f K a iser w ind ow. filter d esig ned u sin g K a iser w in do w. filter d esig ned u sin g K a iser w in do w.

F ig 6.2 7 : K a iser w in d o w seq u en ce a nd its fre q uen cy respo n se , fo r a = 1.5 a n d N = 3 1.


Chapter 6 - FIR Filters 6. 52

N = 31 N = 31
N = 31

F ig a : K aiser w in do w sequ en ce. F ig b : A m plitud e respo nse F ig c: M ag nitud e respo nse o f


o f K a iser w ind ow. K a iser w ind o w.

N = 31 N = 31
N = 31
ωc =0.5 π rad/sam ple ωc =0.5 π rad/sam ple


|H d (e )|

F ig d : L og -m a g nitu d e resp o nse F ig e: M ag nitud e respo nse o f F IR low pa ss F ig f: L og -m a g nitu d e resp o nse of F IR low pa ss
o f K a iser w ind ow. filter d esig ned u sin g K a iser w in do w. filter d esig ned u sin g K a iser w in do w.

F ig 6.2 8 : K a iser w in d o w seq u en ce a n d its fre q u en cy resp on se fo r a = 2 .5 a nd N = 3 1 ..

N = 31 N = 31
N = 31

F ig a : K aiser w in do w sequ en ce. F ig b : A m plitud e respo nse F ig c: M ag nitud e respo nse o f


o f K a iser w ind ow. K a iser w ind o w.

N = 31 N = 31
N = 31 ωc =0.5 π rad/sam ple ωc =0.5 π rad/sam ple

|H d (e jω)|

F ig d : L og -m a g nitu d e resp o nse F ig e: M ag nitud e respo nse o f F IR low pa ss F ig f: L og -m a g nitu d e resp o nse of F IR low pa ss
o f K a iser w ind ow,. filter d esig ned u sin g K a iser w in do w. filter d esig ned u sin g K a iser w in do w.

F ig 6 .2 9 : K a iser w in d o w sequ en ce a n d its fre q u en cy resp on se fo r a = 4 .5 a n d N = 31 .


6. 53 Digital Signal Processing
Table 6.4 : Window Sequences for FIR Filter Design

Name of window Window sequence

− N −1
w R ( n) = 1 ; for n = − N2 1 to +
2
= 0 ; other n
Rectangular w R ( n) = 1 ; for n = 0 to N − 1
= 0 ; other n

2 |n | N −1 N −1
w T ( n) = 1 − N −1
; for n = − 2
to +
2

Triangular =0 ; other n
2|n − ( N −1)/ 2|
w T ( n) = 1 − N −1
; for n = 0 to N − 1
=0 ; other n

2πn N −1 N −1
w C ( n) = 05
. + 05
. cos N −1
; for n = − 2
to +
2
=0 ; other n
Hanning
2πn
w C ( n) = 05
. − 05
. cos N −1 ; for n = 0 to N − 1
=0 ; other n

2πn N −1 N −1
w H ( n) = 054
. + 0.46 cos N −1
; for n = − 2
to +
2
=0 ; other n
Hamming 2πn
w H ( n) = 054
. − 046
. cos N −1 ; for n = 0 to N − 1
=0 ; other n

2πn 4πn N −1 N −1
w B ( n) = 0.42 + 05
. cos N −1
+ 0.08 cos N −1
; for n = − 2
to +
2
=0 ; other n
Blackman
2πn 4πn
w B ( n) = 0.42 − 05
. cos N −1 + 0.08 cos N −1
; for n = 0 to N − 1
=0 ; other n

I 0 (β1 ) N −1 N −1
w k ( n) = ; for n = − 2
to +
2
I 0 (a)
=0 ; other n

where, β1 = a LM
1−
FG 2 n IJ 2 OP 0.5

N H N −1 K Q
I 0 (β 2 )
w K ( n) = ; for n = 0 to N − 1
I 0 (a 2 )
Kaiser =0 ; other n

where, β2 = a LMFGH N −1 IJ 2 − FG n − N −1IJ 2 O


K H 2 K PQ
0.5

N 2

N −1
a2 = a 2
Chapter 6 - FIR Filters 6. 54

6.8.8 Summary of Various Features of Windows


The main advantage of windowing is that it is reasonably straightforward to obtain the filter impulse response
with minimal computational effort. The major reasons for the relative success of windows is their simplicity and ease
of use and the fact that closed form expressions are often available for the window coefficients. The main disadvantage
of this technique is that the resulting FIR filters satisfy no known optimality criterion (such as specified attenuation
at w s and w p) hence their performance have to be considerably improved in most cases.
T riangular
R ectangular
B lac km an
H am m ing

K ais er (a = 4.5)

H anning

F ig 6 .3 0 : S h a p es o f va rio u s w in do w fu n ctio n s.
Table 6.5 : Frequency - Domain Characteristics of Some Window Functions

Type of window Approximate Magnitude of


width of main-lobe first side-lobe
Rectangular 4p/N –13 dB
Bartlett 8p/N –25 dB
Hanning 8p/N –31 dB
Hamming 8p/N –41 dB
Blackman 12p/N –58 dB
Note : In filter specifications gain and magnitude are same and will be in negative [Link] attenuation
is inverse of gain and so it is negative of magnitude or gain in dB. Hence attenuation will be in
positive dB.

6.9 FIR Filter Design Using Windows


Method - 1 : Symmetry condition h(N – 1 – n) = h(n)
1. The specifications of digital FIR filter are,
i) The desired frequency response, Hd(ejw ) = Ce–ja w
where, C = Constant (usually, C = 1 = Normalized magnitude)
N −1
α =
2
ii) The cutoff frequency w c for lowpass and highpass, and w c1 and w c2 for bandpass and
bandstop filters
Note : If analog filter cutoff frequency Fc and sampling frequency Fs are specified, then
2 πFc
calculate the cutoff frequency of digital filter wc using the equation, ω c = .
Fs
iii) The number of samples of impulse response, N.
6. 55
Table 6.6 : The Normalized Ideal (Desired) Frequency Response and Impulse Response for FIR Filter Design Using Windows

Type of filter Ideal (desired) frequency Ideal (desired) impulse response


response

π ωc

Lowpass filter H d ( e jω
R|e
|
) = S0
− jωα
;
;
– ωc ≤ ω ≤ + ωc
– π ≤ ω < – ωc
h d ( n) =
1
2π z
−π
H d (e jω ) e jωn dω =
1
2π z
−ω c
e –jωα e jωn dω

||0 ; ωc < ω ≤ π jω
Q H d (e ) = 0 in the range − π ≤ ω < −ω c and + ω c < ω ≤ + π
T
+π –ω c π

Highpass filter H d ( e jω
R|e
|
) = Se
− jωα

− jωα
;
;
– π ≤ ω ≤ – ωc
ωc ≤ ω ≤ π
h d ( n) =
1
2π z
−π
H d (e jω ) e jωn dω =
1
2π z
−π
e –jωα e jωn dω +
1
2π z
ωc
e − jωα e jωn dω

||0 ; – ωc < ω <+ ωc



Q H d (e ) = 0 in the range − ω c < ω < +ω c
T
R|e − jωα +π – ω c1 ω c2

Bandpass filter H d ( e jω ) = S0
||e
|
− jωα

;
;
;
– ω c2 ≤ ω ≤ – ω c1
ωc1 ≤ ω ≤ ω c2
– π ≤ ω < –ω c2
h d ( n) =
1

−π
z jω
H d (e ) e jωn
dω =
1
2π z
−ω c 2
e –jωα
e jωn
dω +
1
2π z
ω c1
e − jωα e jωn dω

||0 ; − ωc1 < ω < +ω c1



Q H d (e ) = 0 in the range − π ≤ ω < −ω c2 ; − ω c1 < ω < +ω c1 and + ω c2 < ω ≤ + π
||0 ; ωc2 < ω ≤ π
T
+π –ω c2 + ω c1 π
R|e
||e
|
− jωα

− jωα
;
;
–π ≤ ω ≤ –ω c2
– ωc1 ≤ ω ≤ +ω c1
h d ( n) =
1
2π z
−π
H d (e jω )e jωn dω =
1
2π z
−π
e jωα e jωndω +
1
2π z
− ω c1
e − jωα e jωn dω +
1
2π z
ω c2
e − jωα e jωn dω

Digital Signal Processing


Bandstop filter H d (e jω
) = Se − jωα
; ωc 2 ≤ ω ≤ π Q H d (e jω ) = 0 in the range − ω c2 < ω < −ω c1 and + ω c1 < ω < + ω c2
||0 ; − ωc2 < ω < – ω c1
||0 ; ωc1 < ω < ωc 2
T
Chapter 6 - FIR Filters 6. 56
2. Determine the desired impulse response, hd(n) by taking inverse Fourier transform of the desired
frequency response, Hd(ejw ).

h d ( n) =
1
2π z

−π
H d ( e jω ) e jωn dω

(For limits of integration in the above equation refer table 6.6).


3. Choose the desired window sequence w(n) defined for n = 0 to N – 1 from table 6.4. Multiply
hd(n) with w(n) to get the impulse response h(n) of the filter. calculate N-samples of the impulse
response, for n = 0 to N – 1.
\ Impulse response, h(n) = hd(n) ´ w(n) ; for n = 0 to N – 1
The impusle response is symmetric with centre of symmetry at (N – 1)/2 and so h(N – 1 – n) = h(n).
Hence it is sufficient if we calculate h(n) for n = 0 to (N – 1)/2.
4. Take Z-transform of the impusle response h(n) to get the transfer function H(z) of the filter.
N −1
∴ Transfer function, H(z) = Z h(n) = l q ∑ h( n) z −n

n=0

5. Draw a suitable structure for realization of FIR filter.


Method - 2 : Symmetry condition h(–n) = h(n)
1. The specifications of digital FIR filter are,
i) The desired frequency response, Hd(ejw ) = C
where, C = Constant (usually, C = 1 = Normalized magnitude)
ii) The cutoff frequency w c for lowpass and highpass, and w c1 and w c2 for bandpass and bandstop
filters
Note : If analog filter cutoff frequency Fc and sampling frequency Fs are specified, then
2 πFc
calculate the cutoff frequency of digital filter wc using the equation, ω c = .
Fs
iii) The number of samples of impulse response, N.
2. Determine the desired impulse response, hd(n) by taking inverse Fourier transform of the desired
frequency response, Hd(ejw ).

h d ( n) =
1
2π z

−π
H d ( e jω ) e jωn dω

(For limits of integration in the above equation refer table 6.3).


N−1 N−1
3. Choose the desired window sequence w(n) defined for n = − 2 to +
2
1 from table 6.4.
Multiply hd(n) with w(n) to get the impulse response h(n) of the filter. calculate N-samples of the
N−1 N−1
impulse response, for n = − 2 to +
2
.
−1 N−1
\ Impulse response, h(n) = hd(n) ´ w(n) ; for n = − N 2 to +
2
.

The impulse response is symmetric with centre of symmetry at n = 0, and so h(–n) = h(n).
Hence it is sufficient if we calculate h(n) for n = 0 to (N – 1)/2.
6. 57 Digital Signal Processing

4. Take Z-transform of the impulse response h(n) to get the noncausal transfer function of FIR
filter, HN(z).
N −1
+
2
∴ H N (z) = Z h(n) =l q ∑ h( n) z N −1
−n

n =−
2

5. Convert the noncausal transfer function, HN(z) to causal transfer function, H(z) by multiplying
HN(z) by z – (N – 1)/2.
N −1 Applying symmetry
+

N −1 2 condition, h(– n) = h(n)
∴ Transfer function, H(z) = z 2 ∑ h ( n ) z −n
Refer equation (6.55).
N −1
n =−
2


N −1
LM N −1
2
OP
Alternatively, Transfer function, H(z) = z 2
MMh(0) + ∑ h(n) z
n=1
n
+z −n
PP
N Q
6. Draw a suitable structure for realization of FIR filter.
Design verification
1. Determine the frequency response, H(ejw ).
Method - 1 : Choose a linear phase magnitude function |H(ejw )| from table 6.2. Using h(n),
obtain an equation for |H(ejw )|.
Method - 2 : The frequency response, |H(ejw )| can be obtained by replacing z by ejw in the
transfer function, H(z).

∴ Frequency response, H e jω = H ( z) e j z = e jω

2. Calculate frequency response for various values of w in the range 0 to p.


3. Calculate the magnitude response, |H(ejw )| and sketch the magnitude response to verify the design.

Example 6.5
Design a linear phase FIR lowpass filter using rectangular window by taking 7 samples of window sequence
and with a cutoff frequency, w c = 0.2p rad/sample.

Solution
Let us choose symmetric impulse response with symmetry condition h(N – 1 – n) = h(n). Therefore, the
desired ideal frequency response Hd(ejw ) for FIR lowpass filter is,

Hd (ejω ) = e− jωα ; – ω c ≤ ω ≤ +ω c
=0 ; otherwise
The desired impulse response hd(n) is obtained by taking inverse Fourier transform of Hd(ejw ).
By definition of inverse Fourier transform,
+π +ω c

hd (n) =
1
2π z
−π

Hd (e ) e jωn
dω =
1
2π z
−ω c
e− jωα e jωn dω

+ω c
LM e OP +ω c
LM e OP
=
1
2π z
−ω c
ejω(n − α)
dω =
1

jω (n − α )

MN j(n − α) PQ −ω c
=
1

jω c (n − α )

MN j(n − α)

e− jω c (n − α )
j(n − α) PQ
Chapter 6 - FIR Filters 6. 58

∴ hd (n) =
1 LM e jω c (n − α )
− e− jω c (n − α) OP e jθ − e− jθ
sinθ =
π(n − α ) MN 2j PQ 2j
sin ω c (n − α ) When n = a, the hd(n) becomes
= ; for all n, except n = α
π(n − α ) 0/0, which is indeterminate.
sin ω c (n − α )
∴ When n = α ; hd (n) = Lt U sin g L' Hospital rule,
(n − α ) → 0 π(n − α )
sin Aθ
1 sin ω c (n − α ) 1 ω Lt =A
= Lt = × ωc = c θ→ 0 θ
π (n − α ) → 0 (n − α ) π π
The impulse response h(n) of FIR filter is obtained by multiplying hd(n) by window sequence.

Rectangular window sequence, wR (n) = 1 ; for n = 0 to (N − 1)


= 0 ; otherwise
∴ Impulse response, h(n) = hd (n) × wR (n)
= hd (n) ; for n = 0 to N − 1
N−1 7−1
Here, N = 7 ; ω c = 0 .2π rad / sample ; α= = = 3 ; N − 1= 6
2 2
Hence, calculate h(n) for n = 0 to 6.
Since, the impulse response h(n) satisfies the symmetry condition h(N – 1 – n) = h(n), calculate h(n) for n = 0 to 3.
sin (0.2π × (0 − 3))
When n = 0 ; h(0) = = 0.1009
π × (0 − 3)
sin (0.2π × (1 − 3))
When n = 1 ; h(1) = = 0.1514
π × (1 − 3)
Note : Calculate sin q by keeping the
sin (0.2π × (2 − 3))
When n = 2 ; h(2) = = 0.1871 calculator in radian mode.
π × (2 − 3)
0.2π
When n = 3 ; h(3) = = 0.2
π
b g
When n = 4 ; h(4) = h 6 − 4 = h(2) = 0.1871
Using symmetry condition,
When n = 5 ; h(5) = hb6 − 5g = h(1) = 0.1514 h(N – 1 – n) = h(n) Þ h(6 –n) = h(n).
When n = 6 ; h(6) = hb6 − 6g = h(0) = 0.1009

The transfer function H(z) of FIR lowpass filter is given by,


N – 1 6
l q ∑ h(n) z
H(z) = Z h(n) = –n
= ∑ h(n) z –n
n = 0 n = 0

= h(0) + h(1) z−1 + h(2) z−2 + h(3) z −3 + h(4) z −4 + h(5) z −5 + h(6) z −6 Using symmetry
−1 −2 −3 −4 −5 −6 condition,
= h(0) + h(1) z + h(2) z + h(3) z + h(2) z + h(1) z + h(0) z
h(N – 1 – n) = h(n).
= h(0) 1+ z −6 + h(1) z−1 + z−5 + h(2) z−2 + z−4 + h(3) z−3

= 0.1009 1 + z−6 + 0.1514 z −1 + z−5 + 0.1871 z −2 + z −4 + 0.2 z −3

Structure
Y(z)
Let , H(z) = = 0.1009 1 + z−6 + 0.1514 z−1 + z−5 + 0.1871 z−2 + z−4 + 0.2z −3
X(z)

∴ Y(z) = 0.1009 X(z) + z −6 X(z) + 0.1514 z−1X(z) + z−5 X(z) + 0.1871 z −2X(z) + z−4 X(z) + 0.2z−3 X(z)

The above equation can be used to draw the FIR filter structure as shown in fig 1.
6. 59 Digital Signal Processing

+ + +

0.1009 0.1514 0.1871


0.2

−6 −1 −5 −2 −4 −3
0.1009 [X(z)+z X(z)] 0.1514 [z X(z)+z X(z)] 0.1871 [z X(z)+z X(z)] 0.2 z X(z)

+ + +
F ig 1 : L in e ar p h a se stru cture o f F IR lo w pa ss filte r.
Frequency Response
When impulse response is symmetric and N is odd with centre of symmetry at (N – 1)/2, the magnitude
response |H(ejww )| is given by |A(w
w )|,
N −1
2
Refer table 6.2 case (i)
where, A(ω ) = h e j + ∑ 2he
N− 1
2
n=1
N− 1
2 j cos ωn
− n

3
∴ A(ω ) = h(3) + ∑ 2 h(3 − n) cos ωn
n=1

= h(3) + 2 h(2) cos ω + 2 h(1) cos 2ω + 2 h(0) cos 3ω


= 0.2 + 2 × 0.1871cosω + 2 × 0.1514 cos2ω + 2 × 0.1009 cos3ω
= 0.2 + 0.3742 cosω + 0.3028 cos2ω + 0.2018 cos3ω
Using the above equation, the amplitude response A(w) and magnitude function |H(ejw )| are calculated for
various values of w and listed in table 1. Using these values the magnitude response is plotted as shown
in fig 2.

w ) and |H(ejww )| for various values of w .


Table 1 : A(w
w A(w
w) |H(ejww )|=|A(w
w )| w A(w
w) |H(ejww )|=|A(w
w )|
0× π 9× π
16
1.0788 1.0788 16
–0.0406 0.0406
1×π 10 × π
16
1.0145 1.0145 16
0.0291 0.0291
2×π 11×π
16
0.8370 0.8370 16
0.0741 0.0741
3×π 12× π
16
0.5876 0.5876 16
0.0780 0.0780
4× π 13× π
16
0.3219 0.3219 16
0.0441 0.0441
5×π 14 × π
16
0.0940 0.0940 16
–0.0088 0.0088
6× π 15× π
16
–0.0573 0.0573 16
–0.0550 0.0550
7× π 16 × π
16
–0.1188 0.1188 16
–0.0732 0.0732
8× π
16
–0.1028 0.1028
Chapter 6 - FIR Filters 6. 60

|H (e jω)|
1.1

1.0

0.9

0.8

0.7

0.6

0.5

0.4

0.3

0.2

0.1

ω
0 π 2π 3π 4π 5π 6π 7π 8π 9π 10 π 11π 12 π 13 π 14 π 15π 16 π
16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16
( π/2 ) ( π)
F ig 2 : M a g n itu de resp on se o f F IR lo w p ass filter.

Alternate Method for Filter Design


Let the symmetry condition be h( –n) = h(n). Therefore, the desired ideal frequency response Hd(ejw ) for FIR lowpass filter is,

H d (e jω ) = 1 ; – ω c ≤ ω ≤ +ω c

= 0 ; otherwise

The desired impulse response hd(n) is obtained by taking inverse Fourier transform of Hd(ejw ).

By definition of inverse Fourier transform,


+π +ω c

h d ( n) =
1
2π z
−π
H d (e jω ) e jωn dω =
1
2π z
−ω c
1 × e jωn dω

=
1 LM e
jωn OP +ω c
=
1 LM e jω c n

e−
jω c n OP sinθ =
e jθ − e − jθ
2π MN jn PQ −ω c
2π MN jn jn PQ 2j

=
1 LM ejω c n
− e − jω c n OP = sin ω n c
; for all n, except n = 0
When n = 0, the hd(n) become
πn MN 2j PQ πn 0/0, which is indeterminate.

sin ω c n
∴ When n = 0 ; h d ( n) = Lt U sin g L' Hospital rule,
n→0 πn
sin Aθ
1 sin ω c n 1 ω Lt =A
= Lt = × ωc = c θ→ 0 θ
π n→0 n π π

The impulse response h(n) of FIR filter is obtained by multiplying hd(n) by window sequence.
N −1 N −1
Rectangular window sequence, w R ( n) = 1 ; for n = − 2
to + 2

= 0 ; otherwise

∴ Impulse response, h( n) = h d ( n) × w R (n)


N −1 N −1
= h d (n) ; for n = − 2
to + 2
6. 61 Digital Signal Processing
N −1 7 −1
Here, N = 7 ; ω c = 0 .2 π rad / sample ; = =3
2 2
Hence calculate h(n) for n = – 3 to +3.

Since, h(n) satisfies the symmetry condition h(–n) = h(n), calculate h(n) for n = 0 to 3.

ω c 0.2 π
When n = 0 ; h(0) = = = 0.2
π π
sin ( 0.2 π × 1)
When n = 1 ; h(1) = = 0.1871
π ×1
sin ( 0.2 π × 2)
When n = 2 ; h(2) = = 0.1514
π×2
sin (0.2 π × 3)
When n = 3 ; h(3) = = 0.1009
π×3

bg
When n = −1 ; h( −1) = h 1 = 0.1871

When n = −2 ; h( −2) = hb2g = 0.1514 Using symmetry


condition h(– n) = h(n)
When n = −3 ; h( −3) = hb3g = 01009
.

The transfer function H(z) of FIR lowpass filter is given by,

N −1
N −1 N −1 2 3
− −
H ( z) = z 2 l q
Z h(n) = z 2
∑ h( n) z – n = z −3
N −1
∑ h( n) z – n
n = −3
n =−
2

= z −3 h( −3) z 3 + h( −2) z 2 + h( −1) z + h( 0) z 0 + h(1) z −1 + h( 2) z −2 + h( 3) z −3

Using symmetry condition,


= z −3 h(3) z 3 + h( 2) z 2 + h(1) z + h( 0) + h(1) z −1 + h( 2) z −2 + h( 3) z −3 h(–n) = h(n).

LM
= z −3 h(3) z 3 + z −3 + h(2) z 2 + z −2 + h(1) z + z −1 + h(0) OP
N Q
= h(3) z 0 + z −6 + h(2) z −1 + z −5 + h(1) z −2 + z −4 + h(0) z −3

= 0.1009 1 + z −6 + 0.1514 z −1 + z −5 + 01871


. z −2 + z −4 + 0.2 z −3

It is observed that the transfer function obtained in both the methods are same.

Alternate method for Frequency Response

e j
Frequency response, H e jω = H ( z)
z = e jω

e j
∴ H e jω = 0.1009 1 + z −6 + 01514
. z −1 + z −5 + 0.1871 z −2 + z −4 + 0.2 z −3
z = e jω

− j6ω − jω − j5ω − j2 ω − j4 ω
= 0.1009 1 + e + 01514
. e +e + 0.1871 e +e + 0.2 e − j3ω

= 0.1009 + 0.1009 cos6ω − j sin 6ω + 0.1514 cos ω − j sin ω + cos5ω − j sin 5ω

+ 0.1871 cos 2ω − j sin 2ω + cos 4ω − j sin 4ω + 0.2 cos 3ω − j sin 3ω

= [ 0.1009 + 0.1009 cos6ω + 0.1514cos ω + 01514


. cos5ω + 01871
. cos2ω + 0.1871 cos 4ω + 0.2 cos 3ω ]

+ j[ − 01009
. sin 6ω − 0.1514 sin ω − 01514
. sin 5ω − 01871
. sin 2ω − 01871
. sin 4ω − 0.2 sin 3ω ]

Using the above equation the frequency response H(ejw ) and magnitude function |H(ejw )| of lowpass filter are calculated for various values of
w and listed in table 2. It is observed that the magnitude response obtained by both the methods are same.
Chapter 6 - FIR Filters 6. 62

Table 2 : H(ejww ) and |H(ejww )| for various values of w .

w H(ejww ) |H(e jww )| w H(ejww ) |H(e jww )|


0× π 9×π
1.0788 + j0 1.0788 –0.0225 – j0.0337 0.0405
16 16
1× π 10 × π
0.8435 – j0.563 1.0141 0.0269 + j0.0114 0.0292
16 16
2×π 11 × π
0.3203 – j0.7733 0.8370 0.0727 – j0.0144 0.0741
16 16
3× π 12 × π
–0.1146 – j0.576 0.5872 0.0552 – j0.0552 0.0738
16 16
4×π 13 × π
–0.2276 – j0.2276 0.3218 0.0086 – j0.0432 0.0440
16 16
5× π 14 × π
–0.0922 – j0.0183 0.0940 0.0033 + j0.0081 0.0087
16 16
6× π 15 × π
0.0529 – j0.0219 0.0572 0.0457 + j0.0305 0.0549
16 16
7×π 16 × π
0.0660 – j0.0988 0.1188 0.0732 – j0 0.0732
16 16
8×π
0 – j0.1028 0.1028
16

Example 6.6
Design a linear phase FIR highpass filter using hamming window, with a cutoff frequency, w c = 0.8p
rad/sample and N = 7.
Solution
Let us choose symmetric impulse response with symmetry condition h(N – 1 – n) = h(n). Therefore, the
desired ideal frequency response Hd(ejw ) for FIR highpass filter is,
Hd (e jω ) = e − jωα ; – π ≤ ω ≤ −ω c and + ω c ≤ ω ≤ + π
=0 ; otherwise
The desired impulse response hd(n) is obtained by taking inverse Fourier transform of Hd(ejw ).
By definition of inverse Fourier transform,

π −ω c π

hd (n) =
1
2π z
−π
Hd (e jω ) e jωn dω =
1
2π z
−π
e − jωα e jωn dω +
1
2π z
ωc
e − jωα e jωn dω

−ω c π

=
1
2π z
−π
e jω (n − α ) dω +
1
2π z
ωc
e jω(n − α ) dω

=
LM
1 e jω (n − α ) OP −ωc

+
LM
1 ejω (n − α ) OP π

MN
2π j(n − α ) PQ −π MN
2π j(n − α ) PQ ωc

=
1LM e − jω c (n − α )

e− jπ(n − α ) OP +
1 LM e
jπ (n − α )

ejω c (n − α ) OP
2π MN j(n − α) j(n − α) PQ 2π MN j(n − α) j(n − α) PQ e jθ − e− jθ
sinθ =
2j
=
1 LM e jπ(n − α )
− e− jπ(n − α )

e jω c (n − α ) − e − jω c (n − α ) OP
π(n − α ) MN 2j 2j PQ
sin π(n − α ) − sin ω c (n − α )
= ; for all n, except n = α When n = a, the hd(n) becomes
π(n − α )
0/0, which is indeterminate.
6. 63 Digital Signal Processing
sin π(n − α ) − sin ω c (n − α )
When n = α ; hd (n) = Lt
(n − α ) → 0 π(n − α )

=
1 LM Lt
sin π(n − α )
− Lt
sin ω c (n − α ) OP
π N
(n − α ) → 0 (n − α ) (n − α ) → 0 (n − α ) Q U sin g L' Hospital rule,
1 sin Aθ
= (π − ω c ) Lt =A
π θ→ 0 θ
ω
= 1− c
π
The impulse response h(n) of FIR filter is obtained by multiplying hd(n) by window sequence.
The Hamming window sequence wH(n) is given by,

wH(n) = 0.54 − 0.46 cos e j


2πn
N −1
; for n = 0 to N − 1

=0 ; otherwise
∴ h(n) = hd (n) wH(n)

=
b g
sin π n − α − sin ω c n − α b g 0.54 − 0.46 cos e j
2πn
; for n ≠ α
πn−α b g N− 1

= 1−
FG ωc IJ 0.54 − 0.46 cos e j
2πn
; for n = α
H π K N− 1

Given that, N = 7 ; ω c = 0 .8π rad / sample


N−1 7−1
∴ α= = = 3 ; N − 1= 6
2 2
Hence calculate h(n) for n = 0 to 6.
Since, h(n) satisfies the symmetry condition, h(N – 1 – n) = h(n), calculate h(n) for n = 0 to 3.

gL
−sinω c n − 3 b nπ O Since n and a are integers,
∴ h(n) =
bg MN0.54 − 0.46 cos 3 PQ ; for n ≠ 3
π n−3 sin (n – a) p = 0.

F ω IJ LM0.54 − 0.46 cos nπ OP


= G1 − c
; for n = 3
H πKN 3Q

L
−sin(0.8π (0 − 3)) M0.54 − 0.46 cos
0 × πO
N 3 PQ
When n = 0 ; h(0) = = −0.0081
π × (0 − 3)

−sin(0.8π (1 − 3)) 0.54 − 0.46 cos


LM 1× π OP
When n = 1 ; h(1) = N 3 Q = 0.0469
π × (1 − 3)

−sin(0.8π (2 − 3)) 0.54 − 0.46 cos


LM 2× π OP
When n = 2 ; h(2) = N 3 Q = −0.1441
π × (2 − 3)

When n = 3 ; h(3) = 1 −
FG 0.8π IJ LM0.54 − 0.46 cos 3 × π OP = 0.2
H π KN 3 Q
When n = 4 ; h(4) = h(6 − 4) = h(2) = −0.1441 Using symmetry condition
When n = 5 ; h(5) = h(6 − 5) = h(1) = 0.0469 h(N – 1 – n) = h(n) Þ h(6 – n) = h(n).

When n = 6 ; h(6) = h(6 − 6) = h(0) = −0.0081


Chapter 6 - FIR Filters 6. 64
The transfer function H(z) of FIR highpass filter is given by,
N – 1 6
l q ∑ h(n) z
H(z) = Z h(n) = –n
= ∑ h(n) z –n
n = 0 n = 0
Using symmetry
= h(0) + h(1) z−1 + h(2) z−2 + h(3) z−3 + h(4) z−4 + h(5) z−5 + h(6) z−6
condition
= h(0) + h(1) z−1 + h(2) z−2 + h(3) z−3 + h(2) z−4 + h(1) z−5 + h(0) z−6 h(N – 1 – n) = h(n)

= h(0) 1+ z−6 + h(1) z−1 + z−5 + h(2) z−2 + z−4 + h(3) z−3

= −0.0081 1+ z−6 + 0.0469 z−1 + z−5 − 0.1441 z−2 + z−4 + 0.2 z−3
Structure
Y(z)
Let , H(z) = = −0.0081 1+ z−6 + 0.0469 z−1 + z−5 − 0.1441 z−2 + z −4 + 0.2 z−3
X(z)

∴ Y(z) = −0.0081 X(z) + z−6 X(z) + 0.0469 z−1X(z) + z−5 X(z)

− 0.1441 z−2X(z) + z−4 X(z) + 0.2 z−3X(z)


The above equation can be used to draw the FIR filter structure as shown in fig 1.

+ + +

0.2

−6 −1 −5 −2 −4 −3
−0.0081 [X(z)+z X(z)] 0.0469 [z X(z)+z X(z)] −0.1441 [z X(z)+z X(z)] 0.2 z X(z)

+ + +
F ig 1 : L in e ar p h a se stru ctu re o f F IR h ig hp a ss filte r.
Frequency Response
When impulse response is symmetric and N is odd with centre of symmetry at (N – 1)/2, the magnitude
response |H(ejww )| is given by |A(w
w )|,
N− 1
2
where, A(ω ) = h e j + ∑ 2he
N −1
2
n=1
N− 1
2 j cos ωn
− n Refer table 6.2 case (i)

3
∴ A(ω ) = h(3) + ∑ 2 h(3 − n) cos ωn
n=1

= h(3) + 2 h(2) cos ω + 2 h(1) cos 2ω + 2 h(0) cos 3ω


= 0.2 + 2 × (−0.1441)cosω + 2 × 0.0469 cos2ω + 2 × (−0.0081) cos3ω
= 0.2 − 0.2882 cosω + 0.0938 cos2ω − 0.0162 cos3ω
Using the above equation, the amplitude function A(w) and magnitude function |H(ejw )| are calculated for
various values of w and listed in table 1. Using these values the magnitude response is plotted as shown
in fig 2.
6. 65 Digital Signal Processing

|H (e jω)|
0.6

0.55

0.5

0.45

0.4

0.35

0.3

0.25

0.2

0.15

0.1

0.05

ω
0
π 2π 3π 4π 5π 6π 7π 8π 9π 10π 11π 12π 13π 14 π 15 π 16 π
16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16
( π/2 ) ( π)
F ig 2 : M a g n itu d e resp o nse of F IR h ig h p ass filter.

w ) and |H(ejww )| for various values of w .


Table 1 : A(w

w A(w
w) |H(ejww )| = |A(w
w )| w A(w
w) |H(ejww )| = |A(w
w )|
0× π 9× π
16
–0.0106 0.0106 16
0.1605 0.1605
1×π 10 × π
16
–0.0094 0.0094 16
0.2289 0.2289
2×π 11×π
16
–0.0061 0.0061 16
0.3083 0.3083
3×π 12× π
16
–0.0005 0.0005 16
0.3923 0.3923
4× π 13× π
16
0.0076 0.0076 16
0.4723 0.4723
5×π 14 × π
16
0.0198 0.0198 16
0.5387 0.5387
6× π 15× π
16
0.0383 0.0383 16
0.5827 0.5827
7× π 16 × π
16
0.0661 0.0661 16
0.5982 0.5982
8× π
16
0.1062 0.1062

Alternate Method for Filter Design

Let the symmetry condition be h(– n) = h(n). Therefore, the desired ideal frequency response Hd(ejw ) for FIR highpass filter is,

H d (e jω ) = 1 ; – π ≤ ω ≤ −ω c and + ω c ≤ ω ≤ + π

= 0 ; otherwise
The desired impulse response hd(n) is obtained by taking inverse Fourier transform of Hd(ejw ).
Chapter 6 - FIR Filters 6. 66
By definition of inverse Fourier transform,
π −ω c π
h d ( n) =
1
2π z
−π
H d (e jω ) e jωn dω =
1
2π z
−π
1 × e jωn dω +
1
2π z
ωc
1 × e jωn dω

=
LM OP
1 e jωn
−ω c
+
LM
1 e jωn OP π
=
LM
1 e − jω c n

e − jπn
+
1 e jπn

OP
e jω c n LM OP
MN PQ
2 π jn
−π
MN
2 π jn PQ ωc
2π jn MN jn 2 π jn PQjn MN PQ
1 Le OP e jθ − e − jθ
jπn − jπn jω c n − jω c n
=
πn M
M −2 je −
e −e
2j PQ
sinθ =
2j
N
sin πn − sin ω c n
= ; for all n, except n = 0. When n = 0, the hd(n) becomes
πn
0/0, which is indeterminate.
sin πn − sin ω c n
When n = 0 ; h d (0) = Lt
n→0 πn U sin g L' Hospital rule,

=
LM 1 Lt
sin πn

1
Lt
sin ω c n ω
=1− c
OP Lt
sin Aθ
=A
Nπ n→0 n π n→0 n π Q θ→ 0 θ

The impulse response of FIR filter is obtained by multiplying hd(n) by window sequence.

Hamming window sequence, w H ( n) = 0.54 + 0.46 cos FH IK ; n = −


2 πn
N −1
N −1
2
to +
N −1
2

= 0 ; otherwise

\ Impulse response, h(n) = hd(n) wH(n)


N −1
Here, N = 7 ; = 3 ; ω c = 0.8 rad / sample.
2
Hence, calculate h(n) for n = –3 to 3.
Since, the impulse response h(n) satisfies the symmetry condition, h(–n) = h(n), calculate h(n) for n = 0 to 3.

∴ h(n) = −
sin ω c n LM
0.54 + 0.46 cos
πn OP ; for n ≠ 0 For integer n sin p n = 0.
πn N 3 Q
= 1−
FG IJ LM0.54 + 0.46 cos πn OP ; for n = 0
ωc
H KN π 3 Q

When n = 0
F 0.8π IJ LM0.54 + 0.46 cos π × 0 OP = 0.2
; h(0) = G1 −
H π KN 3 Q

sin b0.8π × 1g L
When n = 1 ; h(1) = −
π×1
MN0.54 + 0.46 cos π 3× 1 OPQ = −0.1441
sin b0.8π × 2 g L
When n = 2 ; h(2) = −
π× 2 MN0.54 + 0.46 cos π ×3 2 OPQ = 0.0469
sin b0.8π × 3g L
When n = 3 ; h(3) = −
π× 3 MN0.54 + 0.46 cos π 3× 3 OPQ = −0.0081
When n = −1 ; h( −1) = h(1) = −0.1441

When n = −2 ; h( −2) = h(2) = 0.0469 Using symmetry condition


h(n) = h(–n)
When n = −3 ; h( −3) = h(3) = −0.0081

The transfer function H(z) of the digital FIR highpass filter is given by,
N −1
N −1 N −1 2 3
− −
H ( z) = z 2 l q
Z h(n) = z 2

− N −1
h( n) z – n = z −3 ∑ h( n) z – n
n = −3
n=
2

= z −3 h( −3) z 3 + h( −2) z 2 + h( −1) z + h(0) z 0 + h(1) z −1 + h( 2) z −2 + h(3) z −3 Using symmetry condition


h(n) = h(–n)
= z −3 h(3) z 3 + h(2) z 2 + h(1) z + h(0) z 0 + h(1) z −1 + h( 2) z −2 + h( 3) z −3
6. 67 Digital Signal Processing

LM
∴ H(z) = z −3 h(3) z 3 + z −3 + h(2) z 2 + z −2 + h(1) z + z −1 + h(0) OP
N Q
= h(3) z 0 + z −6 + h(2) z −1 + z −5 + h(1) z −2 + z −4 + h(0) z −3

= −0.0081 1 + z −6 + 0.0469 z −1 + z −5 − 01441


. z −2 + z −4 + 0.2 z −3

= −0.0081 − 0.0081z −6 + 0.0469 z −1 + 0.0469 z −5 − 01441


. z −2 − 01441
. z −4 + 0.2z −3

It is observed that the transfer function obtained in both the methods are same.

Alternate Method for Frequency Response

e j
Frequency response, H e jω = H ( z)
z = e jω

e j
∴ H e jω = −0.0081 1 + z −6 + 0.0469 z −1 + z −5 + −0.1441 z −2 + z −4 + 0.2 z −3
z = e jω

= −0.0081 1 + e − j6ω + 0.0469 e − jω + e − j5ω − 01441


. e − j2ω + e − j4ω + 0.2 e − j3ω

= −0.0081 1 + cos6ω − j sin 6ω + 0.0469 cos ω − j sin ω + cos5ω − j sin 5ω

− 01441
. cos 2ω − j sin 2ω + cos 4ω − j sin 4ω + 0.2 cos 3ω − j sin 3ω

= [ −0.0081 − 0.0081 cos6ω + 0.0469 cos ω + 0.0469cos5ω − 01441


. cos 2ω − 0.1441cos 4ω + 0.2 cos 3ω ]

+ j[0.0081sin 6ω − 0.0469 sin ω − 0.0469 sin 5ω + 0.1441 sin 2ω + 01441


. sin 4ω − 0.2 sin 3ω ]

Using the above equation the frequency response H(ejw ) and magnitude function |H(ejw )| are calculated for various values of w and listed in
table 2. It is observed that the magnitude response obtained by both the methods are same.

Table 2 : H(ejww ) and |H(ejww )| for various values of w .

w H(ejww ) |H(e jww )| w H(ejww ) |H(e jww )|


0× π 9×π
–0.0106 – j0 0.0106 0.0892 + j0.1335 0.1605
16 16
1× π 10 × π
–0.0078 + j0.0052 0.0093 0.2115 + j0.0876 0.2289
16 16
2×π 11 × π
–0.0023 + j0.0056 0.0060 0.3024 – j0.0601 0.3083
16 16
3× π 12 × π
0.0001 + j0.0005 0.0005 0.2774 – j0.2774 0.3923
16 16
4×π 13 × π
–0.0054 – j0.0054 0.0076 0.0921 – j0.4632 0.4722
16 16
5× π 14 × π
–0.0194 – j0.0038 0.0197 –0.2061 – j0.4977 0.5386
16 16
6× π 15 × π
–0.0354 + j0.0146 0.0382 –0.4845 – j0.3237 0.5826
16 16
7×π 16 × π
–0.0367 + j0.0549 0.0660 –0.5982 – j0 0.5982
16 16
8×π
0 + j0.1062 0.1062
16
Chapter 6 - FIR Filters 6. 68

Example 6.7
Design a linear phase FIR bandpass filter to pass frequencies in the range 0.4p to 0.65p rad/sample by
taking 7 samples of hanning window sequence.
Solution
Let us choose symmetric impulse response with symmetry condition h(N – 1 – n) = h(n). Therefore, the
desired ideal frequency response Hd(ejw ) for bandpass filter is,

Hd (ejω ) = e− jωα ; – ω c2 ≤ ω ≤ – ω c1 & + ω c1 ≤ ω ≤ + ω c2


=0 ; otherwise
The desired impulse response hd(n) is obtained by taking inverse Fourier transform of Hd(ejw ).
By definition of inverse Fourier transform,

hd (n) =
1
2π z
−π
Hd (e jω ) e jωn dω

− ω c1 ω c2

=
1
2π z
− ω c2
e− jωα e jωn dω +
1
2π z
ω c1
e − jωα e jωn dω

− ω c1 ω c2

=
1
2π z
− ω c2
e jω (n − α ) dω +
1
2π z
ω c1
e jω (n − α ) dω

=
LM e
1 OP + 1 LM e
jω (n − α )
− ω c1
OP jω (n − α )
ω c2

MN j(n − α) PQ
2π 2π MN j(n − α ) PQ
−ω c2 ω c1

1 Le − jω c1(n − α )
e OP + 1 LM e
− jω c 2 (n − α ) jω c 2 (n − α )
e jω c1(n − α ) OP e jθ − e− jθ
= M
2π MN j(n − α )

j(n − α ) PQ 2π MN j(n − α)

j(n − α ) PQ sinθ =
2j

=
1 LM e jω c 2 (n − α )
− e − jω c2 (n − α )

e jω c1(n − α ) − e− jω c1(n − α ) OP
π(n − α ) MN 2j 2j PQ When n = a, the hd(n)
sin ω c2 (n − α ) − sin ω c1(n − α ) becomes 0/0 which
= ; for all n except n = α.
π(n − α ) is indeterminate.

sin ω c2 (n − α ) − sin ω c1(n − α )


When n = α ; hd (n) = Lt
(n − α ) → 0 π(n − α )
U sin g L' Hospital rule
=
1 LM Lt
sin ω c2 (n − α )
− Lt
sin ω c1(n − α ) OP
π N(n − α ) → 0 (n − α ) (n − α )→ 0 (n − α ) Q sin Aθ
Lt = A
θ→0 θ
ω c2 − ω c1
=
π
The impulse response h(n) of FIR filter is obtained by multiplying hd(n) by window sequence.
The hanning window sequence wC(n) is given by,
2πn
wC (n) = 0.5 − 0.5 cos N−1
; for n = 0 to (N − 1)
=0 ; otherwise

∴ h(n) = hd (n) wC (n) =


LM sin ω c 2 (n − α ) − sin ω c1(n − α ) OP 0.5 − 0.5 cos c h
2πn
; for n ≠ α
N π(n − α ) Q N− 1

Fω −
=G c2 ω c1 IJ 0.5 − 0.5 cos c h 2πn
; for n = α
H π K N− 1

Given that N = 7 ; w c1 = 0.4p rad/sample and w c2 = 0.65p rad/sample


6. 69 Digital Signal Processing
N−1 7 −1
Here, α = = = 3 ; N − 1= 6
2 2

Hence calculate h(n) for n = 0 to 6.

Since, h(n) satisfies the symmetry condition, h(N – 1 – n) = h(n), calculate h(n) for n = 0 to 3.

sin ω c2(n − 3) − sin ω c1(n − 3) 0.5 − 0.5 cos


LM nπ OP
∴ h(n) = N 3 Q ; for n ≠ 3
π(n − 3)

=
FG ω c2 − ω c1 IJ FG 0.5 − 0.5 cos nπ IJ ; for n = 3
H π KH 3K

c h c
sin 0.65π (0 − 3) − sin 0.4π (0 − 3) h LMN0.5 − 0.5 cos 0 3× π OPQ
When n = 0 ; h(0) = =0
π(0 − 3)

c h c
sin 0.65π (1 − 3) − sin 0.4π (1 − 3) h LMN0.5 − 0.5 cos 1 ×3 π OPQ
When n = 1 ; h(1) = = −0.0556
π(1 − 3)

c h c
sin 0.65π (2 − 3) − sin 0.4π (2 − 3) h LMN0.5 − 0.5 cos 2 ×3 π OPQ
When n = 2 ; h(2) = = −0.0143
π(2 − 3)

When n = 3 ; h(3) =
FG 0.65π − 0.4π IJ FG 0.5 − 0.5 cos 3π IJ = 0.25
H π KH 3K

When n = 4 ; h(4) = h(6 – 4) = h(2) = –0.0143


Using symmetry condition
When n = 5 ; h(5) = h(6 – 5) = h(1) = –0.0556 h(N – 1 – n) = h(n) Þ h(6 – n) = h(n).
When n = 6 ; h(6) = h(6 – 6) = h(0) = 0

The transfer function H(z) of FIR bandpass filter is given by,

N−1 6
l q ∑ h(n) z = ∑ h(n) z
H(z) = Z h(n) = −n −n

n=0 n=0

= h(0) + h(1) z −1 + h(2) z−2 + h(3) z −3 + h(4) z−4 + h(5) z −5 + h(6) z −6


= h(0) + h(1) z−1 + h(2) z −2 + h(3) z −3 + h(2) z −4 + h(1) z−5 + h(0) z −6
Using symmetry condition,
= h(0) 1+ z −6 + h(1) z −1 + z −5 + h(2) z −2 + z −4 + h(3) z −3 h(N – 1 – n) = h(n).

= 0 × 1 + z −6 − 0.0556 z −1 + z −5 − 0.0143 z −2 + z −4 + 0.25 z −3

= −0.0556 z −1 + z −5 − 0.0143 z −2 + z −4 + 0.25 z −3

Structure

Y(z)
Let , H(z) = = −0.0556 z –1 + z –5 − 0.0143 z−2 + z−4 + 0.25 z−3
X(z)

∴ Y(z) = −0.0556 z –1 X(z) + z –5 X(z) − 0.0143 z−2 X(z) + z−4 X(z) + 0.25 z –3 X(z)

The above equation can be used to draw the FIR filter structure as shown in fig 1.
Chapter 6 - FIR Filters 6. 70
−1
z X(z)

+ +

−1
z

−0.0143[z − X(z) + z− X(z)]


−1 −5 2 4 −3
−0.0556[z X(z) + z X(z)] 0.25z X(z)

+ +
F ig 1 : L in ea r ph a se stru c tu re fo r F IR b a ndp a ss filte r.
Frequency Response
When impulse response is symmetric and N is odd with centre of symmetry at (N – 1)/2 the magnitude
response |H(ejw )| is given by |A(w)|,
N−1
2
Refer table 6.2
where, A(ω ) = h e j ∑ 2h e
N−1
2
+
n=1
N−1
2 j
− n cos ωn
case (i)
3
∴ A(ω ) = h(3) + ∑ 2h b3 − ng cos ωn
n=1

= h(3) + 2h(2) cos ω + 2h(1) cos 2ω + 2 h(0) cos 3ω


b g b
= 0.25 + 2 × −0.0143 cos ω + 2 × −0.0556 cos 2ω + 2 × 0 cos 3ω g
= 0.25 − 0.0286 cos ω − 0.1112 cos 2ω
Using the above equation, the amplitude function A(w) and magnitude function |H(ejw )| are calculated for
various values of w and listed in table 1. Using these values the magnitude response is plotted as shown in fig 2.
w ) and |H(ejww )| for various values of w.
Table 1: A(w
w A(w
w) |H(ejww )| = |A(w
w )| w A(w
w) |H(ejww )| = A(w
w)
0×π 9×π
16
0.1102 0.1102 16
0.3583 0.3583
1 ×π 10 × π
16
0.1192 0.1192 16
0.3395 0.3395
2× π 11× π
16
0.1449 0.1449 16
0.3084 0.3084
3× π 12 × π
16 0.1836 0.1836 16 0.2702 0.2702
4×π 13 × π
16
0.2297 0.2297 16
0.2312 0.2312
5× π 14 × π
16
0.2766 0.2766 16
0.1977 0.1977
6×π 15 × π
16
0.3176 0.3176 16
0.1753 0.1753
7×π 16 × π
16
0.3471 0.3471 16
0.1674 0.1674
8×π
16
0.3612 0.3612
6. 71 Digital Signal Processing

|H (e jω)|
0.4

0.35

0.3

0.25

0.2

0.15

0.1

0.05

ω
0 π 2π 3π 4π 5π 6π 7π 8π 9π 10 π 11π 12π 13π 14 π 15 π 16π
16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16
(π/2) (π)
F ig 2 : M a gn itu d e resp o n se o f F IR b a n d p ass filter.

Alternate Method for Filter Design


Let the symmetry condition be h(–n) = h(n). Therefore, the desired ideal frequency response Hd(ejw ) for FIR bandpass filter is,

e j
H d e jω = 1 ; − ω c2 ≤ ω ≤ −ω c1 & + ω c1 ≤ ω ≤ ω c2

= 0 ; otherwise
The desired impulse response hd(n) is obtained by taking inverse Fourier transform of Hd(ejw ).
By definition of inverse Fourier transform,
π c1 −ω ω
1 c2
h d ( n) =
1
2π − πz e j
H d e jω e jωn dω =
1
2π −ω
1 × e jωn dω + z
2π + ω
c2
1 × e jωn dω z c1

=
LM OP + 1 LM e OP
1 e jωn
− ωc1
jωn
ωc 2

=
LM
1 e − jωc1n e − jωc 2n
− +
OP
1 e jωc 2n e jωc1n

LM OP
MN PQ 2π MN jn PQ
2 π jn
− ωc 2 ωc1
2π MN
jn jn 2π jn PQjn MN PQ
1 Le jω c 2 n − jω c2 n jωc1n
− e − jωc1n OP e jθ − e − jθ
= M −2 je − e
πn MN 2j PQ sinθ =
2j

sin ω c2 n − sin ω c1n


= ; for all n, except n = 0
πn When n = 0, the hd(n)
becomes 0/0 which
When n = 0 ; h d (0) = Lt
LM sin ω c 2 n − sin ω c1n
=
1 OP LM Lt sin ω c2 n
− Lt
sin ω c1n OP is indeterminate.
n→0 N πn π Q N n→0 n n→0 n Q
ω c2 − ω c1 U sin g L' Hospital rule
=
π sin Aθ
Lt = A
The impulse response h(n) of FIR filter is obtained by multiplying hd(n) by window sequence. θ→0 θ
N −1 N −1
Hanning window sequence, w C (n) = 0.5 + 0.5cos N2 π−n1 ; for n = − 2
to + 2

=0 ; otherwise
\ Impulse response, h(n) = hd(n) ´ wC(n)

=
FG sin ω − sin ω IJ e0.5 + 0.5cos j ; for n ≠ 0
c2 c1 2 πn
H πn K N −1

F ω − ω IJ e0.5 + 0.5cos j
=G c2 c1
; for n = 0 2 πn
H π K N −1

Given that, N = 7 ; w c1 = 0.4p rad/sample ; w c2 = 0.65p rad/sample


Chapter 6 - FIR Filters 6. 72
N −1 7 −1
∴ α= = = 3 ; N −1= 6
2 2
Hence calculate h(n) for n = 0 to 6.
Since, h(n) satisfies the symmetry condition, h(– n) = h(n), calculate h(n) for n = o to 3.

∴ h(n) =
FG sin ω n − sin ω n IJ FG 0.5 + 0.5cos πn IJ ; for n ≠ 0
c2 c1
H πn KH 3K

=G
F ω − ω IJ FG 0.5 + 0.5cos πn IJ ; for n = 0
c2 c1
H π KH 3K

When n = 0 ; h(0) = M
L 0.65π − 0.4π OP LM0.5 + 0.5 cos π × 0 OP = 0.25
N π QN 3 Q

When n = 1 ; h(1) = M
L sin c0.65π × 1h − sin c0.4π × 1h OP L0.5 + 0.5 cos π × 1 O = −0.0143
MN π ×1 PQ MN 3 Q
P

When n = 2 ; h(2) = M
L sin c0.65π × 2h − sin c0.4π × 2h OP L0.5 + 0.5 cos π × 2 O = −0.0556
MN π×2 PQ MN 3 Q
P

When n = 3 ; h(3) = M
L sin c0.65π × 3h − sin c0.4π × 3h OP L0.5 + 0.5 cos π × 3 O = 0
MN π×3 PQ MN 3 PQ
When n = –1 ; h(–1) = h(1) = –0.0143 Using symmetry
condtion,
When n = –2 ; h(–2) = h(2) = –0.0556
h(–n) = h(n).
When n = –3 ; h(–3) = h(3) = 0
The transfer function H(z) of FIR bandpass filter is,
N −1
+
N −1 N −1 2 3
− −
H ( z) = z 2 l q
Z h( n) = z 2
N 1
∑ −h( n) z − n = z −3 ∑ h( n) z − n
n=− n = −3
2

Using symmetry
= z −3 h( −3) z 3 + h( −2) z 2 + h( −1) z + h(0) z 0 + h(1) z −1 + h(2) z −2 + h(3) z −3 condtion,
h(–n) = h(n).
= z −3 h(3) z 3 + h(2) z 2 + h(1) z + h(0) + h(1) z −1 + h(2) z −2 + h(3) z −3

LM
= z −3 h(3) z 3 + z −3 + h(2) z 2 + z −2 + h(1) z + z −1 + h(0) OP
N Q
= h(3) z 0 + z −6 + h( 2) z −1 + z −5 + h(1) z −2 + z −4 + h( 0) z −3

= −0.0556 z −1 + z −5 − 0.0143 z −2 + z −4 + 0.25 z −3


h(3) = 0
It is observed that the transfer function obtained in both the methods are same.

Alternate Method for Frequency Response

e j
Frequency response, H e jω = H ( z)
z = e jω

e j
∴ H e jω = −0.0556 z −1 + z −5 − 0.0143 z −2 + z −4 + 0.25 z −3
z = e jω

e j e j
= −0.0556 e − jω − e − j5ω − 0.0143 e − j2ω − e − j4ω + 0.25 e − j3ω

= −0.0556 ccos ω − j sin ω + cos5ω − j sin 5ω h

− 0.0143ccos 2ω − j sin 2ω + cos 4ω − j sin 4ω h + 0.25ccos 3ω − jsin 3ω h

= −0.0556cos ω − 0.0556 cos5ω − 0.0143cos 2ω − 0.0143 cos 4ω + 0.25 cos 3ω

+ j 0.0556sin ω + 0.0556 sin 5ω + 0.0143sin 2ω + 0.0143 sin 4ω − 0.25 cos 3ω

Using the above equation the frequency response H(ejw ) and magnitude function |H(ejw )| are calculated for various values of w and listed in
table 2. It is observed that the magnitude response obtained in both the methods are same.
6. 73 Digital Signal Processing

Table 2: H(ejww ) and |H(ejww )| for various values of w

w H(ejww ) |H(e jww )| w H(ejww ) |H(e jww )|


0× π 9×π
0.1102 – j0 0.1102 0.1990 + j0.2979 0.3582
16 16
1× π 10 × π
0.0991 – j0.0662 0.1191 0.3137 + j0.1299 0.3395
16 16
2× π 11× π
0.0554 – j0.1339 0.1449 0.3025 – j0.0601 0.3084
16 16
3× π 12 × π
–0.0358 – j0.1801 0.1836 0.1910 – j0.1910 0.2701
16 16
4× π 13 × π
–0.1624 – j0.1624 0.2296 0.0451 – j0.2267 0.2311
16 16
5× π 14 × π
–0.2713 – j0.0539 0.2766 –0.0756 – j0.1827 0.1977
16 16
6× π 15 × π
–0.2935 + j0.1215 0.3176 –0.1457 – j0.097 0.1750
16 16
7× π 16 × π
–0.1928 + j0.2886 0.3470 –0.1674 – j0 0.1674
16 16
8× π
0 + j0.3612 0.3612
16

Example 6.8
Design a linear phase FIR bandstop filter to reject frequencies in the range 0.4p to 0.65p rad/sample
using rectangular window, by taking 7 samples of window sequence.
Solution
Let us choose symmetric impulse response with symmetry condition, h(N – 1 – n) = h(n). Therefore, the
desired ideal frequency response Hd(ejw ) for bandstop filter is,
Hd (e jω ) = e − jωα ; – π ≤ ω ≤ – ω c2 and – ω c1 ≤ ω ≤ + ω c1 and + ω c2 ≤ ω ≤ + π
=0 ; otherwise
The desired impulse response hd(n) obtained by taking inverse Fourier transform of Hd(ejw ).
By definition of inverse Fourier transform,

hd (n) =
1
2π z
−π
Hd (e jω ) e jωn dω

− ω c2 ω c1 π

=
1
2π z
−π
e− jωα ejωn dω +
1
2π z
− ω c1
e− jωα e jωn dω +
1

ω c2
z e− jωα ejωn dω

− ω c2 ω c1 π

=
1
2π z
−π
e jω (n − α ) dω +
1
2π z
− ω c1
e jω (n − α ) dω +
1

ω c2
z ejω (n − α ) dω

=
LM
1 e jω (n − α ) OP OP + 1 LM e
− ω c2

+
LM OP
1 e jω (n − α )
ω c1
jω (n − α )
π

MN
2π j(n − α ) PQ −πPQ 2π MN j(n − α MN
) PQ
2π j(n − α ) − ω c1 ω c2

1 Le e OP + 1 LM e
− jω c 2 (n − α ) − jπ (n − α )
e OP + 1 LM e jω c1(n − α )
e OP − jω c1(n − α ) jπ (n − α ) jω c2 (n − α )
= M
2π MN j(n − α )

j(n − α ) PQ 2π MN j(n − α )

j(n − α ) PQ 2π MN j(n − α )

j(n − α ) PQ

=
1 LM e −e jω c1(n − α )
+
e −e − jω c1(n − α )

e −e OP
jπ(n − α ) − jπ (n − α ) jω c2 (n − α ) − jω c2 (n − α )

π(n − α ) MN 2j 2j 2j PQ
sinω c1(n − α ) + sin π(n − α ) − sin ω c2(n − α)
= ; for all n, except n = α e jθ − e− jθ
π(n − α ) sinθ =
2j
Chapter 6 - FIR Filters 6. 74

∴ When n = α ; When n = a, the hd(n) becomes


0/0 which is indeterminate.
sin ω c1(n − α ) + sin π(n − α) − sin ω c2 (n − α)
hd (n) = Lt
(n − α ) → 0 π(n − α )

=
1 LM Lt
sin ω c1(n − α )
+ Lt
sin π(n − α )
− Lt
sin ω c2 (n − α ) OP
π N
(n − α ) → 0 (n − α ) (n − α ) → 0 (n − α ) (n − α ) → 0 (n − α ) Q
1
= ω c1 + π − ω c2 U sin g L' Hospital rule
π
sin Aθ
= 1−
FG ω c2 − ω c1 IJ Lt
θ→ 0 θ
= A
H π K
The impulse response h(n) of FIR filter is obtained by multiplying hd(n) by window sequence.
The window sequence for rectangular window wR(n) is given by,
wR (n) = 1 ; for n = 0 to N − 1
= 0 ; otherwise

∴ h(n) = hd (n) × wR (n) = hd (n) =


b g b g
sin ω c1 n − α + sin π n − α − sin ω c2 n − α b g ; for n ≠ α
b
πn−α g
= 1−
FG ω c2 − ω c1 IJ ; for n = α
H π K
Given that, N = 7 ; ω c1 = 0.4π rad / sample ; ω c2 = 0.65π rad / sample

N−1 7 −1
∴ α= = = 3 ; N − 1= 6
2 2
Hence calculate h(n) for n = 0 to 6.
Since, h(n) satisfies the symmetry condition, h(N – 1 – n) = h(n), calculate h(n) for n = 0 to 3.

∴ h(n) =
b g b
sinω c1 n − 3 − sinω c2 n − 3 g ; for n ≠ 3
π n−3 b g Since n and a are
ω − ω c1 integers, sin(n – a)p = 0.
= 1 − c2 ; for n = 3
π
sin(0.4π (0 − 3)) − sin(0.65π (0 − 3))
When n = 0 ; h(0) = = −0.0458
π × (0 − 3)
sin(0.4π (1 − 3)) − sin(0.65π (1 − 3))
When n = 1 ; h(1) = = 0.2223
π × (1 − 3)
sin(0.4π (2 − 3)) − sin(0.65π (2 − 3))
When n = 2 ; h(2) = = 0.0191
π × (2 − 3)

When n = 3 ; h(3) = 1 −
FG 0.65π − 0.4π IJ = 0.75
H π K
When n = 4 ; h(4) = h(6 − 4) = h(2) = 0.0191
Using symmetry condition
When n = 5 ; h(5) = h(6 − 5) = h(1) = 0.2223 h(N – 1 – n) = h(n) Þ h(6 – n) = h(n).
When n = 6 ; h(6) = h(6 − 6) = h(0) = −0.0458
The transfer function H(z) of FIR bandstop filter is given by,
N – 1 6
l q ∑ h(n) z
H(z) = Z h(n) = –n
= ∑ h(n) z – n
n = 0 n = 0
6. 75 Digital Signal Processing

∴ H(z) = h(0) + h(1) z −1 + h(2) z−2 + h(3) z −3 + h(4) z−4 + h(5) z −5 + h(6) z −6 Using symmetry

= h(0) + h(1) z −1
+ h(2) z −2
+ h(3) z −3
+ h(2) z −4
+ h(1) z −5
+ h(0) z −6 condition,
h(N – 1 – n) = h(n).
= h(0) 1+ z−6 + h(1) z−1 + z −5 + h(2) z−2 + z−4 + h(3) z −3

= −0.0458 1+ z −6 + 0.2223 z −1 + z −5 + 0.0191 z −2 + z −4 + 0.75 z−3

Structure

Y(z)
Let , H(z) = = −0.0458 1+ z−6 + 0.2223 z −1 + z−5 + 0.0191 z−2 + z−4 + 0.75 z−3
X(z)

∴ Y(z) = −0.0458 X(z) + z −6 X(z) + 0.2223 z−1X(z) + z−5 X(z)

+ 0.0191 z−2X(z) + z −4 X(z) + 0.75 z −3X(z)

The above equation can be used to draw the FIR filter structure as shown in fig 1.

−1 −2 −3
z X(z) z X(z) z X(z)
−1 −1 −1
z z z

+ + +

−1 −1 −1
−6 z −5
z −4
z
z X(z) z X(z) z X(z)

−6 −1 −5 −2 −4 −3
−0.0458 [X(z) + z X(z)] 0.2223 [z X(z) + z X(z)] 0.0191 [z X(z) + z X(z)] 0.75z X(z)

+ + +
F ig 1 : L in ea r ph a se stru c tu re fo r F IR b a nd sto p filter.

Frequency Response

When impulse response is symmetric and N is odd with centre of symmetry at (N – 1)/2 the magnitude
response |H(ejw )| is given by |A(w)|,
N−1

N−1
2
N−1 Refer table 6.2
where, A(ω ) = h e j + ∑ 2h e
2
n=1
2 j
− n cos ωn case (i)

3
∴ A(ω ) = h(3) + ∑ 2h b3 − ng cos ωn
n=1

= h(3) + 2h(2) cos ω + 2h(1) cos 2ω + 2 h(0) cos 3ω


= 0.75 + 2 × 0.0191cos ω + 2 × 0.2223 cos 2ω + 2 × −0.0458 cos 3ω b g
= 0.75 + 0.0382cos ω + 0.4446 cos 2ω − 0.0914 cos 3ω

Using the above equation the magnitude response, A(w) and magnitude function |H(ejw )| are calculated for
various values of w and listed in table 1. Using these values the magnitude response is plotted as shown in fig 2.
Chapter 6 - FIR Filters 6. 76
w ) and |H(ejww )| for various values of w .
Table 1: A(w

w A(w
w) |H(ejww )| = |A(w
w )| w A(w
w) |H(ejww )| = |A(w
w )|
0 ×π 9×π
16
1.1414 1.1414 16
0.2810 0.2810
1×π 10 × π
16
1.1223 1.1223 16
0.3365 0.3365
2×π 11×π
16
1.0646 0.0646 16
0.4689 0.4689
3×π 12×π
16
0.9697 0.9697 16
0.6583 0.6583
4 ×π 13×π
16
0.8416 0.8416 16
0.8705 0.8705
5×π 14 ×π
16
0.6907 0.6907 16
1.0640 1.0640
6 ×π 15×π
16
0.5346 0.5346 16
1.1992 1.1992
7 ×π 16 ×π
16
0.3974 0.3974 16
1.2478 1.2478
8 ×π
16
0.3054 0.3054

|H (e jω)|
1.2

1.1

1.0

0.9

0.8

0.7

0.6

0.5

0.4

0.3

0.2

0.1

ω
π 2π 3π 4π 5π 6π 7π 8π 9π 10 π 11π 12 π 13π 14 π 15π 16π
16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16
( π/2 ) ( π)
F ig 2 : M a gn itu d e resp o n se o f F IR b a n dsto p filter.

Alternate Method for Filter Design


Let the symmetry condition be h(– n) = h(n). Therefore, the desired ideal frequency response Hd(ejw ) for FIR bandstop filter is,
H d (e jω ) = 1 ; – π ≤ ω ≤ – ω c2 and – ω c1 ≤ ω ≤ + ω c1 and + ω c2 ≤ ω ≤ + π

= 0 ; otherwise
The desired impulse response hd(n) is obtained by taking inverse Fourier transform of Hd(ejw ).
By definition of inverse Fourier transform,
− ωc2 ωc1

h d ( n) =
1
2π z
π

−π
H d (e jω ) e jωn dω =
1
2π z
−π
1 × e jωn dω +
1
2π z
− ωc1
1 × e jωn dω +
1
2π zπ

ωc2
1 × e jωn dω
6. 77 Digital Signal Processing

∴ h d ( n) =
LM OP + 1 LM e OP + 1 LM e OP
1 e jωn
− ω c2
jωn
ωc1
jωn
π

MN PQ
2 π jn 2 π MN jn PQ
−π
2 π MN jn PQ
− ω c1 ωc 2

1 Le OP + 1 LM e − e OP + 1
− jω c 2 n LM e OP
− jπn jω c1n − jωc1n jπn jω c 2 n
e e
= M
2 π MN jn

jn PQ 2 π MN jn jn PQ 2 π MN jn −
jn PQ
M 2 j OPP + LMM e −2 je OPP − LMM e −2 je
1 Le − e OP
jπn − jπn jωc1n − jωc1n jω c 2 n − jω c 2 n e jθ − e − jθ
= sinθ =
πn MN Q N Q N PQ 2j

sin πn + sin ω c1n − sin ω c2 n


= ; for all n, except n = 0.
πn
When n = 0, the hd(n)
sin πn + sin ω c1n − sin ω c2 n becomes 0/0 which
When n = 0 ; h d ( n) = Lt
n →0 πn is indeterminate.

1 sin πn 1 sin ω c1n 1 sin ω c2 n


= Lt + Lt + Lt U sin g L' Hospital rule
π n →0 n π n →0 n π n →0 n

=
1 1 1
× π + × ω c1 − × ω c2 = 1 −
ω c2 − ω c1 FG IJ Lt
sin Aθ
= A
π π π π H K θ→0 θ

The impulse response h(n) of FIR filter is obtained by multiplying hd(n) by window sequence.
N −1 N −1
Rectangular window sequence, w R ( n) = 1 ; n = − 2
to +
2

= 0 ; otherwise

∴ Impulse response, h(n) = h d ( n) × w R ( n)


N −1 N −1
= h d ( n) ; for n = − 2
to +
2

N −1 7 −1
Here, N = 7, w c1 = 0.4p rad/sample ; w c2 = 0.65p rad/sample ; = =3
2 2
Hence, calculate h(n) for n = –3 to 3.

Since, h(n) satisfies the symmetry condition, h(–n) = h(n), calculate h(n) for n = 0 to 3.
sin ω c1 − sin ω c2 For integer n,
∴ h(n) = ; for n ≠ 0
πn sin pn = 0

=1−
FG ω − ω IJ ; for n = 0
c2 c1
H π K
When n = 0 ; h(0) = 1 − G
F ω − ω IJ = 1 − FG 0.65π − 0.4π IJ = 0.75
c2 c1
H π K H π K
sin b0.4 π × 1g − sin b0.65π × 1g
When n = 1 ; h(1) = = 0.0191
π ×1

When n = 2 ; h(2) =
b g
sin 0.4 π × 2 − sin 0.65π × 2 b g = 0.2223
π×2

When n = 3 ; h(2) =
b g
sin 0.4 π × 3 − sin 0.65π × 3 b g = −0.0457
π×3
When n = −1 ; h( −1) = h(1) = 0.0191 Using symmetry
condtion,
When n = −2 ; h( −2) = h(2) = 0.2223
h(–n) = h(n).
When n = −3 ; h( −3) = h(3) = −0.0457
The transfer function H(z) of the digital FIR bandstop filter is given by,
N −1
N −1 N −1 2 3
− −
H( z) = z 2 l q
Z h(n) = z 2

− N −1
h( n) z – n = z −3 ∑ h( n) z – n
n = −3
n=
2 Using symmetry
condtion,
−3 3 2 0 −1 −2 −3
=z h( −3) z + h( −2) z + h( −1) z + h(0) z + h(1) z + h( 2) z + h(3) z h(–n) = h(n).
Chapter 6 - FIR Filters 6. 78

∴ H(z) = z −3 h(3) z 3 + h(2) z 2 + h(1) z + h(0) z + h(1) z −1 + h(2) z −2 + h(3) z −3

LM
= z −3 h(3) z 3 + z −3 + h(2) z 2 + z −2 + h(1) z + z −1 + h(0) OP
N Q
= h(3) z 0 + z −6 + h(2) z −1 + z −5 + h(1) z −2 + z −4 + h(0) z −3

= −0.0457 1 + z −6 + 0.2223 z −1 + z −5 + 0.0191 z −2 + z −4 + 0.75z −3

It is observed that the transfer function obtained in both the methods are same.

Alternate Method for Frequency Response

e j
Frequency response, H e jω = H ( z)
z = e jω

e j
∴ H e jω = −0.0457 1 + z −6 + 0.2223 z −1 + z −5 + 0.0191 z −2 + z −4 + 0. 75 z −3
z = e jω

= − 0.0457 1 + e − j6ω + 0.2223 e − jω + e − j5ω + 0.0191 e − j2ω + e − j4ω + 0.75 e − j3ω

= −0.0457 − 0.0457 cos6ω − j sin 6ω + 0.2223 cos ω − j sin ω + cos5ω − jsin 5ω

+ 0.0191 cos 2ω − j sin 2ω + cos 4ω − j sin 4ω + 0.75 cos 3ω − j sin 3ω

= [ −0.0457 − 0.0457 cos6ω + 0.2223 cos ω + 0.2223 cos5ω + 0.0191 cos2ω + 0.0191 cos 4ω + 0.75 cos3ω ]

+ j[ 0.0457 sin 6ω − 0.2223 sin ω − 0.2223 sin 5ω − 0.0191 sin 2ω − 0.0191sin 4ω − 0.75 sin 3ω ]

Using the above equation the frequency response H(ejw ) and magnitude function |H(ejw )| are calculated for various values of w and listed in
table 2. It is observed that the magnitude response obtained in both the methods are same.

Table 2: H(ejww ) and |H(ejww )| for various values of w

w H(ejww ) |H(e jww )| w H(ejww ) |H(e jww )|


0× π 9×π
1.1414 – j0 1.1414 0.1561 + j0.2336 0.2809
16 16
1× π 10 × π
0.9330 + j0.6234 1.1221 0.3109 + j0.1287 0.3364
16 16
2×π 11 × π
0.4074 – j0.9836 1.0646 0.4599 – j0.0914 0.4689
16 16
3× π 12 × π
–0.1899 – j0.9511 0.9697 0.4655 – j0.4655 0.6583
16 16
4×π 13 × π
–0.5951 – j0.5951 0.8416 0.1698 – j0.8538 0.8705
16 16
5× π 14 × π
–0.6774 – j0.1347 0.6907 –0.4072 – j0.9830 1.0640
16 16
6× π 15 × π
–0.4939 + j0.2046 0.5346 –0.9971 – j0.6662 1.1991
16 16
7×π 16 × π
–0.2208 + j0.3304 0.3974 –1.2478 – j0 1.2478
16 16
8×π
0 + j0.3054 0.3054
16
6. 79 Digital Signal Processing

6.10 Design of FIR Filters by Frequency Sampling Technique


In this method the ideal (desired) frequency response is sampled at sufficient number of points (i.e., N-
points). These samples are the DFT coefficients of the impulse response of the filter. Hence the impulse
response of the filter is determined by taking inverse DFT.
Let, Hd(ejw ) = Ideal desired frequency response
H(k) = DFT sequence obtained by sampling Hd(ejw )
h(n) = Impulse response of FIR filter.
The impulse response h(n) is obtained by taking inverse DFT of H(k). For practical realizability the
samples of impulse response should be real. This can happen if all the complex terms appear in complex
conjugate pairs. It can be observed that the complex DFT coefficients exists only as conjugate pairs. This
suggest that the terms of H(k) can be matched by comparing the exponentials. The term H(k) e+j2pnk/N should be
matched by the term that has the exponential e–j2pnk/N as a factor.
Procedure for Type-1 Design
1. Choose the ideal (desired) frequency response Hd(ejw ).
2. Sample Hd(ejw ) at N-points by taking w = w k = 2pk/N where k = 0, 1, 2, 3, ....(N-1), to
generate the sequence H(k) .

∴ H ( k ) = H d (e jω ) 2 πk ; for k = 0, 1, ..... (N − 1)
ω=
N

3. Compute the N samples of impulse response h(n) using the following equation.
When N is odd,
LM N−1
2
OP
1
Impulse response, h( n) =
N
MMH(0) + 2 ∑ Re H(k) e
k=1
j2 πnk / N
PP .....(6.76)

N Q
When N is even,
LM N
2
−1 OP
1
Impulse response, h( n) =
N
MMH(0) + 2 ∑ Re H(k) e j2 πnk / N
PP .....(6.77)
N k=1
Q Here, H ej
N
2
=0

where, "Re" stands for "real part of".


4. Take Z-transform of the impulse response h(n) to get the filter transfer function, H(z).
N−1
l q ∑ h( n) z
∴ H(z) = Z h(n) = −n

n=0

Procedure for Type-2 Design


1. Choose the ideal (desired) frequency response Hd(ejw ).
2. Sample Hd(ejw ) at N-points by taking w = w k = 2p(2k + 1)/2N, where k = 0, 1, 2, 3, .....
(N – 1), to generate the sequence H(k).

∴ H ( k ) = H d (e jω ) 2 π ( 2 k + 1) ; for k = 0, 1, ..... (N − 1)
ω=
2N
Chapter 6 - FIR Filters 6. 80
3. Compute the N samples of impulse response h(n) using the following equation.
When N is odd,
N− 3 Here, H e j=0
N −1

2 2 L jnπ ( 2 K + 1) OP 2

Impulse response, h( n) = ∑ ReMMH(k) e N


PQ
.....(6.78)
N k=0 N
When N is even,
N
2 2 L
−1
jnπ ( 2 K + 1) OP
Impulse response, h( n) =
N
×2 ∑ MM Re H(k) e N
PQ
.....(6.79)
k=0N
where "Re" stands for "real part of".
4. Take Z-transform of the impulse response h(n) to get the filter transfer function, H(z)
N−1
l q ∑ h( n) z
∴ H(z) = Z h(n) = −n

n=0

Example 6.9
Determine the coefficients of a linear-phase FIR filter of length N = 15 which has a symmetric unit sample
response and a frequency response that satisfies the conditions

H e j
2πk
15
=1 ; for k = 0, 1, 2, 3
= 0.4 ; for k = 4
=0 ; for k = 5, 6, 7

Solution
N − 1
For linear phase FIR filter the phase function, q(w) = -aw where α = .
2

15 − 1
Here, N = 15, ∴ α = =7.
2
2πk 2πk
Also, here ω = ω k = = . Hence we can go for type-1 design.
N 15
In this problem the samples of the magnitude response of the ideal (desired) filter are directly given for
various values of k.
2πk
− j7 ×
∴ H(k) = Hd (ω ) ω = ω = 1 e − jαω k =e 15 ; k = 0, 1, 2, 3
k
2πk
− j7 ×
= 0.4 e− jαω k = 0.4 e 15 ; k = 4
=0 ; k = 5, 6, 7

The samples of impulse response h(n) are given by,


Using equation(6.76).
L N − 1
L OPOP
1 M 2 j2πnk

M H(0) + 2 ∑ ReMH(k) e
PQPP
h(n) = N
N M MN
k = 1
MN PQ
1 LM L OPOP
7 j2πnk
= H(0) + 2 ∑ Re MH(k) e 15
15 M MN PQPQ
N k = 1

1 LM L OP LM OPOP
3 j2πnk j2πn × 4
= H(0) + 2 ∑ Re MH(k) e 15 2 Re H(4) e 15
15 M
N MN
k = 1 PQ + MN PQPQ
6. 81 Digital Signal Processing

1 LM 3 L − j7 ×
2πk OP
j2πnk L − j7 × OP OP H(0) = 1
2π × 4 j8 πn
∴ h(n) = 1 + 2 ∑ ReMe 15
× e 15 + 2 Re M0.4 e × e 15 15
15 MN k = 1 MN PQ MN PQ PQ
1 LM 3 L j2πk OP
(n − 7 ) L j8 π OPOP
(n − 7 )
= 1 + 2 ∑ Re Me 15 + 2 Re M0.4 e 15 jθ
e = cos θ + j sin θ
15 MN k = 1 MN PQ MN PQPQ jθ
∴ Re[e ] = cos θ
1 LM1 + 2 cos 2πk (n − 7) + 0.8 cos 8π (n − 7)OP
3
=
15 MN ∑ 15 15 PQ
k = 1

=
1 LM1+ 2 cos 2π (n − 7) + 2cos 4π (n − 7) + 2 cos 6π (n − 7) + 0.8 cos 8π (n − 7) OP
15 N 15 15 15 15 Q
N−1
Here N = 15, \ N – 1 = 14, 2
= 7.

Hence, calculate h(n) for n = 0 to 14


Since h(n) satisfies the symmetry condition h(N – 1 – n) = h(n) with centre of symmetry at (N – 1)/2, calculate
h(n) for n = 0 to 7.

When n = 0 ; h(0) =
1 LM
1 + 2 cos
2π(0 − 7)
+ 2cos
4π(0 − 7)
+ 2cos
6π(0 − 7)
+ 0.8 cos
8π(0 − 7) OP
15 N 15 15 15 15 Q
= −0.0141

When n = 1 ; h(1) =
1 LM
1 + 2 cos
2π(1 − 7)
+ 2cos
4π(1 − 7)
+ 2cos
6π(1 − 7)
+ 0.8 cos
8π(1 − 7) OP
15 N 15 15 15 15 Q
= −0.0019

When n = 2 ; h(2) =
1 LM
1 + 2 cos
2π(2 − 7)
+ 2cos
4π(2 − 7)
+ 2cos
6π(2 − 7)
+ 0.8 cos
8π(2 − 7) OP
15 N 15 15 15 15 Q
= 0.04

When n = 3 ; h(3) =
1 LM
1 + 2 cos
2π(3 − 7)
+ 2cos
4π(3 − 7)
+ 2cos
6π(3 − 7)
+ 0.8 cos
8π(3 − 7) OP
15 N 15 15 15 15 Q
= 0.0122

When n = 4 ; h(4) =
1 LM
1 + 2 cos
2π(4 − 7)
+ 2cos
4π(4 − 7)
+ 2cos
6π(4 − 7)
+ 0.8 cos
8π(4 − 7) OP
15 N 15 15 15 15 Q
= −0.0914

When n = 5 ; h(5) =
1 LM
1 + 2 cos
2π(5 − 7)
+ 2cos
4π(5 − 7)
+ 2cos
6π(5 − 7)
+ 0.8 cos
8π(5 − 7) OP
15 N 15 15 15 15 Q
= −0.0181

When n = 6 ; h(6) =
1 LM
1 + 2 cos
2π(6 − 7)
+ 2cos
4π(6 − 7)
+ 2cos
6π(6 − 7)
+ 0.8 cos
8π(6 − 7) OP
15 N 15 15 15 15 Q
= 0.3130

When n = 7 ; h(7) =
1 LM
1 + 2 cos
2π(7 − 7)
+ 2cos
4π(7 − 7)
+ 2cos
6π(7 − 7)
+ 0.8 cos
8π(7 − 7) OP
15 N 15 15 15 15 Q
= 0 . 52
When n = 8, h(8) = h(15 – 1 – 8) = h(6) = 0.3130
Using symmetry condition
When n = 9, h(9) = h(15 – 1 – 9) = h(5) = –0.0181 h(N – 1 – n) = h(n)
When n = 10, h(10) = h(15 – 1 – 10) = h(4) = –0.0914
Chapter 6 - FIR Filters 6. 82
When n = 11, h(11) = h(15 – 1 – 11) = h(3) = 0.0122
When n = 12, h(12) = h(15 – 1 – 12) = h(2) = 0.04
When n = 13, h(13) = h(15 – 1 – 13) = h(1) = –0.0019
When n = 14, h(14) = h(15 – 1 – 14) = h(0) = –0.0141
The transfer function H(z) of the filter is given by Z-transform of h(n)
N − 1 14
∴ H(z) = Z h(n) = l q ∑ h(n) z −n
= ∑ h(n) z−n
n = 0 n = 0

= h(0) + h(1) z −1 + h(2) z−2 + h(3) z−3 + h(4) z −4 + h(5) z−5 + h(6) z−6 + h(7) z−7

+ h(8) z−8 + h(9) z−9 + h(10) z−10 + h(11) z−11 + h(12) z−12 + h(13) z−13 + h(14) z−14

= h(0) + h(1) z −1 + h(2) z−2 + h(3) z−3 + h(4) z −4 + h(5) z−5 + h(6) z−6 + h(7) z−7

+ h(6) z−8 + h(5) z−9 + h(4) z−10 + h(3) z−11 + h(2) z−12 + h(1) z−13 + h(0) z−14

= h(0) 1+ z−14 + h(1) z −1 + z−13 + h(2) z−2 + z−12 + +h(3) z−3 + z−11 Using symmetry
condition
+ h(4) z−4 + z −10 + h(5) z−5 + z−9 + h(6) z−6 + z−8 + h(7)z−7 h(N – 1 – n) = h(n)

= −0.0141 1+ z −14 − 0.0019 z −1 + z−13 + 0.04 z−2 + z−12 + 0 .0122 z−3 + z−11

− 0.0914 z−4 + z−10 − 0.0181 z−5 + z −9 + 0.3130 z −6 + z−8 + 0.52 z−7

Structure

Y(z)
Let , H(z) = = −0.0141 1+ z−14 − 0.0019 z−1 + z−13 + 0.04 z −2 + z −12
X(z)
+ 0.0122 z−3 + z−11 − 0.0914 z−4 + z −10 − 0.0181 z−5 + z−9

+ 0.3130 z−6 + z −8 + 0.52 z−7

∴ Y(z) = −0.0141 X(z) + z −14 X(z) − 0.0019 z −1X(z) + z −13 X(z) + 0.04 z −2X(z) + z −12 X(z)

+ 0.0122 z −3 X(z) + z −11 X(z) − 0.0914 z −4 X(z) + z −10 X(z) − 0.0181 z −5 X(z) + z −9 X(z)

+ 0.3130 z −6 X(z) + z −8 X(z) + 0.52 z −7 X(z)

The above equation can be used to draw the FIR filter structure as shown in fig 1.
−1 −2 −3 −4 −5 −6 −7
−1
z X(z) z X(z) z X(z) −1
z X(z) −1
z X(z) −1
z X(z) −1 z X(z)
−1 −1
z z z z z z z

+ + + + + + +
−7
z X(z)
−1 −1 −1 −1 −1 −1 −1
−14
z z −12
z −11
z −10
z −9
z −8
z
−13
z X(z) z X(z) z X(z) z X(z) z X(z) z X(z) z X(z)

−1 −2 −3 −4 −5 −6 −7
−0.0141 × [X(z) −0.0019 × [z X(z) 0.04 × [z X(z) 0.0122 × [z X(z) −0.0914 × [z X(z) −0.0181 × [z X(z) 0.3130 × [z X(z) 0.52z X(z)
−14 −13 −12 −11 −10 −9 −8
+z X(z)] +z X(z)] +z X(z)] +z X(z)] +z X(z)] + z X(z)] + z X(z)]
+ + + + + + +
F ig 1 .
6. 83 Digital Signal Processing
Frequency Response
When impulse response is symmetric and N is odd with centre of symmetry at (N – 1)/2 the magnitude
response |H(ejww )| is given by |A(w
w )|,
N−1
2
N−1 N−1
where, A(ω ) = h e j ∑ 2h e
2
+
n=1
2 j
− n cos ωn Refer table 6.2 case (i)

7
∴ A(ω ) = h(7) + ∑ 2h b7 − ng cos ωn
n=1

= h(7) + 2h(6) cos ω + 2h(5) cos 2ω + 2h(4) cos 3ω + 2h(3) cos 4ω


+ 2h(2) cos 5ω + 2h(1) cos 6ω + 2h(0) cos 7ω
= 0.52 + 2 × 0.3130 cos ω + 2 × − 0.0181cos 2ω + 2 × − 0.0914 cos 3ω
+ 2 × 0.0122 cos 4ω + 2 × 0.04 cos 5ω
+ 2 × − 0.0019 cos 6ω + 2 × − 0.0141cos 7ω
= 0.52 + 0.626 cosω − 0.0362 cos 2ω − 0.1828 cos 3ω + 0.0244 cos 4ω
+ 0.08 cos 5ω − 0.0038 cos 6ω − 0.0282 cos 7ω

Using the above equation, the magnitude response A(w) and magnitude function |H(ejw )| are calculated for
various values of w and listed in table 1. Using these values the magnitude response is plotted as shown in fig 2.

w ) and |H(ejww )| for various values of w


Table 1: A(w
w A(w
w) |H(ejww )| = A(w
w) w A(w
w) |H(ejww )| = A(w
w)
0 ×π 17 × π
16
0.9994 0.9994 16
0.0014 0.0014
1× π 18 × π
16
1.0032 1.0032 16
–0.0067 0.0067
2× π 19× π
16
1.0009 1.0009 16
–0.0009 0.0009
3× π 20 × π
16
0.9856 0.9856 16
0.0020 0.0020
4× π 21 × π
16
0.9909 0.9909 16
–0.0061 0.0061
5× π 22× π
16
1.0323 1.0323 16
0.0497 0.0497
6× π 23× π
16
1.0360 1.0360 16
0.2542 0.2542
7× π 24 × π
16
0.8900 0.8900 16
0.5844 0.5844
8 ×π 25× π
16
0.5844 0.5844 16
0.8900 0.8900
9× π 26 × π
16
0.2542 0.2542 16
1.0360 1.0360
10 × π 27 × π
16
0.0497 0.0497 16
1.0323 1.0323
11× π 28 × π
16
–0.0061 0.0061 16
0.9909 0.9909
12× π 29 × π
16
0.0020 0.0020 16
0.9857 0.9857
13× π 30 × π
16
–0.0009 0.0009 16
1.0009 1.0009
14× π 31× π
16
–0.0067 0.0067 16
1.0032 1.0032
15× π 32× π
16
–0.0014 0.0014 16
0.9994 0.9994
16 × π
16
0.0094 0.0094
Chapter 6 - FIR Filters
|H (e jω)|
1.2

1.1

1.0

0.9

0.8

0.7

0.6

0.5

0.4

0.3

0.2

0.1

0 π 2π 3π 4π 5π 6π 7π 8π 9π 10π 11π 12 π 13 π 14 π 15π 16 π 17 π 18 π 19π 20π 21π 22 π 23π 24 π 25 π 26π 27 π 28π 29 π 30π 31π
16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16
( π)

F ig 2 : M a g n itud e resp o nse of F IR .

6. 84
6. 85 Digital Signal Processing
Alternate Method for Frequency Response

e j
Frequency response, H e jω = H ( z)
z = e jω

e j = −0.0141 1 + z
∴He jω −4
− 0.0019 z −1 + z −13 + 0.04 z −2 + z −12 + 0. 0122 z −3 + z −11

− 0.0914 z −4 + z −10 − 0.0181 z −5 + z −9 + 0.3130 z −6 + z −8 + 0.52 z −7


z = e jω

− j14ω − jω − j13ω − j2 ω − j12ω


= − 0.0141 1 + e − 0.0019 e +e + 0.04 e +e + 0.0122 e − j3ω + e − j11ω

− 0.0914 e − j4ω + e − j10ω − 0.0181 e − j5ω + e − j9 ω + 0.3130 e − j6ω + e − j8ω + 0.52 e − j7 ω

= − 0.0141 − 0.0141 cos14ω − j sin 14ω − 0.0019 cos ω − j sin ω + cos13ω − j sin 13ω + 0.04 cos 2ω − j sin 2ω + cos12ω − jsin 12ω

+ 0.0122 cos 3ω − j sin 3ω + cos11ω − j sin 11ω − 0.0914 cos 4ω − j sin 4ω + cos10ω − j sin 10ω

− 0.0181 cos5ω − j sin 5ω + cos 9ω − j sin 9 ω + 0.3130 cos 6ω − j sin 6ω + cos8ω − j sin 8ω + 0.52 cos 7ω − j sin 7ω

= [ − 0.0141− 0.0141cos14ω − 0.0019 cos ω − 0.0019 cos13ω + 0.04 cos2ω + 0.04 cos12ω + 0.0122 cos3ω + 0.0122 cos11ω

− 0.0914 cos4 ω − 0.0914 cos10ω − 0.0181 cos5ω − 0.0181cos 9ω + 0.3130 cos 6ω + 0.3130cos8ω + 0.52 cos 7ω ]

+ j[0.0141 sin14ω + 0.0019 sin ω + 0.0019 sin13ω − 0.04 sin 2ω − 0.04 sin 12ω − 0.0122 sin 3ω − 0.0122 sin11ω

+ 0.0914 sin 4ω + 0.0914 sin10ω + 0.0181sin 5ω + 0.0181 sin 9ω − 0.3130 sin 6ω − 0.3130 sin 8ω − 0.52 sin 7ω ]
Using the above equation the frequency response H(ejw ) and magnitude function |H(ejw )| are calculated for various values of w and listed in
table 2. It is observed that the magnitude response obtained in both the methods are same.

Table 2: H(ejww ) and |H(ejww )| for various values of w


w H(ejww ) |H(e jww )| w H(ejww ) |H(e jww )|
0× π 17 × π
0.9994 + j0 0.9994 –0.0002 + j0.0015 0.0015
16 16
1× π 18 × π
0.1956 – j0.9839 1.0031 –0.0062 – j0.0027 0.0067
16 16
2×π 19 × π
–0.9247 – j0.3828 1.0000 0.0006 + j0.0009 0.0010
16 16
3× π 20 × π
–0.5476 – j0.8196 0.9857 0 + j0 0
16 16
4×π 21 × π
0.7006 + j0.7006 0.9907 0.0051 – j0.0035 0.0061
16 16
5× π 22 × π
0.8582 – j0.5735 1.0321 0.0191 + j0.046 0.0498
16 16
6× π 23 × π
–0.3964 – j0.9571 1.0359 0.2495 – j0.0497 0.2544
16 16
7×π 24 × π
–0.8728 + j0.1736 0.8898 0 – j0.5844 0.5844
16 16
8×π 25 × π
0 + j0.5844 0.5844 –0.8728 – j0.1736 0.8898
16 16
9×π 26 × π
0.2495 + j0.0497 0.2544 –0.3964 + j0.9571 1.0359
16 16
10 × π 27 × π
0.0191 – j0.046 0.0498 0.8582 + j0.5735 1.0321
16 16
11 × π 28 × π
0.0051 + j0.0035 0.0061 0.7006 – j0.7006 0.9907
16 16
12 × π 29 × π
0 + j0 0 –0.5476 – j0.8196 0.9857
16 16
13 × π 30 × π
–0.0006 – j0.0009 0.0010 –0.9247 + j0.3828 1.0000
16 16
14 × π 31 × π
–0.0062 + j0.0027 0.0067 0.1956 + j0.9839 1.0031
16 16
15 × π 32 × π
–0.0002 – j0.0015 0.0015 0.9994 + j0 0.9994
16 16
16 × π
–0.0009 + j0 0.0009
16
Chapter 6 - FIR Filters 6. 86
Example 6.10
Design a linear phase FIR lowpass filter with a cutoff frequency of 0.5p
|H d (e jω)|
rad/sample by taking 11 samples of ideal frequency response.
Solution
The magnitude response of ideal lowpass filter is shown in fig 1. The
desired frequency response Hd(ejw ) of linear phase FIR lowpass filter with cutoff
frequency of 0.5p rad/sample is given by,
ω
Hd (ejω ) = e− jαω ; 0 ≤ ω ≤ 0.5π and 1.5π ≤ ω ≤ 2π 0 0.5π π 1.5π 2π

=0 ; 0.5π < ω < 1.5π


F ig 1 : Id e al m ag n itu d e
resp on se o f F IR lo w p a ss filter.
N − 1 11− 1
where, α = = =5
2 2
The DFT sequence H(k) is obtained by sampling Hd(ejw ) at 11 equidistant frequency points in a period of 2p.
The 11 frequencies for type-1 design are given by,

ω k = 2πk = 2πk ; for k = 0 to 10


N 11
2π × 0 2π × 6
When k = 0 ; ω k = = 0 When k = 6 ; ω k = = 1.09π
11 11
2π × 1 2π × 7
When k = 1 ; ω k = = 0.18π When k = 7 ; ω k = = 1.27π
11 11
2π × 2 2π × 8
When k = 2 ; ω k = = 0.36π When k = 8 ; ω k = = 1.45π
11 11
2π × 3 2π × 9
When k = 3 ; ω k = = 0.55π When k = 9 ; ω k = = 1.64π
11 11
2π × 4 2π × 10
When k = 4 ; ω k = = 0.73π When k = 10 ; ω k = = 1.82π
11 11
2π × 5
When k = 5 ; ω k = = 0.91π
11

From the above calculations the following observations can be made.

For k = 0 to 2, the samples lie in the range 0 £ w £ 0.5 p

For k = 3 to 8, the samples lie in the range 0.5p < w < 1.5 p

For k = 9 to 10, the samples lie in the range 1.5p £ w < 2p

The sampling points on the ideal frequency response are shown in fig 2. The magnitude of samples of H(k)
(Magnitude spectrum) are shown in fig 3.


|H d (e )| |H (k )|

ω k
0 π 2π 3π 4π 5π 6π 7π 8π 9π 10π 0 1 2 3 4 5 6 7 8 9 10
11 11 11 11 11 11 11 11 11 11 F ig 3 : M a g n itu de spe ctru m o f H (k ).
F ig 2 : S a m p lin g p o ints o f H d (e jω).
6. 87 Digital Signal Processing
Based on the above discussions, the equation for DFT coefficients H(k) can be written as shown below.
2πk
− j5×
H(k) = Hd (e jω ) = e− jαω k = e 11 ; for k = 0, 1, 2
ω = ωk

=0 ; for k = 3 to 8
2πk
− j5×
= e− jαω k = e 11 ; for k = 9, 10

The samples of impulse response, h(n) are given by,

LM N − 1
2 LM OPOP
j2πnk
1 Using equation(6.76).
h(n) =
N
MM
H(0) + 2 ∑ ReMH(k) e PPP N

MN k = 1 N QPQ
1 LM L OPOP
5 j2πnk
= H(0) + 2 ∑ ReMH(k) e 11
11 M MN PQPQ
N k = 1

1 LM L OPOP
2 2πk j2πnk
− j5 × H(0) = 1
= 1 + 2 ∑ ReMe e 11 11
11 M MN PQPQ
N k = 1

1 LM L OOP
2 j2πk
(n − 5)
= 1 + 2 ∑ Re Me 11 P
11 M MN PQPQ
N k = 1

=
1 L
M L
1 + 2 ReMe
j2π
11
OP + 2 ReLMe
(n − 5)
j4π
11
OPOP
(n − 5)

11 M
N MN PQ MN PQPQ
1 L 2π(n − 5) 4π(n − 5) O e jθ = cos θ + j sin θ
11 MN 11 PQ
= 1 + 2 cos + 2 cos
11 ∴ Re[e jθ ] = cos θ

N−1
Here, N = 11, \ N – 1 = 10, 2
= 5.

Hence calculate h(n) for n = 0 to 10.

Since, h(n) satisfies the symmetry condition h(N – 1 – n) = h(n) with centre of symmetry at (N – 1)/2, calculate
h(n) for n = 0 to to 5.

When n = 0 ; h(0) =
LM
1
1 + 2 cos
2π(0 − 5)
+ 2cos
4π(0 − 5) OP
= 0.0694
11N 11 11 Q
1 L 2π(1 − 5) 4π(1 − 5) O
11 MN 11 PQ
When n = 1 ; h(1) = 1 + 2 cos + 2cos = −0.054
11

1 L 2π(2 − 5) 4π(2 − 5) O
When n = 2 ; h(2) =
11 NM 1 + 2 cos
11
+ 2cos
11 PQ
= −0.1094

1 L 2π(3 − 5) 4π(3 − 5) O
11 MN 11 PQ
When n = 3 ; h(3) = 1 + 2 cos + 2cos = 0.0474
11

1 L 2π(4 − 5) 4π(4 − 5) O
When n = 4 ; h(4) =
11 NM 1 + 2 cos
11
+ 2cos
11 PQ
= 0.3194

1 L 2π(5 − 5) 4π(5 − 5) O
11 MN 11 PQ
When n = 5 ; h(5) = 1 + 2 cos + 2cos = 0.4545
11
Chapter 6 - FIR Filters 6. 88
When n = 6 ; h(6) = h(11 – 1 – 6) = h(4) = 0.3194

When n = 7 ; h(7) = h(11 – 1 – 7) = h(3) = 0.0474 Using symmetry


condition
When n = 8 ; h(8) = h(11 – 1 – 8) = h(2) = –0.1094
h(N – 1 – n) = h(n)
When n = 9 ; h(9) = h(11 – 1 – 9) = h(1) = –0.054

When n =10 ; h(10) = h(11 – 1 – 10) = h(0) = 0.0694

The transfer function H(z) of the filter is given by Z-transform of h(n).


N − 1 10
∴ H(z) = Z h(n) = l q ∑ h(n) z −n
= ∑ h(n) z−n
n = 0 n = 0
Using symmetry
= h(0) + h(1) z −1 + h(2) z−2 + h(3) z−3 + h(4) z−4 + h(5) z−5 condition
h(N – 1 – n) = h(n)
+ h(6) z−6 + h(7) z −7 + h(8) z −8 + h(9) z−9 + h(10) z−10

= h(0) + h(1) z−1 + h(2) z−2 + h(3) z−3 + h(4) z −4 + h(5) z−5

+ h(4) z−6 + h(3) z−7 + h(2) z−8 + h(1) z−9 + h(0) z−10

= h(0) 1+ z−10 + h(1) z−1 + z −9 + h(2) z−2 + z−8 + h(3) z−3 + z−7

+ h(4) z−4 + z−6 + h(5) z−5

= 0.0694 1+ z−10 − 0.054 z−1 + z −9 − 0.1094 z−2 + z−8 + 0.0474 z−3 + z−7

+ 0.3194 z−4 + z−6 + 0.4545 z−5

Structure

Y(z)
Let , H(z) = = 0.0694 1+ z−10 − 0.054 z−1 + z −9 − 0.1094 z−2 + z−8
X(z)
+ 0.0474 z−3 + z −7 + 0.3194 z −4 + z−6 + 0.4545 z−5

∴ Y(z) = 0.0694 X(z) + z−10 X(z) − 0.054 z−1X(z) + z−9 X(z) − 0.1094 z −2X(z) + z−8 X(z)

+ 0.0474 z−3 X(z) + z−7 X(z) + 0.3194 z−4 X(z) + z −6 X(z) + 0.4545 z −5 X(z)

The above equation can be used to draw the FIR filter structure as shown in fig 1.
−1 −2 −3 −4 −5
−1
z X(z) z X(z) −1
z X(z) −1
z X(z) z X(z)
−1 −1
z z z z z

+ + + + +

−1 −1 −1 −1 −1
−10
z z −8
z −7
z z
−9 −6
z X(z) z X(z) z X(z) z X(z) z X(z)

−1 −9 −2 −8 −3 −7 −4 −6 −5
0.0694[X(z) + z −10 X(z)] −0.054[z X(z) + z X(z)] −0.1094[z X(z) + z X(z)] 0.0474 [z X(z) + z X(z)] 0.3194 [z X(z) + z X(z)] 0.4545z X(z)

+ + + + +
F ig 1 .
6. 89 Digital Signal Processing
Frequency Response
When impulse response is symmetric and N is odd with centre of symmetry at (N – 1)/2 the magnitude
response |H(ejww )| is given by |A(w
w )|,
N−1
2
N−1 N−1
where, A(ω ) = h e j ∑ 2h e
2
+
n =1
2 j
− n cos ωn Refer table 6.2 case (i)

5
∴ A(ω ) = h(5) + ∑ 2h b5 − ng cos ωn
n=1

= h(5) + 2h(4) cos ω + 2h(3) cos 2ω + 2h(2) cos 3ω + 2h(1) cos 4ω + 2h(0) cos 5ω
= 0.4545 + 2 × 0.3194 cos ω + 2 × 0.0474 cos 2ω + 2 × 0.1094 cos 3ω
+ 2 × − 0.054 cos 4ω + 2 × 0.0694 cos 5ω
= 0.4545 + 0.6388 cosω + 0.0948 cos 2ω + 0.2188 cos 3ω − 0.108 cos 4ω
+ 0.1388 cos 5ω

Using the above equation, the magnitude response A(w) and magnitude function |H(ejw )| are calculated for
various values of w and listed in table 1. Using these values the magnitude response is plotted as shown in fig 2.

w ) and |H(ejww )| for various values of w


Table 1: A(w
w A(w
w) |H(ejww )| = A(w
w) w A(w
w) |H(ejww )| = A(w
w)
0 ×π 17 ×π
16
1.0001 1.0001 16
–0.0559 0.0559
1×π 18 ×π
16
0.9874 0.9874 16
0.0682 0.0682
2×π 19×π
16
0.9748 0.9748 16
0.1294 0.1294
3× π 20 × π
16
1.0048 1.0048 16
0.0542 0.0542
4 ×π 21 ×π
16
1.0707 1.0707 16
–0.1019 0.1019
5×π 22×π
16
1.0911 1.0911 16
–0.1873 0.1873
6 ×π 23×π
16
0.9623 0.9623 16
–0.0710 0.0710
7 ×π 24 × π
16
0.6521 0.6521 16
0.2517 0.2517
8 ×π 25×π
16
0.2517 0.2517 16
0.6521 0.6521
9 ×π 26 ×π
16
–0.0710 0.0710 16
0.9623 0.9623
10 ×π 27 ×π
16
–0.1873 0.1873 16
1.0911 1.0911
11× π 28 × π
16
–0.1019 0.1019 16
1.0707 1.0707
12×π 29 × π
16
0.0542 0.0542 16
1.0048 1.0048
13×π 30 × π
16
0.1294 0.1294 16
0.9748 0.9748
14 ×π 31×π
16
0.0682 0.0682 16
0.9874 0.9874
15× π 32× π
16
–0.0559 0.0559 16
1.0001 1.0001
16 ×π
16
–0.1175 0.1175
Chapter 6 - FIR Filters
|H (e jω)|
1.2

1.1

1.0

0.9

0.8

0.7

0.6

0.5

0.4

0.3

0.2

0.1

0 π 2π 3π 4π 5π 6π 7π 8π 9π 10π 11π 12 π 13 π 14 π 15π 16 π 17 π 18 π 19π 20π 21π 22 π 23π 24 π 25 π 26π 27 π 28π 29 π 30π 31π
16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16
( π)

F ig 2 : M a g n itud e resp o nse of F IR L o w p a ss filter.

6. 90
6. 91 Digital Signal Processing
Alternate Method for Frequency Response

e j
Frequency response, H e jω = H ( z)
z = e jω

e j = 0.0694 1 + z
∴He jω −10
− 0.054 z −1 + z −9 − 01094
. z −2 + z −8 + 0. 0474 z −3 + z −7

+ 0.3194 z −4 + z −6 + 0.4545 z −5
z = e jω

= 0.0694 1 + e − j10ω − 0.054 e − jω + e − j9ω − 01094


. e − j2 ω + e − j8ω + 0.0474 e − j3ω + e − j7 ω

+ 0.3194 e − j4 ω + e − j6ω + 0.4545 e − j5ω

= 0.0694 + 0.0694 cos10ω − j sin 10ω − 0.054 cos ω − j sin ω + cos 9ω − j sin 9ω

− 01094
. cos 2ω − j sin 2ω + cos8ω − j sin 8ω + 0.0474 cos 3ω − j sin 3ω + cos 7ω − j sin 7 ω

+ 0.3194 cos 4ω − j sin 4ω + cos 6ω − j sin 6ω + 0.4545 cos5ω − j sin 5ω

= [ 0.0694 + 0.0694 cos10ω − 0.054 cos ω − 0.054 cos 9ω − 0.1094 cos2ω − 0.1094 cos8ω + 0.0494 cos3ω + 0.0474 cos 7ω
+ 0.3194 cos4 ω + 0.3194 cos 6ω + 0.4545cos5ω]
+ j[ −0.0694 sin10ω + 0.054 sin ω + 0.054 sin 9ω + 01094
. sin 2ω + 0.1094 sin 8ω − 0.0474 sin 3ω − 0.0474 sin 7ω
− 0.3194 sin 4ω − 0.3194 sin 6ω − 0.4545 sin 5ω ]

Using the above equation the frequency response H(ejw ) and magnitude function |H(ejw )| are calculated for various values of w and listed in
table 2. It is observed that the magnitude response obtained in both the methods are same.

Table 2: H(ejww ) and |H(ejww )| for various values of w


w H(ejww ) |H(e jww )| w H(ejww ) |H(e jww )|
0× π 17 × π
1.0001 + j0 1.0001 0.0311 – j0.0466 0.0560
16 16
1× π 18 × π
0.5486 – j0.821 0.9874 0.0261 + j0.063 0.0681
16 16
2×π 19 × π
–0.373 – j0.9006 0.9747 0.1269 + j0.0253 0.1293
16 16
3× π 20 × π
–0.9855 – j0.1959 1.0047 0.0383 – j0.0382 0.0540
16 16
4×π 21 × π
–0.757 + j0.757 1.0705 0.0199 + j0.1 0.1019
16 16
5× π 22 × π
0.2128 + j1.0701 1.0910 0.1731 + j0.0717 0.1873
16 16
6× π 23 × π
0.889 + j0.3681 0.9621 0.0591 – j0.0394 0.0710
16 16
7×π 24 × π
0.5421 – j0.3622 0.6519 0 + j0.2517 0.2517
16 16
8×π 25 × π
0 – j0.2517 0.2517 0.5421 + j0.3622 0.6519
16 16
9×π 26 × π
0.0591 + j0.0394 0.0710 0.889 – j0.3681 0.9621
16 16
10 × π 27 × π
0.1731 – j0.0717 0.1873 0.2128 – j1.0701 1.0910
16 16
11 × π 28 × π
0.0199 – j0.1 0.1019 –0.757 – j0.757 1.0705
16 16
12 × π 29 × π
0.0383 + j0.0382 0.0540 –0.9855 + j0.1959 1.0047
16 16
13 × π 30 × π
0.1269 – j0.0253 0.1293 –0.373 + j0.9006 0.9747
16 16
14 × π 31 × π
0.0261 – j0.063 0.0681 0.5486 + j0.821 0.9874
16 16
15 × π 32 × π
0.0311 + j0.0466 0.0560 1.0001 + j0 1.0001
16 16
16 × π
0.1175 + j0 0.1175
16

You might also like