DT Flter Applcato These otes explore the use of DT flters to remove a terferece ( ths case a sgle toe) from a audo sgal. Image that you are the your home recordg studo ad have just recorded what you feel s a perfect take of a gutar solo for a sog you are recordg, ut you dscover that someoe had tured o some eary electroc devce that caused electromagetc radato that was pcked up somewhere the audo electrocs ad was recorded o top of the gutar solo. Rather tha try to recreate ths perfect take you decde that maye you ca desg a flter to remove t. We wll explore two dfferet cases: () a hgh-ptched toe that les aove the sgfcat porto of the gutar sgal s spectrum, ad () a md-ptched toe that les the mddle of the gutar sgal s spectrum. I. Sgal Access ad Explorato. Use MATLAB s wavread commad to load the gutar.wav fle:. Lste to the gutar sgal usg MATLAB s soud commad. 3. Plot the frst secod or so of the sgal the tme doma to see what the sgal looks lke. 4. Look at the gutar sgal the frequecy doma y computg ad plottg ( db) the DFT of varous 6384-pt locks of the gutar sgal. Verfy that the sgfcat porto of the gutar sgal s spectrum les elow 5 kh.
II. Addg A Hgh Frequecy Iterferece. Create a susod whose frequecy s kh that s sampled at the same rate as the gutar sgal ad has the same legth. The ampltude of ths susod should e.. Add ths sgal to the gutar sgal to create the smulated recorded sgal that has the terferece (call ths sgal x_ to dcate that t has a terferece at kh). 3. Lste to the gutar sgal wth terferece usg MATLAB s soud commad. 4. Plot the frst secod or so of the sgal wth terferece ad the sgal wthout terferece. 5. Compute the DFTs of the sgal that has terferece. Verfy that the terferece s outsde the sgfcat porto of the gutar spectrum.
III. Lowpass Flter Desg MATLAB cotas some easy to use routes for desgg FIR flters FIR (fte-mpulse respose) flters do t use ay output feedack therefore they do t really have ay poles ad they wll always e stale. They are the most wdely used type of DT flter practce. 3 3 3 A smple FIR flter: y x x x A more geeral FIR flter: y x Order of Flter They are qute easy to desg usg software-ased tools. We ll use the MATLAB FIR desg routes called remeord.m ad reme.m The commad remeord wll gve a estmate of the FIR flter order eeded to acheve gve specfcatos. The route reme.m wll the gve the requred desg. Here s how we state the flter specfcatos: 3 Lowpass Flter Specfcato δ p H ( ) δ p δ p δ p H ( ) δ s Passad Rpple log ( δ p ) db Stopad Atteuato log ( δ ) s db δ s p s
4 Hghpass Flter Specfcato δ p δ p δ s s p Badpass Flter Specfcato δ p δ p δ s δ s s p p s
5 Badstop Flter Specfcato δ p δ p δ p δ p δ s p s s p. Use the remeord ad reme commads to desg a lowpass flter eeded to acheve: 6 db of atteuato the stopad for the udesred sgal db of passad rpple passad edge at 7kH stopad edge at 9 kh. Look at DFTs to see why 6 db of atteuato s a reasoale choce. Use the MATLAB varale for the vector that holds the FIR flter coeffcets.. Plot the flter s mpulse respose. For a FIR flter t s easy to show that the mpulse respose s othg more tha the coeffcets ts dfferece equato y x
6 3. Compute ad plot the flter s frequecy respose. 4. Make a pole-ero plot for the flter s trasfer fucto. x y H!! ) ( IV. Remove Iterferece wth Flter. Use the desged flter to remove the terferece Flter x_ usg the LPF to get x out y flter(,a,x) flters the data vector x wth the flter descred y vectors a ad to create the fltered data y. The vectors a ad come from the coeffcets the dfferece equato: a x y a a a a a a a For a FIR flter lke we have here the dfferece equato s: x y so the a vector s a
. Assess the performace of the flter: Compare x out, x_, ad x the frequecy doma. Compare x out, x_, ad x the tme doma. Lste to the fltered gutar sgal usg MATLAB s soud commad. 7 V. Repeat for a Mdrage Iterferer ow mage that the terferg sgal s a 3 H susod of ut ampltude. ow you ca t smply desg a lowpass flter ecause t would flter out the gutar frequeces aove 3 H.. As a test, chage the lowpass flter desg aove to have a passad cutoff of 5 ad a stopad cutoff of 9 ad apply the flter to the orgal (terferece-free) gutar sgal.. Compare the spectrum of ths flter s output to that of the orgal sgal 3. Lste to ths flter s output. 4. Add a ut ampltude, 3 H susod to the gutar sgal ad use the DFT to see what the spectrum looks lke. 5. Desg a adstop (.e., otch flter) usg remeord ad reme as follows. a. Look at the spectrum of the terfered-wth sgal to make decsos aout approprate flter spec values. 6. Look at the flter s frequecy respose ad pole-ero plot 7. Apply the flter to the sgal ad assess the result the frequecy ad the tme doma as well as y lsteg to t.