ex8p21.m

来自「关于数字信号处理的一些matlab例程」· M 代码 · 共 19 行

M
19
字号
% Digital Filter Specifications:
wp=0.2*pi;              %           digital Passband freq in rad
ws=0.3*pi;              %           digital Stopband freq in rad
Rp=1;                   %           Passband ripple in dB
As=15;                  %           Stopband attenuation in dB
% Analog Prototype Specifications:
T=1;                    %              Set T=1
OmegaP=(2/T)*tan(wp/2); %              Prewarp Prototype Passband freq
OmegaS=(2/T)*tan(ws/2); %              Prewarp Prototype Stopband freq
% Analog Prototype Order Calculation:
N=ceil((log10((10^(Rp/10)-1)/(10^(As/10)-1)))/(2*log10(OmegaP/OmegaS)));
fprintf('\n***Butterworth Filter Order =%2.0f\n',N)
% **Butterworth Filter Order=6
OmegaC=OmegaP/((10^(Rp/10)-1)^(1/(2*N)));%Analog BW prototype cutoff
wn=2*atan((OmegaC*T)/2);          %Digital BW cutoff freq
% Digital Butterworth Filter Design:
wn=wn/pi;                     %          Digital Butter cutlff in pi units
[b,a]=butter(N,wn);
[b0,B,A]=dir2cas(b,a)    

⌨️ 快捷键说明

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