You are on page 1of 11

FINITE IMPULSE RESPONSE FILTERS

4.1 General 'Considerations.


4.1.1. Introduction
The term filter is commonly used to describe a device that discriminates,
according to some attribute of the objects applied at its input, what passes through
it. A linear time-invariant system also performs a type of discrimination or filterin
among the vanous trequency components at Its mput. The nature ot thIS filtering
action is determined by the frequenc res onse characteristics '00 which in turn
f ! f
depends on the choice of the system parameters (e.g. e coefficients aj and bj in
the difference equation characterization of the system). That is, H (aiw) for an Mth
order LTI system can be ~tten as,
. - jw - jMw
_iw- b 0 + b1 e + ... + b Me
H (10 J = . " 1 (4.1)
1 + al e-Jw +... + aM e-Ju (:)
~
Thus, by p'ro er selection of t e coefficients, we can design frequency selective
filters that pass signals with freq;.;rmcy compo nts in some bands while they
attenuate signals containing frequency components in other frequency bands.

. In general, ~..in.variant syste~~dlfies the ~nput signal spectrum


X (e1w)according to it fr.¥quencyresponse H (CJw},Eo..yield a!l output signal with
~pect!u~. Y (~(ij)-==_f!
(ei~) . X (eiw).In Ii sense, H (aiw)acts as a weighting function or
a spectral shaping function to the different frequency components in the input signals.
Thus, any linear time-invariant system can be considered to be a frequency shaping
filter, even though it may not necessarily completely block any or all frequency
components. Consequently, the terms ''linear time-invariant system" and "filter" are
-
synonymous and are often use-d mterchangeablY. -. --~
We use the term filter to describe a linear time-invariant lIystem used to perform
spectral shaping or frequency selective filtering. Filtering is used in digital signal
proceaaing in a variety of ways. For example, removal of undersirable noise from
desired signals, ~ctral shaping such as equali;,:;ationof commumcatl0n ChannelS and
f\)r performing spectral analysis of &ign~s and so on. ~

is, theAn~t charac~nstl~of


~deal filter outpuf IS si.mPy aand('!layed
ideal filter
and isama linear aae rea
ItU ,e acaled ODse.That
version of the
iuput ~iU:i\ pure delayIS usually tole.rable-and is not consideredas distortion of
Nelfuer'ii ~mp1ii\lde~
tho ~6Ym.!I1.. 8caliUjI.Therefore, idear miera have a linear phase
characteristice wliliin tneir pasaband. that ia,
108 FINITE IMPULSE RESPONSE FILTERS

8 (ro)=-1:(1J (4.2)
of dela Hence,

(4.3)
1: (ro)=_d8(ro)
g dro
"'-- .
1:g(ro) is usually called the envelope delay or the gouP del~ of the filter. We interpret
1:g(ro) as the time delay that a signal component 01 ~quency ro undergoes as it
passes from the input to the output of the system.

When, 8 (ro) is linear, then 1:g(ro)= 1:= constant. In this case, all frequency
components of the input signal undergo the same time delay.
In conclusion, ideal filters have a constant magnitude characteristic and a linear
phase characteristic within their passband. In all cases, such filters are not physically
realizable but serve as a mathematical idealization of practical filter. For examples,
the ideal lowpass filter with frequency response characteristic,
oi""
HIe' )-
I; I ro I :s;roc
, - { 0 ; elsewhere
. has the impulse response,
roc
7t ; n=O
h n = . (4.4)
() ro SIDro n
...£. ~ ; n;t 0
! 7t rocn
A plot of h (n) is illustrated in Fig 4.1.
h(n)

-. ro/1C

0 n

Fig. 4.1. Impulse response of ideal lowpass filter.

It is clear that the ideal lowpass filter's impulse response h (n) is not causal
and it is not absolutely summable and therefore it is also unstable. Consequently,
this filter is physically unrealizable.
One possible solution is to introduce a large delay no in h (n) and arbitrarily to
set h (n) = 0 for n < no. However, the resulting system no longer has an ideal frequency
response characteris~. Indeed, if we set h (n)..=O,~ no, the Fourier series
expansion of H (eiOJ)results in the Gibb's pheE?~n~Jn2 ~s will be described in Section
4.2.2.

Causality implies that the frequency response characteristic H (ei"') of the filter
cannot be zero, except at a finite set of points in the frequency range. In addition,
H (ei"') cannot have an infmitely sharp cutoff from passband to stop band, that is,
H (eiOJ)cannot drop from unity to zero abruptly. Alt!tough the freque!lcy response
charr..ctcristics p~s~ed by ideaL filters m~' be desi1:apl~ th~~n~t. absolutely
necessary in mosty~co.tic;;al applicatiQ!l:;;..If we relax these conditions, it is possible
to reahze caU:sarfilters that approximate the ~ as closely as we desire. In
;u.ticular, it is~;;'ot ;ss;';Y to ~rstthat the m~de I
H (;;161) 1 be constant in
the entire passband of the filter. A small amount of ripple in the passband, as
illustrated in Fig 4.2 is usually tolerable.

IH (e"")I
.J_------ 0, - Passband ripple
Passband
ripple -
02 Stopband ripple
.~
We - Passband
1 - 0, r-----y-----\ edge frequency
Transition band
I

y ells- Stopband
I
I
I edge frequency
I
Passband I Stopband

02

W
Wp OJ,; 1t

Fig. 4.2 Magnitude characteristics of physically realizable filter.

Similarly, it is not necessary for the filter response I


H (eiOJ) to be zero in the
stopband. A small, non-zero value or a small amount of ripple m the stopband is
J

also tolerable. Based on these specifications viz, O},02, Wpand ws' we can select the
i i
parameter 1 aj ! and bj in the frequency response characteristic, given by Eqn (4.1),
which best approximates the desired specification. .

Design Issues:

The general processes of designing a digital filter involves the following four
steps:
110 FINITE IMPULSE RESPONSE FILTERS

1. Solve the approximation problem to determine filter coefficients that satisfy


performance specification. .

2. Choose a specific structure in which the filter will be realized, and quantize
the resulting filter coefficients to a fixed word length.
3. Quantize the digital filter variables, that is, input, output and intermediate
variable word lengths.
4. Verify by simulation that the resulting design meets given performance
specifications.
The results of step 4 generally lead to revisions in steps 2 and 3 in order to
meet the given specifications.
In particular, we shall consider finite impulse response (FIR) filters, whose
input-output difference equation is,
N-I
Y (n) = L
j=O
bj x (n - i) (4.5)

'I;he main objective of this ,£hapter is to introduce simple but effective methods for
designing FIR filters, that is, procedures for obtaining the coefJicients j bi!' so that
the resulting transfer function,
H (z) =b 0+ b I z- I + b 2 z- 2 + ...+ b N I Z eN- - - 1)
approximates the desired response.
4.1.2. Fill filters: Merits and Demerits
The system of causal FIR filter is of the form,
N-I
H (z) = L h (n) z- n (4.6)
n..O

That is, H (z) is a pol/nomiLil in z-I of degree' N -1. Thus, H (z) has (N -1) zeros
that can be located any where in the z.plane h1Jd iN -11 pflles, .1\11of which lie
at z=O.
There are many advantages with FIR filterll. They arl!:
L t ,,~
II" t '''.
~ '.
1. FIR filters with exactly linear phase CII" 1>(\easily do!!ilmed. Linear phase
filters are important for applicationa whu.,; frequf;fic;;' dispersion due to
nonlinear phase is harmful. (e.g) speech procei!sing and data transmission.
2. Efficient realization. of FIR filters exist!! Illi both recur~ive and non-recursive
structures.
3. FIR f1lters realized non-recursively, that is, by direct convolution are always
d~. -

4. Round off noise, which is inherent in realizations with finite precision


arithmetic, can easily be made small for non-recursi"e realization of FIR
filters.

5. FIR filters can be efficiently implemented in multirate DSP system.


6. FIR filters are suitable for implementation through fast Fourier transform
(FFT) algorithms which reduces the computation complexity and processing
time.

Among the possible disadvantages of FIR filters are:


1. A large value of N, the impulse response samples, is required to adequately
approximate sharp cut off FIR filters. Hence a large amount of processing is
required to realize such filters when via slow convolution.
2. The delay of linear phase FIR filters need not always be an integer number
of samples. This nonintegral delay can lead to problems in some signal
processes applications.

4.1.3. Properties of FIR filters


Linear Phase Response:
The frequency response of a non-recursive causal filLer is given by,
1'-1
H (~(")=
n=O
I h (n) e-jOJn (4.7)

= I H (~O)) I ei9(0))

where I H (ei"') I = -VRe2: H (e1~ '.+ 1m2 j H (ei~ r


is the magnitude response, and

e{oo)=tan-1Im H(ei~f
. Re H (J~ ~

{:lthe phase response of H (ei"\


The phase and group delays of the filter are given by,

-'p-- - eU) «(I)


an
d - -
';:--
de (00)
dw '

respe<:tively.
112 FINITE IMPULSE RESPONSE FILTERS

For linear (constant) phase delay as well as group delay the phase response
must be linear, that is,

e(oo)=-'too; -1t<00<1t.

where 't is a constant phase delay in samples. Thus, ~ter for which 'tn and 't" a~
constant, that is, independent of frequency are referred to as constant time-delay Q[
Ifmear phase filters'.

Therefore,
N-1
- L h (n) sin om
n=O
e (oo)=-'t 00= tan-1 N-1 (~~
L h (n) cos oon
n=O

consequently,
N-1
L h (n) sin oon
n=O
tan ('t (0) = N- 1
L h (n) cos oon
n=O

and accordingly,
N-1
L h (n) (cas oon . sin 00't - sin oon . cos 00't) =0
n=O

N -1
or L h (n) sin (00 't - oon)= O.
n=O

It can be shown that a solution to this equation is given by,

N 1
(4.8)
~ :n) ~ : (N - 1 - n) for 0::; n ::;N - 1 j

Therefore, FIR filters can have constant phase and group delays if the Eqn (4.8) is
satisfied. That is, it is only necessary for the impulse response to be symmetrical

about the midpoint between samples, N; 2 and ¥ for even N or about sample
DIGITAL SIGNAL PROCESSING 113

N;..!. for odd N. The required symmetry is illustrated in Fig 4.3 for
N = 10 and N = 11.

h(n)
Centre of symmetry

0 9 n

I
,
h(n) I
:Centre of symmetry
I
,
I
I
I
I

0 2 ,5 10 n
I
I
I
I
I ~
I J
(b)N:11 and t:5 "'- ~
Fig. 4.3. Impulse response for constant phase and group delay l' yv"
(a) even N (b) odd N. ~
In many applications only the group delay need be constC'hich case the
phase response of H (ei"') is a piece-wise linear funct~, that is,
0(00)= ~-1: 00

where ~ is a constant. On using the above procedure a second-class of constant delay

non recursive filters can be obtained with ~= :!:~, the solution is,

N -1
1:=-
2
and h (n) = - h (N - 1- n) ; O$n$N-1 14.9)

Filters that satisfy Eqn (4.9) again have a delay of N; 1 samples but their impulse
--responses are anti-symmetric about the centre of the sequence, as illustrated in
Fig. 4.4.
114 . FINITE IMPULSE RESPONSE FILTERS

i
h(n) :I -- Centreofsymmetry
I
I
I
r
I
r
I
r
I 5

t-rI
9
I
I
I
I
I
(a) N z 10 and . ~ 4.5

I
I
h(n)
: -- Centre of symmetry
I
I
I
I
I
I
I
I

10 n

Fig. 4.4. Alternative impulse response for constant phase


and group delay: (a) even N (b) odd N.
In summary, depending on the value of N (odd or even), and the type of
symmetry of the filter impulse response sequence (symmetric or anti-symmetric),
there are four possible types of linear phase FIR fllters.
Frequency Response:
Eqns (4.8) and (4.9) lead to some simple expressions for the frequency response of
linear phase FIR filters. For symmetrical impulse response with ~ odd, the frequency
response
Eqn(4.7)canbeexpressedaS,
-- - - -. - - ~- -
eN- 3)/2 N N- 1
H(ei"')= L
n;O
h(n)e-jom+h
( ) N;l e-j",eN-l)/Z + L
N+l
h(n)e-jroo (4.10)
n;-
2

By using Eqn (4.8) and then letting N - 1 - n = m, m = n, the last summation in the
above equation can be expressed as,
N-l N-l
L h (n) e-jron = L h (N - 1- n) e-jom
N+ 1 N+t
n;~ n;~

eN- 3)/2 (4.11)


L h (n) e- jro eN- 1 - n)
n=O
~
Now from Eqns (4.10) and (4.11) I
V 4
Ir ( ,. . , (N - 3)/2
eN- 1) (N- 1) J
H(ei"')=e-jro(N-1)/2~1
lL
h
\.
'-;,;1
)] +2:
n=O
[
h(n) eiro~-n+e-jro::-z--n~
)

. , -, J
r ,
! N-1
(N - 3)/2 -
N -1
=e-.1ro(N-LI2'lhl~) + n~o 2h(n)Cos( (O( z- )-n) ]
N -1
and hence" with ~ - n = k, we have,
(N - 1)/2
H (ei"')= e- jro(N-1)/2'-r aKcos(OK (4,2)
k=O
IV';
where, f'/--' ., ~ l'

h
N-1 / -2 'I

ao=
(
~ ) .
(N-1 /' r
...., . ~: ~ ':io0
aK=2hl Z--K )
.
I
... - ,..,

Similarly, the frequency response for the case of symmetrical impulse response
with N even and for the two cases of anti-symmetrical response, can be simplified
to the expression summarised in Table 4,l.

Table 4.1. Frequency response of constant.delay FIR filters.

h (n) N H (eiro)
odd (N - 1)/2
e-j",(N -1)/2 L aK cos (OK
Symmetrical k=O

even N/2

e-jro(N-1)/2 1(~1 bKCOS[ (O( K-~ ) ]


, IN - 1) -] " (N - 1)/2
odd e- J [~ (J) - ,j
2
L.., aK sm (0K
K= 1
.

Anti-symmetrical (N - 1)
[
-j ro--1r/2 "
1 N/2 1
[
'

even J L.., b Ksm K


e 2 (0 -'2
K=l ( )]
N-l N-l N
whereao=h
( ) z- ; aK=2h
( Z--K
);bK=2h
( ]
"2-K
It is clear that the magnitude of H (ei(l!)for the above four cases are purely real
and can be expressed in terms of the impulse response coefficients h (n). It should
be noted that for even-N and symmetrical h (n) case, at 00= 1t, the magnitude of
H (ei(l!),that is, TH (ei(l!Jl is ~zero, indep~nde;-t of h (n). TIns implies that filters with
a frequency resp?ns~that is non-zero at (jj;: n: ~e.g-: a high pass filter) cannot be
satisfactorily approximated with t.'lis type of filter.

Similarly. for odd-N and anti symmetrical h(n). case, at 00=0 and
J
00= 1t, H (ei(l!>J=0, independent of h (n). Furthermore, the factor ei 2t/2 = j, shows the
1'rEfquency responSe to bEnmaglnary to within a linear phase factor. Thus, this case
of fHters is most suitable for f;uch filters as Hilbert transformers and differentiators.

For the last case, that Is, even-N and anti symmetry also, at 00= 0, I H (ei(l!) = 0 and I

there is th;-phase factor ~1!72. Thus, this class of fIlters is also most suitable for
approximating such filters as differentiators and Hilbert transformers.

Consequently, we would not use the anti symmetry condition in the design of

-
a lowpass linear-phase FIR filter. On the other hand, the symmetry condition yields
a linear phase FIR filter with a non-zero response at 00= 0
- --
4.2. Design Techniques
--
.4.2.1. Fourier Series Method

This is a straight forward method which utilizes the fact that the steady-state
transfe.r function (or frequency response) of a discrete-time filter is a periodic function
'wm1period oo~ \\~h~is the angular sampling frequency. From the Fourier series
an~.1X~!~we know that any periodic function'can be expressed as a linear combination
of complex ~xpcnentials. Therefore, the desired frequency response of a discrete time'
filter can be represented by.the Fourier series as,

H (ei~ = I h (n) e-j(l!nT (4.13)


n=-~

where T is the sampling period. The Fourier series coefficients or impulse response
-
samples ot therilter can be -obtained using the formula,

~r2 -
h (n) = ~ J' H (ei~ ei(l!nTdoo (4.14)
l
4.
S -(I! /2

clearly if we wish to re lize this ;er wi~ -:-~Uls: response h (n), then, it must

Eqn
~
truncation
-
have-a-nIDte number of coefficients. To this end, we use a finite number of h (n) in
(4.14), which equivalent to truncating the
leads to an approximation
. infiiilte e>..-p'ansionof Eqn .(4.13). This
of H (eI~ which we denote by Ha (eI(I!).That is,
M

Ha(eiUJ)= L h(n)e-jUJnT (4.15)


n=-M

1""-- - -- - -
, where M is a finite positive integer, and we choose M = N; 1 in order to keep 'N'
number of samples with the impulse response sequence. As we have already seen
-
h (n) is a 'sinc' function ancf"Sowe h'7:1ve,
h (n) = h ( - n)
Now the transfer function
, - - - of au FIR filter can be written
--_. as,
M

HI (z) = L h (n) z- n (4,16)


n=.::M
However, this FIR fi1ter is not physically rea:izable, due to the presence of positive
po\yers of Z, means that the filter must produce an output that is advanced in time
with respect to the input. This difficulty can be overcome by introducing a delay
N- 1 - - - ---
M =
--- z- samples. To this end, we defme the transfer function,

H (z) = z-~! HI (z) '4.17)

. -M- N-1 '


h h I
were t e term z ---d
mtro uce a -dl - -f z-
e ay 0 samp es at tne output.

Substitution of Eqn ('U6) in (4.17) leads to,


-- -- M
H (z) = z-~! L h (n) z-n (4.18)
n=-M
which yields,

H (z) = hi - M) zO+ h (- M + 1) z-l +... + h (M) z- 2M


Let, bi = h (i - M) and h (- n) = h (n), we obtain,
2M
H (z) = L
j=O
bj z - i (4.19)

to be the transfer function of a discrete-time filter that- is_physically realizable.


From Eqn (4.19) it is appare~t- tiat the-FIR filter, we have obtained has the
following properties.
1. It has (2M + 1 =N) impulse response coefficients, bj, 0::; i ::;2M.
2. The impulse response is symmetric about bM as illustrated in Fig 4.5 for the
case M = ;r.-
--

You might also like