필터 지우기
필터 지우기

Make a bode plot without bode()?

조회 수: 42 (최근 30일)
Kebels3
Kebels3 2020년 3월 3일
편집: Rik 2021년 3월 4일
Is there a way to make a bode plot without using the function bode()?
This is the transfer function which i am working with
s = tf('s'); H = (s^3 + 2*s + 5)/(s^4+7*s^3+4*s^2+8*s+12)
  댓글 수: 4
Star Strider
Star Strider 2020년 3월 3일
Take the fft of the impulse output (get the time vector as well), then calculate the magnitude and phase and plot them.
Rik
Rik 2021년 3월 4일
Editing away your question is extremely rude. I will restore it from the Google cache.

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

답변 (1개)

Robert U
Robert U 2020년 3월 4일
편집: Robert U 2020년 3월 4일
Hi Jeroen von der Klip,
Your task sounds as you want to omit the use of a toolbox. Even though the control system toolbox offers much more extras with bode-command or bodeplot-command you can - of course - plot the transfer function from scratch.
% transfer function as anonymous function
H = @(s)(s.^3 + 2*s + 5)./(s.^4+7*s.^3+4*s.^2+8*s+12);
% frequency vector of domain to be evaluated
omega = 2 * pi * logspace(-3,3,1000);
% magnitude estimation
mag = abs(H(1j*omega));
magDB = 20 * log10(mag);
% phase estimation
phaseDeg = rad2deg( angle(H(1j*omega)) );
% plot results
fh = figure;
ah = subplot(2,1,1,'Parent',fh);
bh = subplot(2,1,2,'Parent',fh);
semilogx(ah,omega/2/pi,magDB)
semilogx(bh,omega/2/pi,phaseDeg)
ah.XGrid = 'on';
ah.YGrid = 'on';
bh.XGrid = 'on';
bh.YGrid = 'on';
ah.XLabel.String = 'frequency [Hz]';
ah.YLabel.String = 'magnitude [dB]';
bh.XLabel.String = 'frequency [Hz]';
bh.YLabel.String = 'phase angle [°]';
ah.Title.String = func2str(H);
Kind regards,
Robert

카테고리

Help CenterFile Exchange에서 Frequency-Domain Analysis에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by