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

📄 高通.m

📁 butterworth 的其他滤波器!
💻 M
字号:
% /////////////////巴特沃兹高通滤波器/////////////////////////
% Fp=700Hz; Fs=500Hz, Rp=1dB; Rs=32dB; FT=2kHz;
% 归一化角频率wp=2*pi*Fp/FT;  ws=2*pi*Fs/FT;
% ================双线型变换法===============================
Fp=700;    Fs=500;   FT=2000;
Rp=1;        Rs=32; 

wp=(2*pi*Fp)/FT;           ws=(2*pi*Fs)/FT;
Wp=tan(wp/2);            Ws=tan(ws/2);
WP=1;                    WS=WP*Wp/Ws;

[N,Wn]=buttord(WP,WS,Rp,Rs,'s');
[B,A]=butter(N,Wn,'s');
[BT,AT]=lp2hp(B,A,WS);
[num,den]=bilinear(BT,AT,0.5);
[h,omega]=freqz(num,den,64);

subplot(2,1,1);stem(omega/pi,abs(h));grid;axis([0 1 0 1]);
xlabel('双线性法\omega/\pi');ylabel('|H(z)|');

subplot(2,1,2);stem(omega/pi,20*log10(abs(h)));
grid;axis([0 1 -300 0]);

xlabel('双线性法\omega/\pi');ylabel('增益.dB');

% ====================直接法=============================
figure
wp=2*Fp/FT;           ws=2*Fs/FT;

[N,Wn]=buttord(wp,ws,Rp,Rs);
[B,A]=butter(N,Wn,'high');
[h,omega]=freqz(B,A,64);

subplot(2,1,1);stem(omega/pi,abs(h));grid;
xlabel('直接法\omega/\pi');ylabel('|H(z)|');

subplot(2,1,2);stem(omega/pi,20*log10(abs(h)));grid;
xlabel('直接法\omega/\pi');ylabel('增益.dB');

⌨️ 快捷键说明

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