⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 iir_che_design.m

📁 经典《信号与系统》教程的matlab例程,对深入理解信号与系统相关概念有很大帮助
💻 M
字号:
% Name: iir_che_design
% This program is used to design the IIR digital lowpass filter
% using the bilinear transformation
% The specifications of the digital filter are:
% alphap: The maximal passband attenuation in dB
% alphas: The minimum stopband attenuation in dB
% wp: The passband cutoff frequency 
% ws: The stopband cutoff frequency
% N:  The order of the lowpass filter
clear
format short
alphap=1;%input('Type in the data ap=:');
alphas=10;%input('Type in the data as=:');
wp=0.2*pi;%input('Type in the passband cutoff frequency wp=:');
ws=0.3*pi;%input('Type in the stopband cutoff frequency ws=:');
T=0.001;
omegap=(2/T)*tan(wp/2);
omegas=(2/T)*tan(ws/2);
%==========================================================================
ep=sqrt(10^(0.1*alphap)-1);
A=10^(alphas/20);
omegac=omegap;
omegar=omegas/omegap;
g=sqrt(A*A-1)/ep;
N=ceil(log10(g+sqrt(g*g-1))/log10(omegar+sqrt(omegar*omegar-1)));
fprintf('\n***The order N of Type-I Chebyshev is %2.0f\n',N);
%===========================================================================
wn=wp/pi;
[b,a]=cheby1(N,alphap,wn);
fprintf('\n***The coefficient vectors of Type-I Chebyshev are %2.0f\n');
b
a
%==========================================================================
[H,w]=freqz(b,a);
%=================================================================
subplot(211)
plot(w/pi,abs(H));
title('Amplitude response'),ylabel('|H|'),axis([0,1,0,1.1]),
grid on
subplot(212)
plot(w/pi,20*log(abs(H)));
ylabel('dB'),axis([0,1,-80,0]),
xlabel('Frequency (pi)'),grid on

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -