ImageVerifierCode 换一换
格式:DOCX , 页数:12 ,大小:18.64KB ,
资源ID:20351173      下载积分:3 金币
快捷下载
登录下载
邮箱/手机:
温馨提示:
快捷下载时,用户名和密码都是您填写的邮箱或者手机号,方便查询和重复下载(系统自动生成)。 如填写123,账号就是123,密码也是123。
特别说明:
请自助下载,系统不会自动发送文件的哦; 如果您已付费,想二次下载,请登录后访问:我的下载记录
支付方式: 支付宝    微信支付   
验证码:   换一换

加入VIP,免费下载
 

温馨提示:由于个人手机设置不同,如果发现不能下载,请复制以下地址【https://www.bdocx.com/down/20351173.html】到电脑端继续下载(重复下载不扣费)。

已注册用户请登录:
账号:
密码:
验证码:   换一换
  忘记密码?
三方登录: 微信登录   QQ登录  

下载须知

1: 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。
2: 试题试卷类文档,如果标题没有明确说明有答案则都视为没有答案,请知晓。
3: 文件的所有权益归上传用户所有。
4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
5. 本站仅提供交流平台,并不能对任何下载内容负责。
6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

版权提示 | 免责声明

本文(IIR滤波器设计程序Word文档格式.docx)为本站会员(b****5)主动上传,冰豆网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。 若此文所含内容侵犯了您的版权或隐私,请立即通知冰豆网(发送邮件至service@bdocx.com或直接QQ联系客服),我们立即给予删除!

IIR滤波器设计程序Word文档格式.docx

1、FNCCH(x)log(x+sqrt(x*x-1)FNSH1(x)(exp(x)-exp(-x)/2FNCH1(x)(exp(x)+exp(-x)/2/*/double *bcg(double ap,double as,double wp,double ws,int *n,double *h,int *type);struct rptr *bsf(double *c,int ni,double *f1,double *f2,int nf,struct rptr *ptr,int *no);double *pnpe(double *a,int m,int n,double *b,int *mn)

2、;double *ypmp(double *a,int m,double *b,int n,double *c,int *mn);void lowpass_input(double *wp,double *ws,double *ap,double *ar,double *f1,double *f2,int *nf);void highpass_input(double *wp,double *ws,double *ap,double *ar,double *f1,double *f2,int *nf);void bandpass_input(double *wp,double *ws,doub

3、le *ap,double *ar,double *f1,double *f2,int *nf);void draw_image(double *x,int m,char *title1,char *title2,char *xdis1,char *xdis2,int dis_type);void main(void)double *f1,*f2,*hwdb;double *h=NULL;int N,nf,ns,nz,i,j,k,ftype,type;COMPLEX hwdb1,hwdb2;double wp,ws,ap,as,jw,amp1,amp2;char title80,tmp20;s

4、truct rptr *ptr=NULL;/* printf(%lf,PI);getch();N=500;f1=(double *)calloc(4,sizeof(double);f2=(double *)calloc(4,sizeof(double);hwdb=(double *)calloc(N+2,sizeof(double);if (hwdb=NULL)printf(n Not enough memory to allocate!);exit(0);n1.Lowpass 2.Highpass 3.bandpassnPlease select the filter type:scanf(

5、%d,&ftype);switch(ftype)case 1:lowpass_input(&wp,&ws,&ap,&as,f1,f2,&nf);break;case 2:highpass_input(&case 3:bandpass_input(&default:h=bcg(ap,as,wp,ws,&ns,h,&type);nThe analog filter denominator coefficients of Ha(s):for(i=0;iai,i,ptr-bi);nnPress any key to calculate the filter response of H(z).nWait

6、ting for calculating./* Calculate the magnitude-frequency response*/for(k=0;kai*cos(i*jw);hwdb2.real+=ptr-bi*cos(i*jw);hwdb1.image+=ptr-ai*sin(i*jw);hwdb2.image+=ptr-bi*sin(i*jw);amp1=(pow(hwdb1.real,2)+pow(hwdb1.image,2);amp2=(pow(hwdb2.real,2)+pow(hwdb2.image,2);if(amp1=0) amp1=1e-90;if(amp2=0) am

7、p2=1e-90;hwdbk=10*log10(amp1/amp2);if(hwdbkb);a);free(h);free(hwdb);free(f2);free(f1);/*/void lowpass_input(double *wp,double *ws,double *ap,double *ar,double *f1,double *f2,int *nf)double fp,fr,fs;nPlease input the Fp,Ap,Fr,Ar,Fs valuenFp,Ap:Passband frequency(Hz) and MAXAttenuation(dB)nFr,Ar:Stopb

8、and frequency(Hz) and MINAttenuation(dB)nFs is the sample frequency(Hz) Lowpass filternInput parameters Fp,Ap,Fr,Ar,Fs:%lf,%lf,%lf,%lf,%lffp,ap,&fr,ar,&fs);if(fpfr)|(*ap*ar)|(fs2*fr);*wp=tan(PI*fp/fs);*ws=tan(PI*fr/fs);*f1=-1.0;*(f1+1)=1.0;*f2=1.0;*(f2+1)=1.0;*nf=1;/*/void highpass_input(double *wp,

9、double *ws,double *ap,double *ar,double *f1,double *f2,int *nf)nFs is the sample frequency(Hz) highpass filterif(fp*ar)|(fs2*fp)while(fp*ar)|(fsfp2)|(fp1fr2)|(*ap2*fr2)while(fp12*fr2);wp1=2*PI*fp1/fs;wr1=2*PI*fr1/fs;wp2=2*PI*fp2/fs;wr2=2*PI*fr2/fs;cw0=sin(wp1+wp2)/(sin(wp1)+sin(wp2);pwp1=fabs(cw0-co

10、s(wp1)/sin(wp1);pws1=fabs(cw0-cos(wr1)/sin(wr1);pwp2=fabs(cw0-cos(wp2)/sin(wp2);pws2=fabs(cw0-cos(wr2)/sin(wr2);if(fabs(pws1-pwp1)real=-wc*FNSH1(x)*sin(y);image=-wc*FNCH1(x)*cos(y);c=(pow(10.0,(0.1*ap)-1.0)/(pow(10.0,(0.1*as)-1.0);*n=(int)(fabs(log(c)/log(wp/ws)/2.0)+0.99999);b=(COMPLEX *)calloc(*n+

11、2,sizeof(COMPLEX);wc=wp/pow(pow(10.0,0.1*ap)-1.0,1.0/(2.0*(*n);a=pow(wc,(double)(*n);p=PI*(0.5+(2.0*i+1.0)/2.0/(*n);real=wc*cos(p);image=wc*sin(p);nThe order of prototype filter is:,*n);/* b1=(COMPLEX*)calloc(*n+2,sizeof(COMPLEX);b2=(COMPLEX*)calloc(*n+2,sizeof(COMPLEX);h=(double *)calloc(*n+2),size

12、of(double);if(h=NULL)b1-real=-(b-real);image=-(b-image);(b1+1)-real=1.0;image=0.0;if(*n!=1)for(i=1;I;K+)cs1=(b1+k)-real-(b1+k+1)-real*(b+i)-real;cs2=(b1+k)-image-(b1+k+1)-image;(b2+k+1)-real=cs1+(b1+k+1)-image*(b+i)-image=cs2-(b1+k+1)-b2-real=-(b1-real-b1-image=-(b1-image+b1-(b2+i+1)-real=(b1+i)-image=(b1+i)-=i+1;(b1+k)-real=(b2+k)-image=(b2+k)-(b2+k)-real=0.0;=*n;hi=(b1+i)-nz%2d=%16fnz0=%16f,nz1=%16f,nz2=%16f,nz3=%16f,nz4=%16f,1.0,2.6131/wc,3.4142/pow(wc,2),2.6131/pow(wc,3),1/a);=*n-1;ppi=xs*n-1i;hi=ppi/pow(wc,i);free(b);/* free(b1);free(b2);return h;/*/*

copyright@ 2008-2022 冰豆网网站版权所有

经营许可证编号:鄂ICP备2022015515号-1