exa060702_2.m
来自「内部包含了各种滤波器的设计」· M 代码 · 共 23 行
M
23 行
%--------------------------------------------------------------------------
% exa060702_2 , for example 6.6.2 and 6.7.2;
% to test buttord.m and butter.m;
% to design a Butterworth Bandpass digital filter.
% -------------------------------------------------------------------------
clear;
fp=[300 400];fs=[200 500];
rp=3;rs=18;
Fs=2000;
wp=fp*2*pi/Fs;ws=fs*2*pi/Fs;
%
% 求出阶次;
[n,wn]=buttord(wp/pi,ws/pi,rp,rs);
% 再设计 Butterworth 带通滤波器;
[b,a]=butter(n,wp/pi)
[h,w]=freqz(b,a,256,Fs);
h=20*log10(abs(h));
plot(w,h);grid;
ylabel('Bandpass DF')
xlabel(' Hz')
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?