Generate a time series from power spectral density

I have a force PSD of 2X2X63 acting at 2 points of 63 frequencies defined. For each frequency, there is a 2x2 matrix representing the auto and cross variances of the force. I want to construct a time signal of 2xN size where N is the size of the time signal. How do I do it?

4 comentarios

so that means you have 2 forces signals to generate - otherwise there should be only a autopower (no cross term)
Uwais
Uwais el 24 de Abr. de 2024
Editada: Uwais el 24 de Abr. de 2024
Yes! That is correct. This is why I specified that i want to generate a 2xN size time signal
It is not possible to invert a power spectral density signal. First, the units are in dB/Hz, and second, all the phase information is missing.
Uwais
Uwais el 24 de Abr. de 2024
I see. How about I add a random phase? I dont mind if i dont recover the true time signal.

Iniciar sesión para comentar.

 Respuesta aceptada

Star Strider
Star Strider el 24 de Abr. de 2024
Editada: Star Strider el 25 de Abr. de 2024
In that event, just create a sine curve of the appropriate frequency or frequencies as determined by the PSD result. This will be a ‘synthesis’ rather than a true inversion, however it is likely as close as you can get with only the PSD and frequency vectors.
Illustrating that —
psd_freq = 0:500;
gp = @(x,d) exp(-(x-d).^2/200);
psd_mag = sum(cell2mat(arrayfun(@(d)gp(psd_freq,d), [10 50 120 250 450], 'Unif',0).')) + 0.01;
figure
plot(psd_freq, psd_mag)
grid
title('Original PSD')
figure
plot(psd_freq, mag2db(psd_mag))
grid
title('Original PSD (dB)')
Fs = max(psd_freq)*2; % Calculated Sampling Frequency (Hz)
L = 5.25; % Length Of Signal (s)
t = linspace(0, Fs*L, Fs*L+1)/Fs; % Time Vector
s = psd_mag(:).*sin(2*pi*t.*psd_freq(:)); % Synthesized Signal Matrix
s = sum(s); % Create One Vector, Add Noise
figure
plot(t, s)
grid
xlim([min(t) max(t)])
xlabel('Time')
ylabel('Amplitude')
figure
pwelch(s,[],[],[],Fs)
Calculatng the PSD of the synthesized signal is not a perfect reproduction of the original PSD, however is reasonably close to it. That implies that the reconstructed time-domain signal is probably representative of the original time-domain signal that created the original PSD. It is not possible to determine how closely the reconstructed time-domain signal reproduces the original time-domain signal without having the original to compare it with.
I encourage you to experiment with this idea.
EDIT — (25 Apr 2024 at 06:10)
Simplified code, expanded discussion.
.

3 comentarios

hmm
I am always a bit worried when I see those two words in the same sentence : PSD and sine wave
theoretically the psd of a sine wave has finite power, zero bandwith and the psd amplitude is infinite. In other words it's a dirac at the carrier frequency
of course as we do fft of finite duration the df is never zero ,so the dirac get's approximated by a rectangular pulse with width = df width and xxx amplitude , and yes the power (= the integral of the rect pulse) is the "true" power that you can directly compute from the sine amplitude (if you have access to the time signal)
we simply have to remember that numerical approximation , and not be surprised by the fact that your psd amplitude (for a sine wave) will depend of the df
just my 2 cents
Uwais
Uwais el 25 de Abr. de 2024
Thank you so much for the explanation.
@Uwais — As always, my pleasure!

Iniciar sesión para comentar.

Más respuestas (0)

Etiquetas

Preguntada:

el 24 de Abr. de 2024

Comentada:

el 25 de Abr. de 2024

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by