Generate a time series from power spectral density

조회 수: 47 (최근 30일)
Uwais
Uwais 2024년 4월 24일
댓글: Star Strider 2024년 4월 25일
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
Star Strider
Star Strider 2024년 4월 24일
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 2024년 4월 24일
I see. How about I add a random phase? I dont mind if i dont recover the true time signal.

댓글을 달려면 로그인하십시오.

채택된 답변

Star Strider
Star Strider 2024년 4월 24일
편집: Star Strider 2024년 4월 25일
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
Uwais
Uwais 2024년 4월 25일
Thank you so much for the explanation.
Star Strider
Star Strider 2024년 4월 25일
@Uwais — As always, my pleasure!

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Parametric Spectral Estimation에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by