畫frequency response和phase response(MATLAB))


修DSP時有學到system的frequency response,想要以matlab tool來畫增強對frequency response的感覺,以下以moving average system來當作例子:
matlab code(frequency response)如下:

omega = -2*pi:pi/400:2*pi;
H5 = ((1/5)*(1-exp(-1i*omega*5))./(1-exp(-1i*omega)));
plot(omega,abs(H5)), title('frequency response');

結果的圖如下

matlab code(phase response)如下:

omega = -2*pi:pi/400:2*pi;
H5 = ((1/5)*(1-exp(-1i*omega*5))./(1-exp(-1i*omega)));
plot(omega,angle(H5)), title('Phase plot');

結果的圖如下

#matlab







你可能感興趣的文章

[#006] 344. Reverse String

[#006] 344. Reverse String

關於增進前端網頁的載入速度

關於增進前端網頁的載入速度

Fake Vapes and How to Avoid Them

Fake Vapes and How to Avoid Them






留言討論