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

19 views (last 30 days)
Y77 on 21 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') 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.
Thanks