generation of time series by given spetrum( ifft)
1 visualizzazione (ultimi 30 giorni)
Mostra commenti meno recenti
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 Commenti
Risposte (1)
Dr. Seis
il 6 Nov 2012
Modificato: Dr. Seis
il 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 Commenti
Vedere anche
Categorie
Scopri di più su Signal Generation and Preprocessing in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!