notch1.m
来自「用于DSK5416的程序」· M 代码 · 共 20 行
M
20 行
%
% notch1.m - Magnitude response of a notch filter
% with both zeros and poles
%
w0=0.2*pi; th0=w0; r=0.85; % Define constants
% Define the transfer function H(z)
b(1)=1; b(2)=-2*cos(w0); b(3)=1;
a(1)=1; a(2)=-2*r*cos(th0); a(3)=r*r;
% Calculate the magnitude response of H(z)
[h,w]=freqz(b,a,128); mag=20*log10(abs(h));
% Plot the magnitude response of H(z)
plot(w/pi/2,mag,'b-');
xlabel('Normalized frequency');
ylabel('Magnitude (dB)');
title('Magnitude response of transfer function H(z)');
grid;
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?