Evaluate for specific frequencies using freqs

조회 수: 14 (최근 30일)
N/A
N/A 2021년 10월 26일
댓글: Rena Berman 2021년 12월 13일
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.
.
Rena Berman
Rena Berman 2021년 12월 13일
(Answers Dev) Restored edit

댓글을 달려면 로그인하십시오.

답변 (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