I have the equation of the power spectral density $S(f)$. I seek $(H,f)$ of each sinusoid which $H$ is the magnitude and $f$ is the frequency.
How to calculate $H$ from $S(f)$?
$S(f)$ is the spectral density of a random signal; the Fourier Transform of the autocorrelation function of the time series.
To reproduce a time series, I need (H, T) for each regular sinusoidal component.
I calculated the time series eta(x,t) = sum(H/2 * cos(kx-2pift + phi))
The random phase (phi) with radians unit is randomly distributed between [-pi, pi]. Phi = 2pi(rand(1,length(F))-0.5), where F here is the wave frequency.
S(f) is the spectral density of random signal. So it was the fast Fourier transformation of the autocorrelation function of the time series.
to reproduce a time series, I need $(H, T)$ for each regular wave.
Than I calculate the time series eta (x,t) = sum(H/2 * cos(k*x-2*pi*f*t + phi))
The random phase (phi) with radians unit is randomly distributed between [-pi, pi]
.
Phi = 2*pi*(rand(1,length(F))-0.5)
, where F
here is the wave frequency.
I wish it was more clearly.