高分悬赏 限三天 特急matlab 利用凯泽窗函数设计一个带通滤波器
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了高分悬赏 限三天 特急matlab 利用凯泽窗函数设计一个带通滤波器相关的知识,希望对你有一定的参考价值。
设理想带阻滤波器频率响应为 1 0<=w<=π/3
He(e(jw))= 0 π<=|w|<=2π/3
-1 2π/3<=|w|<=π
利用凯泽窗函数设计长度为45的带通滤波器,阻带衰减为60Hz。
要求:实验基本原理,源程序及其标注。
如果回答好 追加悬赏 非常感谢
参数自己改一下就可以了
cheb1
% wp1=0.45*pi;wp2=0.65*pi;ws1=0.3*pi;ws2=0.75*pi;Rp=1;Rs=40
% =============双线型变换法=========================================
wp1=0.45*pi; wp2=0.65*pi;
ws1=0.3*pi; ws2=0.75*pi;
Rp=1; Rs=40;
Wp1=tan(wp1/2); Wp2=tan(wp2/2);
Ws1=tan(ws1/2); Ws2=tan(ws2/2);
BW=Wp2-Wp1; W0=Wp1*Wp2; W00=sqrt(W0);
WP=1; WS=WP*(W0^2-Ws1^2)/(Ws1*BW);
[N,Wn]=cheb1ord(WP,WS,Rp,Rs,'s');
[B,A]=cheby1(N,Rp,Wn,'s');
[BT,AT]=lp2bp(B,A,W00,BW);
[num,den]=bilinear(BT,AT,0.5);
[h,omega]=freqz(num,den,64);
subplot(2,2,1);stem(omega/pi,abs(h));
xlabel('\omega/\pi');ylabel('|H(z)|');
subplot(2,2,2);stem(omega/pi,20*log10(abs(h)));
xlabel('\omega/\pi');ylabel('增益.dB');
% =============直接法=================================
wp1=0.45*pi; wp2=0.65*pi;
ws1=0.3*pi; ws2=0.75*pi;
Rp=1; Rs=40;
Wp=[wp1/pi,wp2/pi]; Ws=[ws1/pi,ws2/pi];
[N,Wn]=cheb1ord(Wp,Ws,Rp,Rs);
[B,A]=cheby1(N,Rp,Wn);
[h,omega]=freqz(B,A,64);
subplot(2,2,3);stem(omega/pi,abs(h));
xlabel('\omega/\pi');ylabel('|H(z)|');
subplot(2,2,4);stem(omega/pi,20*log10(abs(h)));
xlabel('\omega/\pi');ylabel('增益.dB');
%cheby2%
% wp1=0.45*pi;wp2=0.65*pi;ws1=0.3*pi;ws2=0.75*pi;Rp=1;Rs=40
% =============双线型变换法=========================================
wp1=0.45*pi; wp2=0.65*pi;
ws1=0.3*pi; ws2=0.75*pi;
Rp=1; Rs=40;
Wp1=tan(wp1/2); Wp2=tan(wp2/2);
Ws1=tan(ws1/2); Ws2=tan(ws2/2);
BW=Wp2-Wp1; W0=Wp1*Wp2; W00=sqrt(W0);
WP=1; WS=WP*(W0^2-Ws1^2)/(Ws1*BW);
[N,Wn]=cheb2ord(WP,WS,Rp,Rs,'s');
[B,A]=cheby2(N,Rs,Wn,'s');
[BT,AT]=lp2bp(B,A,W00,BW);
[num,den]=bilinear(BT,AT,0.5);
[h,omega]=freqz(num,den,64);
subplot(2,2,1);stem(omega/pi,abs(h));
xlabel('\omega/\pi');ylabel('|H(z)|');
subplot(2,2,2);stem(omega/pi,20*log10(abs(h)));
axis([0 1 -100 0]);xlabel('\omega/\pi');ylabel('增益.dB');
% =============直接法=================================
wp1=0.45*pi; wp2=0.65*pi;
ws1=0.3*pi; ws2=0.75*pi;
Rp=1; Rs=40;
Wp=[wp1/pi,wp2/pi]; Ws=[ws1/pi,ws2/pi];
[N,Wn]=cheb2ord(Wp,Ws,Rp,Rs);
[B,A]=cheby2(N,Rs,Wn);
[h,omega]=freqz(B,A,64);
subplot(2,2,3);stem(omega/pi,abs(h));
xlabel('\omega/\pi');ylabel('|H(z)|');
subplot(2,2,4);stem(omega/pi,20*log10(abs(h)));
axis([0 1 -100 0]);xlabel('\omega/\pi');ylabel('增益.dB');
%椭圆%
% wp1=0.45*pi;wp2=0.65*pi;ws1=0.3*pi;ws2=0.75*pi;Rp=1;Rs=40
% =============双线型变换法=========================================
wp1=0.45*pi; wp2=0.65*pi;
ws1=0.3*pi; ws2=0.75*pi;
Rp=1; Rs=40;
Wp1=tan(wp1/2); Wp2=tan(wp2/2);
Ws1=tan(ws1/2); Ws2=tan(ws2/2);
BW=Wp2-Wp1; W0=Wp1*Wp2; W00=sqrt(W0);
WP=1; WS=WP*(W0^2-Ws1^2)/(Ws1*BW);
[N,Wn]=ellipord(WP,WS,Rp,Rs,'s');
[B,A]=ellip(N,Rp,Rs,Wn,'s');
[BT,AT]=lp2bp(B,A,W00,BW);
[num,den]=bilinear(BT,AT,0.5);
[h,omega]=freqz(num,den,64);
subplot(2,2,1);stem(omega/pi,abs(h));grid;
xlabel('\omega/\pi');ylabel('|H(z)|');
subplot(2,2,2);stem(omega/pi,20*log10(abs(h)));grid;
xlabel('\omega/\pi');ylabel('增益.dB');
% =============直接法=================================
wp1=0.45*pi; wp2=0.65*pi;
ws1=0.3*pi; ws2=0.75*pi;
Rp=1; Rs=40;
Wp=[wp1/pi,wp2/pi]; Ws=[ws1/pi,ws2/pi];
[N,Wn]=ellipord(Wp,Ws,Rp,Rs);
[B,A]=ellip(N,Rp,Rs,Wn);
[h,omega]=freqz(B,A,64);
subplot(2,2,3);stem(omega/pi,abs(h));grid;
xlabel('\omega/\pi');ylabel('|H(z)|');
subplot(2,2,4);stem(omega/pi,20*log10(abs(h)));grid;
xlabel('\omega/\pi');ylabel('增益.dB');
回答者: dear漫儿 - 初学弟子 一级 5-6 19:37 参考技术A %凯泽窗函数设计的带通滤波器幅频特性
%利用kaiser窗函数设计一个长度为奇数的带通滤波器(长度为奇数对应滤波器是偶数阶的,
% 由此能满足带通滤波器的要求),通带范围是15hertz到40hertz,阻带范围是0hertz到10
% hertz、50hertz到250hertz,阻带波纹为0.01decibel,通带波纹为0.05decibel,信号
%采样率为500hertz
clear all;
fs=500;%采样频率
fcuts=[10,15,40,50];%频率参数
mags=[0 1 0];%用于制定过渡带(通带或阻带)频率段的理想滤波器幅度值,在通带内其元
%素值取1,阻带内取0
devs=[0.01,0.05,0.01];%设置各通带和阻带内允许的幅度的最大误差
[n,Wn,beta,ftype]=kaiserord(fcuts,mags,devs,fs);
n=n+rem(n,2);%求偶数阶,rem求余数
hh=fir1(n,Wn,ftype,kaiser(n+1,beta),'noscale');%线性相位通带标准滤波器的设计
[H,f]=freqz(hh,1,1024,fs);%频率响应
plot(f,abs(H),'r','LineWidth',2);
grid on;
title('凯泽窗函数设计的带通滤波器幅频特性');
xlabel('频率(f)');
ylabel('幅度');
%%%%%%%%%%%%%%%%%%%%%%%设置背景色为白色%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
set(gcf,'color','w'); 参考技术B 先给分就帮你设计.本回答被提问者采纳
高分悬赏 C#WPF中怎么读取TXT文档并显示在RichtextBox里。
不是windows窗体,就写一个吧。加分~~
例如点Button就能读取桌面上的一个TXT 显示出来
这是打开一个文件吧
参考技术B 参考这篇回答的尾部试试:http://zhidao.baidu.com/question/258078298.html?oldq=1追问
中文是乱码 ,怎么改编码格式
追答参考这里,在构造StreamReader对象时使用指定编码方式的这个构造方法:
http://msdn.microsoft.com/en-us/library/ms143456.aspx
以上是关于高分悬赏 限三天 特急matlab 利用凯泽窗函数设计一个带通滤波器的主要内容,如果未能解决你的问题,请参考以下文章
用matlab对一张圆的图像轮廓提取后,知道了圆的边界,怎么确定边界上点的像素坐标?高分悬赏啊啊啊