Evaluate for specific frequencies using freqs
14 ビュー (過去 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
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
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)
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.)
.
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Digital Filter Analysis についてさらに検索
製品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
