翻译c语言写的fir滤波器

翻译c语言写的fir滤波器

ID:41511788

大小:23.00 KB

页数:4页

时间:2019-08-26

翻译c语言写的fir滤波器_第1页
翻译c语言写的fir滤波器_第2页
翻译c语言写的fir滤波器_第3页
翻译c语言写的fir滤波器_第4页
资源描述:

《翻译c语言写的fir滤波器》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库

1、翻译c语言写的fir滤波器请会的帮我把没行的注释写上。。谢谢#include #include #define true 1#define false 0#define n 8#define bufsize 100  /* the buffer size is 100 *//* global declarations */int in_buffer[bufsize];       /* processing data buffers */int out_buffer[

2、bufsize];/* functions */static int processing(int *input, int *output);static void dataio(void);static long round(long a);void main(){    int *input = &in_buffer[0];    int *output = &out_buffer[0];    puts("the 1st experiment started");    /* loop fo

3、rever */    while(true)    {               /*          *  read input data using a probe-point connected to a host file.          *  write output data to a graph connected through a probe-point.         */        // read the input signal.        // if th

4、e input file is sine1.dat, the signal contains 300hz,400hz and 500hz.        // if the input file is sine2.dat, the signal contains 100hz,400hz and 500hz.        // the sampling frequency is 1200hz.        dataio();        /* remove the frequency compom

5、ent of 400hz and 500hz*/    processing(input, output);        // write the output signal.    // the output file is result.dat.    dataio();    }}/* *  ======== processing ======== * * function: apply a low-pass fir filter to input signal and remove the 

6、frequency higher than 350hz. * * parameters: address of input and output buffers. * * return value: true. */ static int processing(int *input, int *output){    int i,size = bufsize;    short xx0,x,y;      // short z[n]={0,0,0,0,0,0,0,0,0};      short z[

7、n]={0,0,0,0,0,0,0,0};//short w[2*n+1]={22,356,155,990,466,220,777,216,777,26,466,9,155,0,22};//short w[2*n+1]={6,457,56,1024,224,418,523,382,784,99,784,43,523};// short w[2*n+1]={330*2,3299*2,1982*2,6867*2,4955*2,1594*2,6607*2,1065*2,4955*2,109*2,1982*2

8、,17*2,330*2}; //short w[2*n+1]={661,6598,3964,13733,9910,3187,13214,2131,9910,217,3964,34,661};  // short w[2*n+1]={58,5628,526,8192,2105,5883,4913,3829,7369,1543,7369,504,4913,102,2105,14,526,1,58};  //short w[2*n+1]={28,4432,28

当前文档最多预览五页,下载文档查看全文

此文档下载收益归作者所有

当前文档最多预览五页,下载文档查看全文
温馨提示:
1. 部分包含数学公式或PPT动画的文件,查看预览时可能会显示错乱或异常,文件下载后无此问题,请放心下载。
2. 本文档由用户上传,版权归属用户,天天文库负责整理代发布。如果您对本文档版权有争议请及时联系客服。
3. 下载前请仔细阅读文档内容,确认文档内容符合您的需求后进行下载,若出现内容与标题不符可向本站投诉处理。
4. 下载文档时可能由于网络波动等原因无法下载或下载错误,付费完成后未能成功下载的用户请联系客服处理。