毕业论文论文范文课程设计实践报告法律论文英语论文教学论文医学论文农学论文艺术论文行政论文管理论文计算机安全
您现在的位置: 毕业论文 >> 论文 >> 正文

数字信号处理DSP毕业论文 第22页

更新时间:2007-10-3:  来源:毕业论文

#include <math.h>

void firwin(n,band,fln,fhn,wn,h)

int n,band,wn;

double fln,fhn,h[];

{int i,n2,mid;

double s,pi,wc1,wc2,beta,delay;

double window();

beta=0.0;

if(wn==7)

{printf(“input beta parameter of Kaiser window (3<beta<10)\n”);

scanf(“%lf”,&beta);}

pi=4.0*atan(1.0);

if((n%2)==0)

{n2=n/2-1;

mid=1;}

else

{n2=n/2;

mid=0;}

delay=n/2.0;

wc1=2.0*pi*fln;

if(band>=3) wc2=2.0*pi*fhn;

switch(band)

{case1:

{for(i=0;i<=n2;i++)

{s=i-delay;

h[i]=(sin(wc1*s)/(pi*s))*window(wn,n+1,i,beta);

h[n-i]=h[i];}

if(mid==1) h[n/2]=wc1/pi;

break;}

case2:

{for(i=0;i<=n2;i++)

{s=i-delay;

h[i]=(sin(pi*s)-sin(wc1*s))/(pi*s);

h[i]=h[i]*window(wn,n+1,i,beta);

h[n-i]=h[i];}

if(mid==1) h[n/2]=1.0-wc1/pi;

break;}

case3:

{for(i=0;i<=n2;i++)

{s=i-delay;

h[i]=(sin(wc2*s)-sin(wc1*s))/(pi*s);

h[i]=h[i]*window(wn,n+1,i,beta);

h[n-i]=h[i];}

if(mid==1) h[n/2]=(wc2-wc1)/pi;

break;}

case4:

{for(i=0;i<=n2;i++)

{s=i-delay;

h[i]=(sin(wc1*s)+sin(pi*s)-sin(wc2*s))/(pi*s);

h[i]=h[i]*window(wn,n+1,i,beta);

h[n-i]=h[i];}

if(mid==1) h[n/2]=(wc1+pi-wc2)/pi;

break;}

}

}

static double window(type,n,i,beta)

int i,n,type;

double beta;

{int k;

double pi,w;

double Kaiser();

pi=4.0*atan(1.0);

w=1.0;

switch(type)

{case1:

{w=1.0;

break;}

case2:

{k=(n-2)/10;

if(i<=k)

w=0.5*(1.0-cos(i*pi/(k+1)));

if(i>n-k-2)

w=0.5*(1.0-cos((n-i-1)*pi/(k+1)));

break;}

case3:

{w=1.0-fabs(1.0-2*i/(n-1.0));

break;}

case4:

{w=0.5*(1.0-cos(2*i*pi/(n-1)));

break;}

case5:

{w=0.54-0.46*cos(2*i*pi/(n-1));

break;}

case6:

{w=0.42-0.5*cos(2*i*pi/(n-1))+0.08*cos(4*i*pi/(n-1));

break;}

case7:

{w=Kaiser(i,n,beta);

break;}

}

 << 上一页  [21] [22] [23] [24] [25] [26] [27] [28] 下一页

数字信号处理DSP毕业论文 第22页下载如图片无法显示或论文不完整,请联系qq752018766
设为首页 | 联系站长 | 友情链接 | 网站地图 |

copyright©751com.cn 辣文论文网 严禁转载
如果本毕业论文网损害了您的利益或者侵犯了您的权利,请及时联系,我们一定会及时改正。