# Recover signal from its power spectral density

I was wondering whether we can recover a signal $x(t)$ from its power spectral density using signal processing techniques.

• This is a phase retrieval problem. – WDC Apr 8 at 16:51

Generally (in the absence of prior knowledge) , I don't think this could be done.

The PSD is the absolute value squared of the DFT of the signal, and the abs function is not 1-to-1. For example abs(x) could be produced by f=x and f=-x.

However, if you have some prior knowledge about the signal then you could reconstruct it from the PSD. Without more knowledge of what you're trying to do I don't think I could help you.

• The PSD is not the absolute value of the DFT of the signal, it is the squared magnitude; not $|X[k]|$ but $|X[k]|^2$. But the conclusion that the signal cannot be recovered from the PSD (or its iDFT the autocorrelation function) is correct. See, for example, this question for why the attempt via autocorrelation fails. – Dilip Sarwate Sep 28 '13 at 15:46
• Note that for the special case of audio, where human hearing is mostly insensitive to phase information, you may be able to generate a reasonable approximation of the original signal such that a human listener will not be able to tell the difference between the approximation and the original. – Paul R Sep 29 '13 at 11:38

I figured this out by making up a N=2 signal, X, e.g. (matlab) X = [2 3]'; and then doing its sample autocorrelation by hand. I used Marple's 1987 text. Then I did N=3 version and N=4 and saw the pattern.

Here's matlab code to do it

clear all;
close all;
Xm(:,1) = [3 1 4 6 9 3 6 1 2 -55 6 3]'; %original signal
N = length(Xm(:,1));
mu = sum(Xm(:,1))/N; % get the sample mean

var = 0;
for i=1:N
var = var + (Xm(i,1)-mu)^2;
end
var = var / N; % get the sample variance

% first col of X has the adjusted signal, and we'll put our recovered X in
% the second column so they're easy to compare.

X(:,1) = Xm(:,1) - mu;
R = autocorr(X(:,1), N-1);

C = R * var; % this is the denormalized autocovariance.
M = triu(toeplitz(X(:,1))); % C = MX (the first col of X, actually)

X(:,2) = N*inv(M)*C;
Xrec = X(:,2)+mu; % this is the recovered Xm.