



全文預(yù)覽已結(jié)束
下載本文檔
版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進(jìn)行舉報(bào)或認(rèn)領(lǐng)
文檔簡介
翻譯c語言寫的fir濾波器請會的幫我把沒行的注釋寫上。謝謝#include#include#definetrue1#definefalse0#definen8#definebufsize100/*thebuffersizeis100*/*globaldeclarations*/intin_bufferbufsize;/*processingdatabuffers*/intout_bufferbufsize;/*functions*/staticintprocessing(int*input,int*output);staticvoiddataio(void);staticlonground(longa);voidmain()int*input=&in_buffer0;int*output=&out_buffer0;puts(the1stexperimentstartedn);/*loopforever*/while(true)/*readinputdatausingaprobe-pointconnectedtoahostfile.*writeoutputdatatoagraphconnectedthroughaprobe-point.*/readtheinputsignal./iftheinputfileissine1.dat,thesignalcontains300hz,400hzand500hz./iftheinputfileissine2.dat,thesignalcontains100hz,400hzand500hz./thesamplingfrequencyis1200hz.dataio();/*removethefrequencycompomentof400hzand500hz*/ processing(input,output); /writetheoutputsignal. /theoutputfileisresult.dat. dataio();/*=processing=*function:applyalow-passfirfiltertoinputsignalandremovethefrequencyhigherthan350hz.*parameters:addressofinputandoutputbuffers.*returnvalue:true.*/staticintprocessing(int*input,int*output)inti,size=bufsize;shortxx0,x,y;/shortzn=0,0,0,0,0,0,0,0,0;shortzn=0,0,0,0,0,0,0,0;/shortw2*n+1=22,356,155,990,466,220,777,216,777,26,466,9,155,0,22;/shortw2*n+1=6,457,56,1024,224,418,523,382,784,99,784,43,523;/shortw2*n+1=330*2,3299*2,1982*2,6867*2,4955*2,1594*2,6607*2,1065*2,4955*2,109*2,1982*2,17*2,330*2;/shortw2*n+1=661,6598,3964,13733,9910,3187,13214,2131,9910,217,3964,34,661;/shortw2*n+1=58,5628,526,8192,2105,5883,4913,3829,7369,1543,7369,504,4913,102,2105,14,526,1,58;/shortw2*n+1=28,4432,280,8192,1259,4883,3356,3975,5873,1509,7048,644,5873,142,3356,30,1259,3,280,0,28;/shortw2*n+1=26,651,182,1024,545,421,909,247,909,51,545,11,182,1,26;/shortw2*n+1=831,20846,5815,32768,17445,13486,29075,7888,29075,1647,17445,349,5815,21,831;/shortw2*n+1=208,5211,1454,8192,4361,3371,7269,1972,7269,412,4361,87,1454,5,208;shortw2*n+1=101,4356,810,8192,2835,3403,5670,2517,7088,605,5670,193,2835,21,810;/shortw2*n+1=101,4356,810,8192,2835,3403,5670,2517,7088,605,5670,193,2835,21,810,2,101;/shortw2*n+1=50,3814,454,8192,1815,3504,4235*,3084,6353,831,6353,349,4235,50,1815,8,454,0,50;longy0,z0;/22222222222222while(size-)xx0=*input+;x=xx0*6;z0=(long)x15;y0=0;for(i=0;i15);y0=round(y0);for(i=n-1;i0;i-)zi=zi-1;z0=round(z0);z0=(short)(z015);y=(short)(y015);*output+=y;/*additionalprocessingload*/ return(true);/*=dataio=*function:readinputsignalandwriteprocessedoutputsignal.*par
溫馨提示
- 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負(fù)責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- 理解客戶需求的商務(wù)英語試題及答案
- 探索創(chuàng)業(yè)扶持的潛力與挑戰(zhàn)試題及答案
- 電動(dòng)車技術(shù)標(biāo)準(zhǔn)與市場需求的關(guān)系試題及答案
- 如何協(xié)調(diào)創(chuàng)業(yè)扶持政策與行業(yè)發(fā)展的關(guān)系試題及答案
- 職場受益測試題及答案
- 電商對農(nóng)業(yè)的影響試題及答案
- 注冊土木工程師考試難題及解答
- 旋律應(yīng)用能力提升試題及答案
- 注冊土木工程師考試最佳實(shí)踐試題及答案
- 消費(fèi)者心理在家具設(shè)計(jì)中的重要性試題及答案
- 近三年小升初試卷及答案
- 上海寶山區(qū)公開招聘社區(qū)工作者考試高頻題庫帶答案2025年
- 美容學(xué)徒聘請協(xié)議書
- 江蘇連云港市金灌投資發(fā)展集團(tuán)有限公司、灌南城市發(fā)展集團(tuán)有限公司等招聘筆試題庫2025
- GB/T 45477-2025無油懸浮離心式冷水(熱泵)機(jī)組
- 《疫苗研發(fā)》課件
- 社工小組協(xié)議書范例
- 天津東疆綜合保稅區(qū)管理委員會招聘真題2024
- 2024年福建泉州文旅集團(tuán)招聘考試真題
- 2024至2030年中國蠶蛹毛油行業(yè)投資前景及策略咨詢研究報(bào)告
- 《鐵路線路工》 課件 項(xiàng)目七 養(yǎng)路機(jī)械
評論
0/150
提交評論