How can I get a bode magnitude to be a certain size vector?

3 ビュー (過去 30 日間)
jrz
jrz 2022 年 9 月 24 日
コメント済み: Star Strider 2022 年 9 月 25 日
I've generated a transfer function, from which I need the magnitude as a vector to perform some integration on. The magnitude needs to be multiplied by a PSD (power spectral density) and then integrated using trapz(). The issue is that the PSD and magnitude vectors are different lengths, so trapz doesnt work. Is there a way I can specify the size of the magnitude vector so that is its a 1x10000 column vector? Below is my transfer function and how I have extracted the magnitude vector.
tf =
0.0001121 s^3 - 0.000292 s^2 - 0.0002738 s - 1.711e-05
------------------------------------------------------
s^4 + 5.701 s^3 + 20.31 s^2 + 0.6124 s + 0.3877
% Continuous-time transfer function.
[mag phase] = bode(tf)
MAG = sqeeze(mag)

採用された回答

Star Strider
Star Strider 2022 年 9 月 24 日
The bode function allows you to specify a vector of frequencies in radians/time_unit.. See the documentation section on Bode Plot at Specified Frequencies and w for details. That way, you can control the size of the output.
  2 件のコメント
jrz
jrz 2022 年 9 月 25 日
Thank you veyr much for your answer, it worked
Star Strider
Star Strider 2022 年 9 月 25 日
As always, my pleasure!

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeNumerical Integration and Differentiation についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by