mag_res.m
来自「用dsp解压mp3程序的算法」· M 代码 · 共 15 行
M
15 行
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% mag_res.m - Magnitude response of first-order IIR filter
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
alpha = 0.25; N = 64;
b = [alpha]; % coefficient vector of numerator
a = [1 -(1-alpha)]; % coefficient vector of denominator
H = freqz(b, a, N); % frequency response of filter
magX=20*log10(abs(H)); % compute magnitude response in dB
plot(magX); axis([1 N/2 -inf inf]);
title('Magnitude response');
xlabel('Frequency index'), ylabel('Magnitude, dB');
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?