MATLAB Answers

0

generation of time series by given spetrum( ifft)

Asked by DestroyNWO on 6 Nov 2012
Hello!
i am trying to generate a time serie from a given kaimal spectrum.i am using ifft function but propably not in the correct way.I made a code but if i reverse by calculating the spectrum of the output time serie it give me different results. here is how i do it: =============================================================================== close all
clear all
%altitude 70meters
z=70;
%parameters of kaimal spectrum
U=20;
u=1;
%frequency
f=-0.5:0.001:0.5;
%n parameter of kaimal spectrum
n=f*z/U;
%definition of kaimal spectrum
%results of kaimal spectrum
S=u^2*(52.5*z/U)./((1+33*n).^(5/3));
%StD of S
StD_S=std(S);
%figure of the spectrum
figure
loglog(f,2*pi*S)
%generation of time series
N=1000;
a=randn(1,N/2);
b=randn(1,N/2);
X=StD_S*(a+1i*b);
A=conj(X);
B=[X A(end:-1:1)];
C=abs(ifft(B));
figure
plot(C)
======================================================================
In generation of time serie i make a list of random complex number of N/2 length and multiply with the standard deviation of kaimail spectrum(i got it from theory that,so it sould be correct)
The problem i think is in ifft.
Thanks anyway

  0 Comments

Sign in to comment.

1 Answer

Answer by Dr. Seis
on 6 Nov 2012
Edited by Dr. Seis
on 6 Nov 2012

In your case, you have:
Nyq = 0.5; % Nyquist frequency
df = 0.001; % frequency increment
Therefore, your array containing frequencies should be:
f = -Nyq : df : Nyq-df;
If you have amplitudes at each one of the frequencies described above (stored as B), you will then perform the IFFT by:
C = abs(ifft(ifftshift(B)));

  0 Comments

Sign in to comment.