Anda di halaman 1dari 11

9.5. Finite Impulse Response (FIR) Filters Suppose I have the following signal x ( t ) = sin ( 2 f1t ) + 0.5sin ( 2 f 2t ) f1 = 20 Hz , f 2 = 80 Hz (9.5.

1)

I am told that the 80 H signal is disto!tion and must "e filte!ed out. #ne solution is to $ust ta%e the &ou!ie! t!ansfo!m, not'h out the 'omponent at 80 H , and ta%e the inve!se &ou!ie! t!ansfo!m. If I am told this has to "e a time domain ope!ation, I will $ust ta%e the inve!se &ou!ie! t!ansfo!m of H, the fun'tion I used as m( filte! in the f!e)uen'( domain, and get h, a time domain filte! that I 'an used to 'onvolve the input (&ig. 2.1).

&igu!e 9.5.1. S'hemati' design of an &I* filte!. If a + domain filte! 'an "e found that does what is wanted, the inve!se &&, will give a sampled time-domain filte! that 'an "e 'onvolved with input to achieve the desired filtering. .nfo!tunatel(, the h[k] that I got e/tends infinitel( in time and has !ipples that will 'ause me disto!tion (&ig. 9.5.2).

9.5 &I* &ilte!s

&igu!e 9.5.2. (a) ,he input /0%1 'onsists of two sinusoids. (") ,he &&, of /0%1 shows the spi%es at 20 and 80 H . (') 2 s)ua!e filte! H is used to eliminate the f!e)uen'( 'omponent at 80 H . (d) 3( ta%ing the inve!se &&, of the filte!ed signal 45H67, onl( the wanted signal at 20 H !emains. (e) ,he h0%1 o"tained "( ta%ing the inve!se &&, of H( ) e/tends too fa! and has too man( !ipples. Suppose I ta%e a 'ompletel( diffe!ent app!oa'h. I8ll $ust guess at the time-domain filte! I want and see if that does the t!i'%. 2s a sta!ting point, suppose I $ust ave!aged ove! a few points, as shown in &ig. 9.5.9. :oo%ing at the input x(t), ave!aging ove! 10 ms fo! instan'e, would sta!t smoothing ove! the high f!e)uen'( !ipples. ;ell, that wo!%ed, "ut ma("e not as well as I had hoped. It attenuated the high f!e)uen'( "ut did not get !id of it. In fa't I 'an get a little insight into the !eason "( ta%ing the &&, of x(t) and plotting it with the &&, of h(t). It seems the!e a!e !ipples in the f!e)uen'( domain of h(t) that allow some of the !ipple to pass.

9.5 &I* &ilte!s

&igu!e 9.5.9. 2 time domain digital filte! of 10 points gives slightl( "ette! !esults. (0%1 is o"tained "( 'onvolving /0%1 and h0%1. In &ig. 9.5.9 I o"tained the output y[k] "( 'onvolving the input /0%1 with the filte! h0%1 $ust using the <2,:23 'ommand = y=conv(h,x); (9.5.2) If I am designing a digital filte!, I will p!o"a"l( loo% to implement this with the definition of dis'!ete 'onvolution y0k 1 =
MM 1 m =0

h [ m] x [ k m ] ,

(9.5.9)

whe!e << is the finite length of the filte!. ,he !esult is shown in &ig. 9.5.>. ?oti'e that the implementation !e)ui!es << steps so the!e is an e!!o! on the f!ont and "a'% of the (0%1 !esult.

9.5 &I* &ilte!s

&igu!e 9.5.> ,he 'onvolution of /0%1 and h0%1 'al'ulated f!om the dis'!ete 'onvolution of @). (9.5.9). I 'an ma%e m( h0%1 a little longe!. ,hat p!ett( mu'h gets !id of the !ipple, "ut now it8s attenuating m( main signal (&ig. 9.5.5).

9.5 &I* &ilte!s

>

&igu!e 9.5.5. 2 longe! time domain filte!.

How a"out a t!iangle as the filte!A &igu!e 9.5.B shows that it is an imp!ovement. Its !ipples a!en8t as high. 3ut I still get a little attenuation of the signal. 9.5 &I* &ilte!s 5

&igu!e 9.5.B. 2 t!iangula! filte!.

?ow let us t!( a Hanning h(t) (&ig. 9.5.C). ,his loo%s p!ett( good. I 'an 'ut out the !ipple "ut I onl( attenuate the main signal slightl(. 9.5 &I* &ilte!s B

&igu!e 9.5.C. 2 Hanning window filte!, In a'tualit( I need a"out 25 points to implement this filte!, as shown in &ig. 9.5.8.

&igu!e 9.5.8. 2 25 point Hanning window

,he ne/t )uestion is, what would happen if I onl( wanted the highe! f!e)uen'(. I8d p!o"a"l( want something li%e the Hanning window, "ut I8d li%e it 'ente!ed at a"out 80 H .

9.5 &I* &ilte!s

&igu!e 9.5.9. ,he time domain filte! is a sinusoid at 80 H inside a Hanning window . ,his !e)ui!es a"out 95 points.

&igu!e 9.5.10. ,he 95 point filte! used in &ig. 8. ?ow let8s loo% at the situation whe!e the input is x ( t ) = 0.5sin ( 2 f1t ) + 0.5sin ( 2 f 2t ) + 0.5sin ( 2 f 9t ) f1 = 20 Hz , f 2 = 80 Hz f 9 = 150 Hz (9.5.>)

Suppose we want to ta%e out the 20 H ., and leave the othe! two in ta'%, i.e, a high pass filte!.

9.5 &I* &ilte!s

&igu!e 9.5.11. In o!de! to filte! out the low f!e)uen'( at 20 H without attenuating the highe! f!e)uen'ies, a smooth t!ansition via half a Hanning window is used. In the "ottom too plots, the uppe! and lowe! pa!ts of the time-domain filte! a!e shown. ?oti'e that the filte!ing fun'tion HH was %ind of !igged to eliminate what we didn8t want and %eep what we wanted. I had a half of sine wave that didn8t sta!t until 20 H so I would eliminate the 20 H . 3ut it !ose up fast enough to get the 80 H and the 150 H . ;hen I ta%e the inve!se fft of H , I get the filte! on the "ottom. It has a"out nine non- e!o values h(1) 5 0.89 h(2) 5 -0.11 h(9) 5 -.099 h(>) 5 -0.08C h(5) 5 -0.0C1B h(B) 5 -0.05>8 h(C) 5 -0.0981 h(8) 5 -0.0229 h(9) 5 -0.010 ?oti'e that the sum of these is e!o, !efle'ting the fa't that it should have no d' te!m. 2lso, noti'e that the high end points a'tuall( !ep!esent the negative s(mmet!i' values. 9.5 &I* &ilte!s 9

&igu!e 9.5.12. ,he time-domain 'onvolution using the filte! developed in &ig. 9.5.11. 2 logi'al )uestion is how would we implement one of the time domain filte!s that we have $ust designed. 2s an e/ample, suppose ou! &I* filte! is the simple th!ee-point filte! shown in &ig. 9.5.19 (a). ,he 'onvolution of this filte! with an in'oming digital signal x[k] is y0k 1 = h0n1 x0 k n1 = h001 x0k 1 + h011 x0k 11 + h021 x0k 21 .
n =0 2

(9.5.5)

,his is implemented "( "lo'% diag!am shown in &ig. 9.5.19 (").

(a) 2 th!ee-point &I* filte!.

9.5 &I* &ilte!s

10

(") Ha!wa!e implementation of a 'onvolution of h0%1 of (a) with an


in'oming signal /0%1 (@). (9.5.5)). &igu!e 9.5.19.

Exercises 9.5.1 2ssuming the signal given in @). (9.5.>) design the smallest &I* possi"le that will leave the 80 sine and !emove the othe! two. 9.5.2 *epeat the p!o"lem of 9.5.1, "ut do it in the time domain, i.e, thin% of a time domain filte! h0%1 that (ou thin% would wo!%, and then ta%e the &&, to see if it has the filte!ing !e)ui!ements in the f!e)uen'( domain.

9.5 &I* &ilte!s

11

Anda mungkin juga menyukai