本文主要是介绍cheby1设计低通高通滤波器,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
设计一频率分分别为10hz和40hz的混合信号,分别通过低通和高通滤波器分离混合信号
fs=100;
x=0:1/fs:1;
tt=sin(20*pi*x+3)+4*sin(80*pi*x+3)+rands(1,length(x));
tt1=sin(20*pi*x+3);
tt2=4*sin(80*pi*x+3);figure;
subplot(311);
plot(x,tt,'k-');
title('混合信号');
subplot(312);
plot(x,tt1,'k-');
title('f=10hz');
subplot(313);
plot(x,tt2,'k-');
title('f=40hz');
滤波
%高通 通带频率要大于阻断频率
wp=40/length(x); rp=0.6;
ws=30/length(x); rs=2;
[n,wn]=cheb1ord(wp,ws,rp,rs);[b,a]=cheby1(n,rp,wn,'high');
y_gao=filter(b,a,tt);%低通 通带频率要小于阻断频率
wp=40/length(x); rp=0.6;
ws=60/length(x); rs=2;
[n,wn]=cheb1ord(wp,ws,rp,rs);[b,a]=cheby1(n,rp,wn,'low');
y_di=filter(b,a,tt);figure;
subplot(211);
plot(x,tt,'k-',x,y_gao,'r-');
legend('原始','高通')
subplot(212);
plot(x,tt,'k-',x,y_di,'r-');
legend('原始','低通')
从 图上可以看出,分别滤波出原始10hz和40hz的信号
这篇关于cheby1设计低通高通滤波器的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!