How to plot frequency response, phase response from transfer function

9 ビュー (過去 30 日間)
shahril majid
shahril majid 2022 年 7 月 8 日
コメント済み: Paul 2022 年 7 月 9 日
How to plot frequency response, phase response, and pole-zero plot using mathlab
  5 件のコメント
shahril majid
shahril majid 2022 年 7 月 8 日
https://www.mathworks.com/matlabcentral/answers/498096-how-i-can-plot-the-magnitude-and-phase-response-of-the-transfer-function

サインインしてコメントする。

回答 (1 件)

Sam Chak
Sam Chak 2022 年 7 月 8 日
Thanks for link. I used the code and it works. Now, try yours.
z = tf('z',-1);
H = tf((0.0534*(1+z^-1)*(1-10166*z^-1 + z^-2))/((1-0.683*z^-1)*(1-1.4461*z^-1+0.7957*z^-2)))
H = 0.0534 z^8 - 542.8 z^7 - 542.8 z^6 + 0.0534 z^5 ----------------------------------------------- z^8 - 2.129 z^7 + 1.783 z^6 - 0.5435 z^5 Sample time: unspecified Discrete-time transfer function.
H.Variable = 'z^-1'
H = 0.0534 - 542.8 z^-1 - 542.8 z^-2 + 0.0534 z^-3 ---------------------------------------------- 1 - 2.129 z^-1 + 1.783 z^-2 - 0.5435 z^-3 Sample time: unspecified Discrete-time transfer function.
num_zinv = H.Numerator{:}
num_zinv = 1×4
0.0534 -542.8110 -542.8110 0.0534
den_zinv = H.Denominator{:}
den_zinv = 1×4
1.0000 -2.1291 1.7834 -0.5435
figure
freqz(num_zinv, den_zinv, 2^14)
  11 件のコメント
Sam Chak
Sam Chak 2022 年 7 月 9 日
It's good to hear that it works out. You can actually copy and paste the entire MATLAB code to the Editor and Run (click on the green Play button) the program from there. f you find this mini tutorial is helpful, please consider accepting ✔ and voting 👍 the Answer. You are encouraged to complete the MATLAB Onramp Tutorial for Beginners.
Paul
Paul 2022 年 7 月 9 日
Another option that might be easier to enter if less visually appealing at the command line:
H = tf([1 2 1],[3.1414 0 0.585],-1,'Variable','z^-1')
H = 1 + 2 z^-1 + z^-2 ------------------ 3.141 + 0.585 z^-2 Sample time: unspecified Discrete-time transfer function.

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeMATLAB についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by