REMOVE60HZremove60HznoiseDATA_OUT=REMOVE60HZ(DATA_IN,SAMPLERATE)Removes60Hznoiseviafilteringwiththemethodsandparametersdescribedbelow.DATA_INmustbeavector.Userbeware:checktheoutputofthisfunctioncarefullywithyourdata,tobesurethatitdoesn't produce garbage.Highfrequencies(likespikes)canoftenbedisturbedbycertainmethodsemployedhere('sgolay'),sothisisbestdoneonlowfrequencydata(forexample,membranepotentialwithspikesremoved).Themethodandparametersofthefunctioncanbemodifiedwithname/valuepairs:Parameter(default):|Description--------------------------------------------------------------METHOD('sgolay')|If'sgolay':|UseSavitzky-Golayfilter|ReliesonSOGOLAYFILT|If'cheby1':|Usechebychev1typefilter|ReliesonCHEBY1andFILTFILT|(SignalProcessingToolbox)|If'ellip':|Useellipticalfilter|ReliesonELLIPandFILTFILT|If'ellip+sgolay',thenthealgorithm|usesablendofthe'ellip'and|'sgolay'methods.Thesignalis|firsthigh-passfilteredabove|'ellipsgolay_high'.Thishigh-pass|signalisthenremovedfromthedata,|andtheremaininglow-passsignal|ispassedthroughthestandard|'sgolay'mode.Finally,thehigh|frequenciesthatwereidentified|inthe'high-pass'filterareaddedback.sgolay_freq(60)|For'sgolay',thefrequencytoremove.|Stop([5565])|For'cheby1'and'ellip',the|stopfilterfrequenciesR(0.5)|For'cheby1'and'ellip',R|deciblesofpeak-|to-peakrippleinpassbandRs(20)|For'ellip',atleastRsdecibles|ofattentuationinthestopbandOrder(3)|For'cheby1'and'ellip',thefilter|orderellipsgolay_high(65)|For'ellip+sgolay',thehighpassfrequencyIfyougetNaNforyouroutputdata,tryreducingthefilterorder.Contributions:WesAlford,SteveVanHooser