查看: 1751|回复: 0

DSP28 fir低通滤波器的设计源码

[复制链接]

该用户从未签到

发表于 2020-11-15 16:32:00 | 显示全部楼层 |阅读模式
分享到:
#include"stdio.h"
#include"math.h"
#include"DSP28_Device.h"
#defineorder 26
#defineN  128         
#definepi 3.1415926
floatFIR_LPF[order] ={-1.52864422149721e-05,-0.000133359311426970,-0.000544636220343477,-0.00137835208978255,-0.00218948983490142,-0.00124340086554490,0.00478134865608317,0.0198838342801837,0.0464361812966399,0.0825102845162328,0.120763491355644,0.150360916315540,0.161536936687780,0.150360916315540,0.120763491355644,0.0825102845162328,0.0464361812966399,0.0198838342801837,0.00478134865608317,-0.00124340086554490,-0.00218948983490142,-0.00137835208978255,-0.000544636220343477,-0.000133359311426970,-1.52864422149721e-05};
floats;
inti,n;
floatinput[N],output[N];  
intfs=10000;   
intf1=600;   
intf2=1500;
#definefa 2*pi*f1/fs
#definefb 2*pi*f2/fs
void inputwave()
{
    for(n=0;n<N;n++ )
input[n]=sin(fa*n)+sin(fb*n);
}
voidmain()
{   int m=0,n=0;
    inputwave();           
for(n=0;n<N+order;n++)
{
  for(s=0,m=0;(m<order)&&(m<n);m++)
{
   s=FIR_LPF[m]*input[n-m]+s;
}
        output[n]=s;}
while(1);  
回复

使用道具 举报

您需要登录后才可以回帖 注册/登录

本版积分规则

关闭

站长推荐上一条 /4 下一条



手机版|小黑屋|与非网

GMT+8, 2024-11-22 03:14 , Processed in 0.111054 second(s), 15 queries , MemCache On.

ICP经营许可证 苏B2-20140176  苏ICP备14012660号-2   苏州灵动帧格网络科技有限公司 版权所有.

苏公网安备 32059002001037号

Powered by Discuz! X3.4

Copyright © 2001-2024, Tencent Cloud.