matlab滤波器代码

导读:巴特沃斯低通滤波器:,切比雪夫1型低通滤波器:,椭圆模拟低通滤波器:,切比雪夫低通滤波器,数字信号处理:已知通带截止频率fp=5kHz,通带最大衰减ap=2dB,阻带截止频率fs=2kHz,阻带最小衰减as=30dB,按照以上技术指标设计巴特沃斯低通滤波器:wp=2*pi*5000;ws=2*pi*12000;Rp=2;As=30;[N,wc]=buttord(wp,ws,Rp,As,'s')

matlab滤波器代码

数字信号处理:

已知通带截止频率fp=5kHz,通带最大衰减ap=2dB,阻带截止频率fs=2kHz,阻带最小衰减as=30dB,按照以上技术指标设计

巴特沃斯低通滤波器:

wp=2*pi*5000;ws=2*pi*12000;Rp=2;As=30; [N,wc]=buttord(wp,ws,Rp,As,'s'); [B,A]=butter(N,wc,'s');

k=0:511;fk=0:14000/512:14000;wk=2*pi*fk; Hk=freqs(B,A,wk); subplot(2,2,1);

plot(fk/1000,20*log10(abs(Hk)));grid on xlabel('频率(kHz)');ylabel('幅度(dB)') axis([0,14,-40,5])

切比雪夫1型低通滤波器:

wp=2*pi*3000;ws=2*pi*12000;Rp=0.1;As=60;

[N1,wpl]=cheb1ord(wp,ws,Rp,As,'s'); %cheb1ord,里面的是1,不是L [B1,A1]=cheby1(N1,Rp,wpl,'s'); subplot(2,2,1);

fk=0:12000/512:12000;wk=2*pi*fk;

Hk=freqs(B1,A1,wk);

plot(fk/1000,20*log10(abs(Hk)));grid on xlabel('频率(kHz)');ylabel('幅度(dB)') axis([0,12,-70,5])

椭圆模拟低通滤波器:

wp=2*pi*3000;ws=2*pi*12000;Rp=0.1;As=60; [N,wpo]=ellipord(wp,ws,Rp,As,'s'); [B,A]=ellip(N,Rp,As,wpo,'s'); subplot(2,2,1);

fk=0:12000/512:12000;wk=2*pi*fk; Hk=freqs(B1,A1,wk);

plot(fk/1000,20*log10(abs(Hk)));grid on xlabel('频率(kHz)');ylabel('幅度(dB)') axis([0,12,-70,5])

p195-14

wp=2*4/80;ws=2*20/80;rp=0.5;rs=45; [N,wc]=buttord(wp,ws,rp,rs); [B,A]=butter(N,wc); [hk,wk]=freqz(B,A); fk=wk/pi*40;

plot(fk,20*log10(abs(hk))); axis([0,30,-100,0])

xlabel('频率(kHZ)');ylabel('幅度(db)');grid on P195-16

wp=2*325/2500;ws=2*225/2500;rp=1;rs=40; [N,wc]=ellipord(wp,ws,rp,rs); [B,A]=ellip(N,rp,rs,wc); [hk,wk]=freqz(B,A); fk=wk/pi*40;

plot(fk,20*log10(abs(hk))); axis([0,30,-100,0])

xlabel('频率(kHZ)');ylabel('幅度(db)');grid on P195-15

wp=2*4/80;ws=2*20/80;rp=0.5;rs=45; [N,wc]=cheb1ord(wp,ws,rp,rs);

[B,A]=cheby1(N,rp,wc); [hk,wk]=freqz(B,A); fk=wk/pi*40;

plot(fk,20*log10(abs(hk))); axis([0,30,-100,0])

xlabel('频率(kHZ)');ylabel('幅度(db)');grid on

切比雪夫低通滤波器

wp=2*pi*3000;ws=2*pi*12000;rp=0.1;as=60; [N1,wp1]=cheb1ord(wp,ws,rp,as,'s'); [B1,A1]=cheby1(N1,rp,wp1,'s'); subplot(2,2,1);

fk=0:12000/512:12000;wk=2*pi*fk; hk=freqs(B1,A1,wk);

plot(fk/1000,20*log10(abs(hk)));grid on xlabel('频率(kHZ)');ylabel('幅度(db)'); axis([0,12,-70,5])

五星文库wxphp.com包含总结汇报、IT计算机、外语学习、考试资料、旅游景点、资格考试、教学教材以及matlab滤波器代码等内容。

本文共3页123