p3_1.m

来自「《数字信号处理实验指导书(MATLAB 版)》 著者: (美)米特拉著 」· M 代码 · 共 30 行

M
30
字号
% Program P3_1% Evaluation of the DTFT clf;% Compute the frequency samples of the DTFTw = -4*pi:8*pi/511:4*pi;num = [2 1];den = [1 -0.6];h = freqz(num, den, w);% Plot the DTFTsubplot(2,1,1)plot(w/pi,real(h));gridtitle('Real part of H(e^{j\omega})')xlabel('\omega /\pi');ylabel('Amplitude');subplot(2,1,2)plot(w/pi,imag(h));gridtitle('Imaginary part of H(e^{j\omega})')xlabel('\omega /\pi');ylabel('Amplitude');pausesubplot(2,1,1)plot(w/pi,abs(h));gridtitle('Magnitude Spectrum |H(e^{j\omega})|')xlabel('\omega /\pi');ylabel('Amplitude');subplot(2,1,2)plot(w/pi,angle(h));gridtitle('Phase Spectrum arg[H(e^{j\omega})]')xlabel('\omega /\pi');ylabel('Phase in radians');

⌨️ 快捷键说明

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