LMS IMPLEMENTATION OF ADAPTIVE NOISE CANCELLATION Jayakumar, Vno Dpartmnt of Elctrcal Engnrng Unvrsty of Flora ABSTRACT Rcntly, svral rsarch groups hav monstrat that stochastc grant algorthms can b ffctvly us as an aaptv algorthm. On of th practcal applcatons of ths s th smplf mplmntaton of aaptv nos cancllaton. In ths papr, a comparson s ma btwn th prformancs of Last-man-squar (LMS) algorthm, Wnr-Hopf soluton an th batch LMS algorthm. Th LMS algorthm blongs to th famly of stochastc grant algorthms, whl th Wnr-Hopf soluton uss a trmnstc grant n th computaton of th optmal fltr for th stochastc nputs. Exprmntal rsults confrm th mrts of aaptv fltrng wth LMS algorthm ovr optmum fltrng whch uss th soluton prov by Wnr-Hopf quatons. Kywors: Aaptv nos cancllaton, LMS, Wnr. INTRODUCTION Aaptv sgnal procssng has bn an actv fl of rsarch vr snc th ponrng work of Wrow an Hoff []. It has bn succssfully appl to channl qualzaton an cho cancllaton. Ths papr scusss th Aaptv nos cancllaton usng LMS algorthm an Wnr-Hopf soluton. Th applcatons of Aaptv nos cancllaton hav vast applcatons rangng from Wrlss Communcaton to Bomcal Engnrng [2] [3]. A typcal nos cancllr s shown n fgur. Th prmary sgnal contans both th sr sgnal an th nos. Th rfrnc sgnal contans only th nos. It s assum that th nos n rfrnc sgnal s corrlat to that n prmary. If th statstcs of th sgnal ar known bforhan, an optmum fltr can b sgn accorng to th Wnr-Hopf quatons. Th rawback of ths approach s that, for hgh fltr orrs th computaton of Corrlaton matrx (R) of th stochastc nputs s cumbrsom. Furthrmor, n th ral worl th sgnals nput to th fltr ar not statonary. An altrnat soluton woul b to us th nstantanous stmats of corrlaton matrx (R) an cross-corrlaton matrx (P). Hnc th wghts of th fltr can aapt as th charactrstcs of th Prmary (n) Rfrnc u(n) Aaptv Fltr Fgur.Aaptv nos cancllr Sgnal changs. Th LMS algorthm uss ths prncpl [4]. 2. OPTIMUM FILTERING (n) In optmum fltrng th M tap wghts n th FIR fltr s fx. Ths mtho assums that th rfrnc sgnal s statonary. Ths fltr stmats th prmary sgnal wth rror (n). For th fltr to b optmum, th rror has to b orthogonal to vry lmnt n th nput vctor u(n). E[u(n-k) o *(n)] =, k=,,2 M () Ths s call th prncpl of orthogonalty. Th rror obtan s optmum, hnc th subscrpt o. Th corrsponng optmum wght tracks ar w o,w o 2,..w o M. Th soluton for th wght tracks can b foun out by rwrtng th abov quaton as, E[u(n-k) (*(n) - w o u*(n- ) ) ] =,k=,,2..m (2) Expanng an rarrangng trms, w o E[u(n-k) u*(n-)]=e[u(n-k) *(n)],k=,,2..m (3) Now, th trm on th lft han s of th xprsson s th autocorrlaton of prmary sgnal at lag (-k) an th scon trm s th cross-corrlaton btwn th prmary an th sr sgnal.
R-wrtng (3), w o r(-k) = p (-k) (4) W can xprss th abov quaton n th form of matrx w o = R - p (5) Th abov quaton s th Wnr-Hopf soluton for th optmum tap wght s to obtan th mnmum man squar rror. Hnc th corrlaton matrx R has to b known bforhan, whch s mpossbl f th nput s non-statonary. Furthrmor th calculaton of R - s cumbrsom for vry hgh orrs. Ths pavs way to th LMS algorthm whch ovrcoms th abov rawbacks. 3. ADAPTIVE FILTERING USING LMS ALGORITHM Th LMS algorthm smplfs th procur by takng th nstantanous stmats for R an p. R(n)=u(n)u H (n) (6) p(n)=u(n)*(n) (7) Hnc, th nstantanous stmat of grant s, J(n)= -2u(n) *(n) + 2 u(n) u H (n) w(n) (8) Th nw rcursv rlaton for upatng th tap-wght vctor s, w(n+)=w(n) + µ u(n) *(n) (9) Whl aaptng th wghts, th stp sz µ has to b chosn proprly so that th algorthm convrgs. It s foun that th stp sz shoul b wthn an (2/ λ max ) to nsur convrgnc. λ max s th maxmum gn valu n th corrlaton matrx R. Sp of convrgnc can b sgnf by a paramtr call avrag tm constant τ =/2 µλ max. Th mol for th mplmntaton of th LMS algorthm s shown n fgur 2. Snc th spch an th nos ar uncorrlat, th bst stmat of th sr sgnal wll b nos an th output rror sgnal (n) s spch. Effct of lakag has to b takn nto account bcaus th prsnc of spch n th rfrnc sgnal wll caus som spch to b cancll out lang to poor rproucton of th spch sgnal. Th us of stmat ntroucs grant nos. Small stp sz kps th grant nos n chck to an xtnt. Upatng th wghts ovr a tm pro so that th stmats ar foun ovr that tm pro, known as batch mo gvs a smoothr larnng curv. Corrsponngly ths wll tak a longr tm to convrg snc thr ar lssr upats. Fgur 2.Mol for aaptv fltrng wth LMS Algorthm. 4. EXPERIMENTAL RESULTS In ths scton, xprmntal rsults obtan from Optmum fltrng, LMS algorthm (onln an batch mo) wll b prsnt. 4. Data Z - Two mcrophons wr us to rcor th prmary an th rfrnc sgnals. Th prmary sgnal contans th spch corrupt by nos. Th rfrnc sgnal contans only th nos. All th ata ar sampl at 2 Hz. On of th mcrophons was mov causng th ata to b nonstatonary. 4.2 OPTIMUM FILTERING In ths mtho th ntr ata squnc of rfrnc sgnal s us to calculat th autocorrlaton matrx R. Th tap wghts assum nglgbl valus aftr fltr orr M=3, hnc th M=3 s us n th furthr analyss of th Wnr-Hopf solutons. An gn valu spra of 2.9* 5 was obtan. Th mnmum man-squar rror prouc by th fltr can b trmn by th followng xprsson, J mn = σ 2 w o H R w o () For a fltr orr of M=3, ths was trmn to b.323. Th prformanc of th Wnr-Hopf soluton can b gratly mprov by trmnng th nstant at whch th mcrophon was mov, splt th rfrnc sgnal nto Z - W (n) W 2 (n) W M (n) (n) (n)
two at that poston an fn th par of optmum tap wght vctors for th two sgnals. An accurat rproucton of spch can b obtan by concatnatng th two rror sgnals obtan by th par of optmum fltrs. Th nstant at whch th mcrophon s mov can b trmn by xamnng th wght tracks n th LMS algorthm. Ths wll b scuss n th nxt scton. ) J (7 x -4.5 9.5.5 9 8.5.5 8 2 25 3 35 4 45 Fltr Orr (M) u p lt m A -.5 - -.5-2 2 3 4 5 6 7 x 4 Fgur 4. J ( ) Vs orr (M) From th fgur 4 th optmum fltr orr s c to b M=3. Th tm at whch th mcrophon s mov can b trmn by xamnng th wght tracks. Snc th tap wghts aapt contnuously, th non-statonary pont wll b pct by th mark chang n th avrag valu of th tap as thy ha towars th nw optmum soluton..5.5 u p lt m A.5 w 3 -.5 2 3 4 5 6 7 8. x 4 w 6 -. 2 3 4 5 6 7 8.5 x 4 w 9 -.5 2 3 4 5 6 7 8.2 x 4 -.5-2 3 4 5 6 7 x 4 Fgur 3. Spch rproucton (a) th ntr rfrnc sgnal us to calculat R (b) rfrnc sgnal splt at nstant mcrophon s mov. Th abov agrams show th nhrnt lmtaton n th Optmum mtho of fltrng, wth th frst fgur showng a coars rproucton of spch. Ths s bcaus th soluton assums that th sgnal s statonary. Th quotaton rcovr s I wll not conon a cours of acton that wll la us to war 4.3 LMS ALGORITHMS In ths algorthm nstantanous stmats of R an p ar us to upat th wght tracks. Hnc th LMS algorthm works ffcntly n a non-statonary nvronmnt. Unlk th Optmum fltrng mtho, Excssv numbr of wghts wll la to poor prformanc u to th malajustmnts n th nvual wghts. w w 3 -.2 2 3 4 5 6 7 8. x 4 -. 2 3 4 5 6 7 8 x 4 Fgur 5. Tap wght tracks. Th tap wghts show a mark ffrnc n thr path of aaptaton at 467 th sampl,. at 2.22 scons from th nstant at whch th rcorng starts. Th stp sz s an mportant paramtr whl mplmntng LMS algorthm. Th uppr boun on th stp sz ( µ max ) s gvn by, µ max = 2 /(M*S max ) () M=fltr orr S max = maxmum valu of powr spctral nsty of tap For fltr orr M=3, th maxmum powr spctral Dnsty of tap nputs s trmn to b 7.6 an th maxmum stp sz s calculat to b aroun.4
2 3 4 5 6 7 4.8 p ltu m a h c S p 2-2 -4-6 x 4.5 k c tra t W gh.7.6.5.4.3 w t w gh -.5.2. - 2 3 4 5 6 7 x 4 Fgur 6. Stp sz=.5 (a) Spch (b) Tap wght Th fgur 6 shows th nstablty of spch an wght track at stp sz.5. Hnc xprmntal rsults match thortcal prctons..4.2 5 5 2 25 Tm (scons) Fgur 9. Tap wght track for Batch mo Whn th prmary an rfrnc sgnals ar ntrchang, th man squar rror J (7) s ruc to.25. Orgnally MSE J (7) was masur as.2. Ths rsult suggsts that th transfr functon to mol th nos from rfrnc sgnal to th prmary has mor pols than zros. Avrag tm constant s trmn to b 8.87. ) (J r ro a r qu s m an.8.6.4.2 Batch mo Onln mtho 5 5 2 25 Tm (scons) METHOD STEP SIZE MINIMU M MSE WEINER-HOPF 3.323 LMS NORMAL 3.2 INTERCHANGE D 3.25 Fgur 7. Larnng curvs for LMS (batch an onln Mo, µ =.8) Th fgur 7 shows that th larnng curv for th batch mo convrgs mor slowly. Ths s bcaus th wghts ar upat lss rgularly. Th larnng curv ma to convrg fastr by ncrasng th stp.8.7.6.5 ) o r r (J.4 a r qu s.3 M an.2. 5 5 2 25 Tm (scons) Fgur 8. Larnng curv for batch mo ( µ =.2) 5. CONCLUSION From th smulat rsults w can conclu that LMS onln mo tranng s th bst mtho for nos cancllaton. On th ntllgblty of th spch, LMS onln mo prforms bttr than th Wnr-Hopf soluton bcaus th tap wghts aapt to th sgnal statstcs. LMS batch mo wll show goo rsults f rpat pochs of ata ar run through th fltr. 6. REFERENCES [] Wrow B. an Starns S.D Aaptv sgnal procssng. Prntc-Hall, Englwoo Clffs, N.J 7632, 985. [2] V. Zarzoso, J. Mllt-Rog an A. K. Nan, Ftal ECG Extracton from Matrnal Skn Elctros Usng Bln Sourc Sparaton an Aaptv Nos Cancllaton Tchnqus, n: Computrs n Carology, Vol. 27, Boston, MA, Sptmbr 24-27, 2, pp. 43-434. [3] J.C Lbrt, T.S. Rappaport, J.G Proaks, Evaluaton of Svral Aaptv Algorthms for Cancllng Acoustc Nos n Mobl rao Envronmnts, Proc. Of Vhcular Tchnology Conf., pp. 26-32, 99. [4] Smon Haykn, Aaptv Fltr Thory, 4 th ton, Prntc Hall, Nw Jrsy, 22.