notch.m

来自「用于DSK5416的程序」· M 代码 · 共 18 行

M
18
字号
%
%  notch.m - Magnitude response of a notch filter
%
w0=0.2*pi;			% Define constants

% Define the transfer function H(z)
b(1)=1; b(2)=-2*cos(w0); b(3)=1;

% Calculate the magnitude response of H(z)
[h,w]=freqz(b,1,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 + -
显示快捷键?