·ChineseMedicalEquipmentJournal·Vol.29No.12December2008:2008-06-15:2008-08-24:(1965-),,,,,,Email:xingguoquan@sohu.com。(,437100)[]:,。:FDATool。:,50Hz。:,。[];FDATool;;[]TN973.4[]A[]1003-8868(2008)12-0025-03DesignofDigitalFilterofCancelling50HZNoiseXINGGuo-quan(BiomedicalEngineeringDepartmentofXianningCollege,Xianning437100,HubeiProvince,China)AbstractObjectiveTodesignabandstopdigitalfilterforcancellingthe50HZnoise.MethodsProcedureandFDAToolmethodwereusedinprocessing.ResultsThefilterwastestedbyablendedsinewave,theexperimentalresultshowedthatthefiltercouldcancelthe50HZnoise.ConclusionThisfiltermayeliminatearandomnoiseexceptthe50HZnoisebymodifyingtheproceduresimply.[ChineseMedicalEquipmentJournal,2008,29(12):25-27]Keywordsdigitalfilter;FDATool;noisecancelling;bandstop1,。,。、、、、、、,、、[1]。(FiniteImpulseResponse,FIR)(InfiniteImpulseResponse,IIR)[2]。FIR,,,,,,FIRIIR5~10。IIR、,。,、、,Matlab、、。,、、。MATLAB。2IIRIIRZ-1[3]:H(Z)=MK=0Σbkz-k1+NK=1Σakz-k(1):H(S)=bmSm+bm-1Sm-1+…+b0anSn+an-1Sn-1+…+a0(2),{b,a},,。,,H(S)H(Z),SZ。SZ:、。,。H(Z)H(S)。H(S)S[4]:S≈2T1-Z-11+Z-1≈≈Z≈2T+S2T-S(3)(3)SZ,,SZ,,,,Ωω,:Ω=2Ttan(ωT2)(4)3IIR0~100Hz,200Hz;,50Hz,,,fc1=49Hz,fc2=51Hz,50Hz,:clear;THESIS&RESEARCHREPORT·ChineseMedicalEquipmentJournal·Vol.29No.12December20084Simulinkcloseall;wp=[4060]/100;ws=[4951]/100;50Hzrp=3;3dBrs=20;20dBfs=200;200Hz[n,wn]=buttord(wp,ws,rp,rs);[h]=butter(n,wn,'stop');figure(1),freqz(h,512,fs);t=(0:200)/fs;s=sin(80*pi*t)+sin(100*pi*t)+sin(120*pi*t);sf=filter(h,1,s);sfigure(2),subplot(2,1,1),plot(t*200,s);ylabel('magnitude');xlabel('Hz');title('');figure(2),subplot(2,1,2),plot(t*200,sf);ylabel('magnitude');xlabel('Hz');title('');Y=fft(s,512);pyy=Y.*conj(Y)/512;f=1000/512*(0:255);figure(3),subplot(2,1,1),plot(f/5,pyy(1:256));ylabel('magnitude');xlabel('Hz');title('');Y=fft(sf,512);pyy=Y.*conj(Y)/512;f=1000/512*(0:255);figure(3),subplot(2,1,2),plot(f/5,pyy(1:256));ylabel('magnitude');xlabel('Hz');title('');1、2、3。1;40、50、60Hz,40、60Hz,50Hz。3。4simulinkMatlabsimulink。simulink,。FDATool(FilterDesignAnalysisTool)MATLAB[5-6],、,FIRIIR。FilterTypeBandstop;DesignMethodIIR(Butterworth),,,4。1DSPDSPDSP12+++B-FFT11FEAToolB-FFT-160-140-120-100-80-60-40/dB-100-50050100/°0.90.80.70.60.50.40.30.20.10110.90.80.70.60.50.40.30.20.10/×πrad·sanple-1/×πrad·sanple-1320123450510152010090807060504030201001009080706050403020100/dB/dBf/Hzf/Hz200180160140120100806040200-3-2-10123f/Hz200180160140120100806040200-10123/dB/dBf/HzTHESIS&RESEARCHREPORT·ChineseMedicalEquipmentJournal·Vol.29No.12December20085,、,PC。IP,PC,MC50,MC50IP,PC,PC,MC50PC。42007,80,,100%,100%。,50%,,“、、、”[3]。,,。,、。[][1],,.[J].,2006,27(5):45-46.[2].C++[M].:,2004.[3],,,.[J].,2007,29(9):4-5.[4].[J].,2007,28(11):36-37.4,3,sin(80πt)、sin(100πt)、sin(120πt)3,(add),,Scope1。Simulinkstart,。Scop1、Scope、SpectrumScope1、SpectrumScope,,,5、6。4MATLAB;5Scope,5Scope1;,6(a),6(b)。5MATLAB,FDATool,,50Hz,。MATLAB,DSP、FPGA。,,,IIR,。[][1].[M].:,2000.[2]TompkinsWillisJ.[M].,,.:,2001.[3]OppenheimAV,ChaferRM.[M].,.:,1981.[4],.[M].:,2004.[5],,.MATLAB[M].:,2003.[6].MATLAB7.0[M].:,2005.(b)Scope1(a)Scope5MagnitudeSquared/dB1009080706050403020100Frequency/Hz-2024681012141618-20246810121416181009080706050403020100Frequency/HzMagnitudeSquared/dB(a)SpectrumScope(b)SpectrumScope16(荨荨18荨荨)荨荨荨荨荨荨荨荨荨荨荨荨荨荨荨荨荨荨荨荨荨荨荨荨荨荨荨荨荨荨荨荨荨荨荨荨荨荨荨荨荨荨荨荨荨THESIS&RESEARCHREPORT