Evaluate for specific frequencies using freqs

15 次查看(过去 30 天)
Hello all,
I have evaluated a specific system (with a transfer function) for a range of frequencies and successfully plotted the outputs for both phase and magnitude using freqs (Frequency response of analog filters). I would now like to evaluate my systems magnitdue and phase at a specifc frequency of approx 9.68 rad/s. How can I go about extracting this at the specific freuqncy value? The documentation was limited and I couldn't make any progress. I would appreciate any and all help.
Thank you.
  2 个评论
Star Strider
Star Strider 2021-10-29
This was originally Evaluate for specific frequencies using freqs and my Answer was initially accepted so I won’t delete it.
The (now deleted) text of the question asked to plot and return a specific frequency (9.68 rad/s) for a transfer function using freqs. The transfer function itself was not provided.
.

请先登录,再进行评论。

回答(1 个)

Star Strider
Star Strider 2021-10-26
Using an example from the freqs documentation —
a = [1 0.4 1];
b = [0.2 0.3 1];
w = logspace(-1,1.3);
h = freqs(b,a,w);
fp = 9.68;
hfp = freqs(b,a,[1;1]*fp)
hfp =
0.1923 - 0.0233i 0.1923 - 0.0233i
mag = abs(h);
phase = angle(h);
phasedeg = phase*180/pi;
subplot(2,1,1)
loglog(w,mag)
hold on
plot(fp, abs(hfp(1)),'+r')
hold off
grid on
xlabel('Frequency (rad/s)')
ylabel('Magnitude')
subplot(2,1,2)
semilogx(w,phasedeg)
hold on
plot(fp, rad2deg(angle(hfp(1))),'+r')
hold off
grid on
xlabel('Frequency (rad/s)')
ylabel('Phase (degrees)')
The magnitude and phase at the given frequency are plotted as red (+) signs. (Creating ‘fp’ as a vector is necessary in order to define it as a frequency.)
.

类别

Help CenterFile Exchange 中查找有关 Digital Filter Analysis 的更多信息

标签

产品

Community Treasure Hunt

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

Start Hunting!

Translated by