dsp digital signal processing module ii part1

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 depends on the choice of the system parameters (e.g. e coefficients aj f and ! bj fin the difference equation characterization of the system). That is, H (aiw) for an Mth order LTI system can be ~tten as, . b b - jw b -jMw _iw- 0+ 1e + ... + Me H (10 J = . " 1 1 + al e-Jw +... + aM e-Ju (:) (4.1) ~ 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. ~ An~t charac~nstl~of an ideal filter is a linear aae rea ODse.That is, the ~deal filter outpuf IS si.mPy a d('!layed and am ItU ,e acaled version of the iuput ~iU:i\ pure delayIS usually tole.rable-and is not consideredas distortion of tho ~6Ym.!I1.. Nelfuer'ii ~mp1ii\lde~ 8caliUjI. Therefore, idear miera have a linear phase characteristice wliliin tneir pasaband. that ia,

Upload: aravind

Post on 18-Nov-2014

702 views

Category:

Documents


0 download

DESCRIPTION

A property of MVG_OMALLOORDSP MODULE IIFINITE IMPULSE RESPONSE FILTERS

TRANSCRIPT

Page 1: DSP Digital Signal Processing MODULE II PART1

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 throughit. A linear time-invariant system also performs a type of discrimination or filterinamong the vanous trequency components at Its mput. The nature ot thIS filteringaction is determined by the frequenc res onse characteristics '00 which in turndepends on the choice of the system parameters (e.g. e coefficients aj fand !bj finthe difference equation characterization of the system). That is, H (aiw) for an Mthorder LTI system can be ~tten as,

.b b - jw b - jMw

_iw- 0 + 1 e + ... + MeH (10 J = . " 1

1 + al e-Jw +... + aM e-Ju (:)(4.1)

~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 theyattenuate signals containing frequency components in other frequency bands.

. In general, ~..in.variant syste~~dlfies the ~nput signal spectrumX (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 ora 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 shapingfilter, even though it may not necessarily completely block any or all frequencycomponents. Consequently, the terms ''linear time-invariant system" and "filter" aresynonymous and are often use-d mterchangeablY. --~- -.

We use the term filter to describe a linear time-invariant lIystem used to performspectral shaping or frequency selective filtering. Filtering is used in digital signalproceaaing in a variety of ways. For example, removal of undersirable noise fromdesired signals, ~ctral shaping such as equali;,:;ationof commumcatl0n ChannelS andf\)r performing spectral analysis of &ign~s and so on. ~

An~t charac~nstl~of an ideal filter is a linear aae rea ODse.Thatis, the ~deal filter outpuf IS si.mPy a d('!layed and am ItU ,e acaled version of theiuput ~iU:i\ pure delayIS usually tole.rable-and is not consideredas distortion oftho~6Ym.!I1..Nelfuer'ii ~mp1ii\lde~8caliUjI.Therefore, idear miera have a linear phasecharacteristice wliliin tneir pasaband. that ia,

Page 2: DSP Digital Signal Processing MODULE II PART1

108 FINITE IMPULSE RESPONSE FILTERS

8 (ro)=-1:(1J (4.2)

of dela Hence,

1: (ro)=_d8(ro)g dro"'-- .

1:g(ro) is usually called the envelope delay or the gouP del~ of the filter. We interpret1:g(ro) as the time delay that a signal component 01 ~quency ro undergoes as itpasses from the input to the output of the system.

When, 8 (ro) is linear, then 1:g(ro)= 1:= constant. In this case, all frequencycomponents of the input signal undergo the same time delay.

In conclusion, ideal filters have a constant magnitude characteristic and a linearphase characteristic within their passband. In all cases, such filters are not physicallyrealizable but serve as a mathematical idealization of practical filter. For examples,the ideal lowpass filter with frequency response characteristic,

oi""

{

I; I ro I:s;rocHIe' )-

, - 0 ; elsewhere

(4.3)

. has the impulse response,

!

roc7t

h n = .() ro SIDro n

...£. ~7t rocn

A plot of h (n) is illustrated in Fig 4.1.

; n=O(4.4)

; n;t 0

h(n)

-. ro/1C

A

n0

Fig. 4.1. Impulse response of ideal lowpass filter.

It is clear that the ideal lowpass filter's impulse response h (n) is not causaland it is not absolutely summable and therefore it is also unstable. Consequently,this filter is physically unrealizable.

Page 3: DSP Digital Signal Processing MODULE II PART1

One possible solution is to introduce a large delay no in h (n) and arbitrarily toset 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 Section4.2.2.

Causality implies that the frequency response characteristic H (ei"') of the filtercannot 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 responsecharr..ctcristics p~s~ed by ideaL filters m~' be desi1:apl~ th~~n~t. absolutelynecessary in mosty~co.tic;;al applicatiQ!l:;;..If we relax these conditions, it is possibleto reahze caU:sarfilters that approximate the ~ as closely as we desire. In

;u.ticular, it is~;;'ot ;ss;';Y to~rstthat the m~de IH (;;161)1 be constant inthe entire passband of the filter. A small amount of ripple in the passband, asillustrated in Fig 4.2 is usually tolerable.

02

Wp OJ,; 1t

0, -Passband ripple

02 - Stopband ripple.~

We - Passbandedge frequency

ells- Stopbandedge frequency

W

Fig. 4.2 Magnitude characteristics of physically realizable filter.

Similarly, it is not necessary for the filter response IH (eiOJ)J to be zero in thestopband. A small, non-zero value or a small amount of ripple m the stopband isalso tolerable. Based on these specifications viz, O},02, Wpand ws' we can select the

parameter 1 aj ! and ibj iin 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 foursteps:

IH (e"")I

.J_------Passband

ripple

1 - 0, r-----y-----\Transition band

I

yIII

PassbandI

StopbandI

Page 4: DSP Digital Signal Processing MODULE II PART1

110 FINITE IMPULSE RESPONSE FILTERS

1. Solve the approximation problem to determine filter coefficients that satisfyperformance specification. .

2. Choose a specific structure in which the filter will be realized, and quantizethe resulting filter coefficients to a fixed word length.

3. Quantize the digital filter variables, that is, input, output and intermediatevariable word lengths.

4. Verify by simulation that the resulting design meets given performancespecifications.

The results of step 4 generally lead to revisions in steps 2 and 3 in order tomeet the given specifications.

In particular, we shall consider finite impulse response (FIR) filters, whoseinput-output difference equation is,

N-I

Y (n) = L bj x (n -i)j=O

(4.5)

'I;he main objective of this ,£hapter is to introduce simple but effective methods fordesigning FIR filters, that is, procedures for obtaining the coefJicients j bi!' so thatthe resulting transfer function,

H ( ) b b - I b - 2 b -eN-1)z = 0+ I z + 2 z + ...+ N-I Z

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- nn..O

(4.6)

That is, H (z) is a pol/nomiLil in z-I of degree' N -1. Thus, H (z) has (N -1) zerosthat can be located any where in the z.plane h1Jd iN -11 pflles, .1\11of which lie

at z=O. L t ,,~ ~ '.There are many advantages with FIR filterll. They arl!: II" t '''.

1. FIR filters with exactly linear phase CII" 1>(\easily do!!ilmed. Linear phasefilters are important for applicationa whu.,; frequf;fic;;' dispersion due tononlinear phase is harmful. (e.g) speech procei!sing and data transmission.

Efficient realization. of FIR filters exist!! Illi both recur~ive and non-recursivestructures.

2.

Page 5: DSP Digital Signal Processing MODULE II PART1

3. FIR f1lters realized non-recursively, that is, by direct convolution are alwaysd~. -

4. Round off noise, which is inherent in realizations with finite precisionarithmetic, can easily be made small for non-recursi"e realization of FIRfilters.

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 processingtime.

Among the possible disadvantages of FIR filters are:

1. A large value of N, the impulse response samples, is required to adequatelyapproximate sharp cut off FIR filters. Hence a large amount of processing isrequired to realize such filters when via slow convolution.

2. The delay of linear phase FIR filters need not always be an integer numberof samples. This nonintegral delay can lead to problems in some signalprocesses 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 (~(")= I h (n) e-jOJnn=O

(4.7)

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

where I H (ei"') I =-VRe2: H (e1~ '.+ 1m2 j H (ei~ ris the magnitude response, and

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

{:lthe phase response of H (ei"\

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

- - - e«(I) d - - de (00)'p- U) an ';:-- dw '

respe<:tively.

Page 6: DSP Digital Signal Processing MODULE II PART1

112 FINITE IMPULSE RESPONSE FILTERS

For linear (constant) phase delay as well as group delay the phase responsemust 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,

e (oo)=-'t 00= tan-1

N-1

- L h (n) sin omn=O

N-1

L h (n) cos oonn=O

(~~

consequently,

N-1

L h (n) sin oonn=O

tan ('t (0)= N - 1

L h (n) cos oonn=O

and accordingly,

N-1

L h (n) (cas oon . sin 00't - sin oon . cos 00't) =0n=O

or

N -1

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

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

Therefore, FIR filters can have constant phase and group delays if the Eqn (4.8) issatisfied. 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

Page 7: DSP Digital Signal Processing MODULE II PART1

DIGITAL SIGNAL PROCESSING 113

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

h(n)

Centre of symmetry

0 9 n

h(n)

I,I

:Centre of symmetryI,IIII

,5IIIII ~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 2 10 n

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 -11:=-2

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

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 inFig. 4.4.

Page 8: DSP Digital Signal Processing MODULE II PART1

114 . FINITE IMPULSE RESPONSE FILTERS

h(n)i:-- CentreofsymmetryIIIIrIrIr

I 5

t-rIIIIII

(a) N z 10 and . ~ 4.5

9

h(n)II

: -- Centre of symmetryIIIIIIII

10 n

Fig. 4.4. Alternative impulse response for constant phaseand group delay: (a) even N (b) odd N.

In summary, depending on the value of N (odd or even), and the type ofsymmetry of the filter impulse response sequence (symmetric or anti-symmetric),there are four possible types of linear phase FIR fllters.

FrequencyResponse:

Eqns (4.8) and (4.9) lead to some simple expressions for the frequency response oflinear phase FIR filters. For symmetrical impulse response with ~ odd, the frequencyresponseEqn(4.7)canbeexpressedaS,-- - - -. - - ~- -

eN- 3)/2 N N - 1

H(ei"')= L h(n)e-jom+h (N;l )e-j",eN-l)/Z + L h(n)e-jroo (4.10)n;O N+l

n;-2

By using Eqn (4.8) and then letting N - 1 - n = m, m = n, the last summation in theabove equation can be expressed as,

N-l N-l

L h (n) e-jron = L h (N - 1- n) e-jomN+ 1 N+t

n;~ n;~

eN- 3)/2

L h (n) e- jro eN- 1 - n)n=O

(4.11)

Now from Eqns (4.10) and (4.11)~

IV 4

Page 9: DSP Digital Signal Processing MODULE II PART1

Ir ( ,. . ,

)]

(N - 3)/2

[ eN- 1) (N- 1) J)

H(ei"')=e-jro(N-1)/2~1 h '-;,;1 +2: h(n) eiro~-n+e-jro::-z--n~lL \. n=O

r , (N - 3)/2 -

]

. , -, J ! N - 1 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(OKk=O

where,

h(

N-1

)ao= ~(N-1

)aK=2hl Z--K .

(4,2)

/f'/--' ., ~-2

IV';l''I

/'.

~r... . : ~ ':io0.,I... - ,..,

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

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

h (n) N H (eiro)

odd

Symmetrical

even

odd

(N - 1)/2

e-j",(N -1)/2 L aK cos (OKk=O

N/2

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

(N - 1)/2,

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

[ (N - 1) 1 N/2

[ ( )]-j ro--1r/2

J" b

'

K1

e 2 L.., Ksm (0 -'2K=l

(N-l

) (N-l

) (N

]whereao=h z- ; aK=2h Z--K ;bK=2h "2-K

Anti-symmetricaleven

Page 10: DSP Digital Signal Processing MODULE II PART1

It is clear that the magnitude of H (ei(l!)for the above four cases are purely realand can be expressed in terms of the impulse response coefficients h (n). It shouldbe 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 witha frequency resp?ns~that is non-zero at (jj;: n: ~e.g-: a high pass filter) cannot besatisfactorily approximated with t.'lis type of filter.

Similarly. for odd-N and anti symmetrical h(n). case, at 00=0 and

00= 1t,JH (ei(l!>J=0, independent of h (n). Furthermore, the factor ei 2t/2 = j, shows the1'rEfquency responSe to bEnmaglnary to within a linear phase factor. Thus, this caseof 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!) I = 0 andthere is th;-phase factor ~1!72. Thus, this class of fIlters is also most suitable forapproximating such filters as differentiators and Hilbert transformers.

Consequently, we would not use the anti symmetry condition in the design ofa lowpass linear-phase FIR filter. On the other hand, the symmetry condition yieldsa 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-statetransfe.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 seriesan~.1X~!~we know that any periodic function'can be expressed as a linear combinationof 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 responsesamples ot therilter can be -obtained using the formula,-

4.~r2-

lh (n) = ~ J' H (ei~ ei(l!nTdoo (4.14)

S -(I! /2

clearly if we wish to re lize this ;er wi~ -:-~Uls: response h (n), then, it musthave-a-nIDte number of coefficients. To this end, we use a finite number of h (n) inEqn (4.14), which equivalent to truncating the infiiilte e>..-p'ansionof Eqn (4.13). This~ - . .truncation leads to an approximation of H (eI~ which we denote by Ha (eI(I!).That is,

Page 11: DSP Digital Signal Processing MODULE II PART1

M

Ha(eiUJ)= L h(n)e-jUJnTn=-M

(4.15)

, where M is a finite positive integer, and we choose M = N; 1 in order to keep 'N'1""-- - - - - - -number of samples with the impulse response sequence. As we have already seenh (n) is a 'sinc' function ancf"Sowe h'7:1ve,

h (n) = h ( - n)

Now the transfer function of au FIR filter can, - - - --_.

M

HI (z) = L h (n) z- nn=.::M

However, this FIR fi1ter is not physically rea:izable, due to the presence of positivepo\yers of Z, means that the filter must produce an output that is advanced in timewith 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,

be written as,

(4,16)

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

h h . -M- d dl fN-1 I '

were t e term z mtro uce a e ay 0 z- samp es at tne output.

'4.17)

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

-- -- M

H (z) =z-~! Ln=-M

h (n) z-n (4.18)

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 bj z- ij=O

(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 thefollowing properties.

1.

2.

It has (2M + 1=N) impulse response coefficients, bj, 0::; i ::;2M.

The impulse response is symmetric about bM as illustrated in Fig 4.5 for thecase M = ;r.-

--