MATLAB Answers

How can I plot the fast Fourier transform of a given step response

5 views (last 30 days)
Y77
Y77 on 21 Oct 2020
Answered: Milan Padhiyar on 29 Oct 2020
How can I plot the fast Fourier transform of a given step response as shwon in the atatched code & picture
And here is my code
clear; clc;close all;
s= tf('s');
num=1;
den=s*(s/10+1);
G= num/den;
H=1;
K2=sqrt(10); %K2
G2=G*K2;
closed_system2=feedback(G2,H);
step(closed_system2,H,'r');
hold on
K3=10; %K3
G3=G*K3;
closed_system3=feedback(G3,H);
step(closed_system3,H,'b');
grid on
title('Response to a refrence step input');
legend('step input @k=10^0.5','step input @k=10')

Answers (1)

Milan Padhiyar
Milan Padhiyar on 29 Oct 2020
Hello,
To plot a fast Fourier transform of the step response, first, you need to store the signal values.
Please find below command to store the output from the “step” command,
% y is the step response signal array and tOut represent the time array
[y,tOut] = step(sys)
Please find the following documents that show how to use “fft” command to find the fast Fourier transform and how to plot that.
I hope this help you to resolve your query.
Thanks

Community Treasure Hunt

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

Start Hunting!

Translated by