parqet
Newbie level 1
PSD problem
Here is the problem. I generated a gaussian stationary signal from a know power spectral density, using a monte carlo method
x(t)= sum(sqrt(2*Sx(ωk)*Δω) * [cos(wk*t+randomphase)])
where: Sx is a double-sided spectral density
ωk is the k-th angular velocity and
Δω is ang. velocity resolution
Naturally x(t) is a descrete signal.
Just to test it, I tried to calculate PSD back from the generated signal x(t). I used FFt alghoritm and calculated the power spectral density as
X=fft(x);
Sx=X*conj(X)/N = |X|^2/N,
where N is a number of samples.
Since it is a random signal I calculated several PSD from several smaller portions of the sample, averaging them into one final PSD, and also used the Hanning window to deal with leakage.
The problem is, that the acquired PSD has the same shape as the one used in the beginning to generate the signal, but the values are substantially different (~60 times different). Where did I go wrong?
Here is the problem. I generated a gaussian stationary signal from a know power spectral density, using a monte carlo method
x(t)= sum(sqrt(2*Sx(ωk)*Δω) * [cos(wk*t+randomphase)])
where: Sx is a double-sided spectral density
ωk is the k-th angular velocity and
Δω is ang. velocity resolution
Naturally x(t) is a descrete signal.
Just to test it, I tried to calculate PSD back from the generated signal x(t). I used FFt alghoritm and calculated the power spectral density as
X=fft(x);
Sx=X*conj(X)/N = |X|^2/N,
where N is a number of samples.
Since it is a random signal I calculated several PSD from several smaller portions of the sample, averaging them into one final PSD, and also used the Hanning window to deal with leakage.
The problem is, that the acquired PSD has the same shape as the one used in the beginning to generate the signal, but the values are substantially different (~60 times different). Where did I go wrong?