r/controlengineering • u/AmbitiousAd6493 • Feb 16 '26
Time response from frequency data
Hello! I just saw a scientific paper that computes frequency response with the system's transfer function on a frequency band (for example, from [0.01 100]rad/s) and from that data they reconstruct the time domain data. Let's consider I want to compute the time domain response from a fractional model's step response G(s) = 1./(s.^0.5 +1) (therefore, the output Y(s) = 1./(s*(s^0.5+1))). If I wish to do this on a desired frequency band [0.001 100]rad/s, how to I proceed? I give here the part of the code I managed to figure out so far:
w = linspace(0.001,100,2000) %frequency vector
s = j*w;
G= 1./(s.^0.5 +1); %transfer function frequency response
U=1./s; %step input frequency response
Y=G.*U; %output in the frequency domain
If I just use ifft I get an absurd response that doesn't correspond to the real step response. I appreciate any possible help
View all comments
Show parent comment
1
u/Barnowl93 Feb 19 '26
I've pasted my code below as I do get a reasonable "step" response, but let's go through some potential differences:
wmax = 100;N = 2^18;dw = 2*wmax/N;k = (-N/2):(N/2-1);w = k*dw;sigma = 0.1;s = sigma + 1j*w;Y = 1 ./ ( s .* (s.^0.5 + 1) );%Windowwin = hann(N).';Yw = Y .* win;% Invert Fourier and apply exp(sigma*t)dt = 2*pi/(N*dw);t = (0:N-1)*dt;y_band = (N*dw/(2*pi)) * ifft(ifftshift(Yw), 'symmetric');y = exp(sigma*t) .* y_band;% Ground truthy_true = 1 - exp(t).*erfc(sqrt(t));plot(t, y, t, y_true, '--'), grid onxlabel('t (s)'), ylabel('y(t)')xlim([0 50])