📄 chebyi.m
字号:
clear all
close all
clc
nfft=256;
Fs=44;
Rp=0.1;
Rs=10;
typeo=4;
switch typeo
case 1
type='bandpass';
case 2
type='stop';
case 3
type='high';
case 4
type='low';
end
if typeo==1
Wp=[0.15*pi,0.35*pi];
Ws=[0.1*pi,0.4*pi];
elseif typeo==2
Ws=[0.15*pi,0.35*pi];
Wp=[0.1*pi,0.4*pi];
elseif typeo==3
Wp=0.25*pi;
Ws=0.2*pi;
elseif typeo==4
Wp=0.25*pi;
Ws=0.3*pi;
end
[N,wn]=cheb1ord(Wp/pi,Ws/pi,Rp,Rs,'z');
[b,a,k]=cheby1(N,Rp,wn,type,'z');
[b,a]=zp2tf(b,a,k);
[H,w]=freqz(b,a,nfft,Fs);
plot([0:nfft-1]/nfft,abs(H))
axis([0 0.5 0 1])
grid on
grid on
title('ChebyI数字滤波器')
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -