欢迎来到天天文库
浏览记录
ID:36721462
大小:205.50 KB
页数:9页
时间:2019-05-14
《FIR低通滤波器C语言实现》由会员上传分享,免费在线阅读,更多相关内容在行业资料-天天文库。
1、文文:C:DocumentsandSettingsuser桌桌FirAlgs.c2009-3-2727,15:53:51/******************************************************************************Name:FirAlgs.c**Synopsis:FIRfilteralgorithmsforuseinC**Description:**ThismoduleprovidesfunctionstoimplementFiniteI
2、mpulseResponse(FIR)*filtersusingavarietyofalgorithms.**Thesefunctionsusemostorallofthefollowinginputparameters:**input-theinputsampledata*ntaps-thenumberoftapsinthefilter*h[]-theFIRcoefficientarray*z[]-theFIRdelaylinearray**p_state-the"state"ofthefilter;ini
3、tializethisto0before*thefirstcall**Thefunctionsfir_basic,fir_shuffle,andfir_circulararenotvery*efficientinC,andareprovidedheremainlytoillustrateFIR*algorithmicconcepts.However,thefunctionsfir_split,fir_double_z*andfir_double_hareallfairlyefficientwaystoimpl
4、ementFIRfilters*inC.**Copyright2000byGrantR.Griffin**Thanksgotocontributorsofcomp.dspforteachingmesomeofthese*techniques,andtoJimThomasforhisreviewandgreatsuggestions.**TheWideOpenLicense(WOL)**Permissiontouse,copy,modify,distributeandsellthissoftwareandits
5、*documentationforanypurposeisherebygrantedwithoutfee,providedthat*theabovecopyrightnoticeandthislicenseappearinall第1页文文:C:DocumentsandSettingsuser桌桌FirAlgs.c2009-3-2727,15:53:51sourcecopies.*THISSOFTWAREISPROVIDED"ASIS"WITHOUTEXPRESSORIMPLIEDWARRANTYOF*
6、ANYKIND.Seehttp://www.dspguru.com/wol.htmformoreinformation.******************************************************************************/#include#ifdefWIN32#include#endif#defineSAMPLEdouble/*definethetypeusedfordatasamples*//************
7、****************************************************************//*clear:zeroizeaFIRdelayline*//****************************************************************************/voidclear(intntaps,SAMPLEz[]){intii;for(ii=0;ii8、****************************************************************fir_basic:DoesthebasicFIRalgorithm:storeinputsample,calculate*outputsample,movedelayline*************************************************
8、****************************************************************fir_basic:DoesthebasicFIRalgorithm:storeinputsample,calculate*outputsample,movedelayline*************************************************
此文档下载收益归作者所有