# How to recover $f(t)$ from Fourier Transform of its absolute value $\mathcal{F}|f(t)|$?

Let the Fourier Transform of a real signal, $f(t)$, be $\mathcal{F}(\omega)$. And the FT of the absolute value of the same signal, $|f(t)|$, be $\mathcal{F}(u)$.

Can $\mathcal{F}(w)$ be recovered from $\mathcal{F}(u)$?

For instance, the FT of $a \cdot \cos(ft)$ returns a spectrum in which the frequency $f$ has amplitude $a$.

Can $f$ and $a$ be recovered from the FT of $a \cdot \cos(ft)$?

• the FFT is the DFT implemented in a manner that is computationally efficient. the DFT operates on discrete-time sequences and yields discrete-frequency results. the DFT is not the same as the continuous Fourier Transform. might you want your question edited to reflect that? – robert bristow-johnson Oct 14 '16 at 1:57
• @robertbristow-johnson Thanks. I asked in terms of a DFT in order to be able to speak about the output as a discrete array of frequency bins. Otherwise, I don't think the distinction makes much difference for the question, though I could be wrong. But I'll change FFT to DFT for clarity. – Yaque Oct 14 '16 at 2:23
• not only are you wrong. you missed the whole point. – robert bristow-johnson Oct 14 '16 at 3:23
• @robertbristow-johnson I'd appreciate if you'd explain what I've missed. – Yaque Oct 14 '16 at 3:53
• The answer to this question has nothing to do with the Fourier transform. The question boils down to: can I recover $f(t)$ given $|f(t)|$? And in the general case the answer seems obvious. – Matt L. Oct 14 '16 at 7:08

I recently was pointed to a very nice trick by Robert Bristow Johnson which possibly applies here too to demonstrate this "inability" of recovery. I thought I'd share it here, in addition to the accepted answer.

The trick is to see $|x(n)|$ as $sgn(x(n)) \cdot x(n)$ where $sgn$ is a function that returns 1 for positive sign and -1 for negative sign. In the case of a sinusoid, this equals modulation of the sinusoid at some frequency $f_{sin}$ with a square waveform at the same frequency.

Multiplication in the time domain is equivalent to convolution in the frequency domain. The spectrum of a sinusoid is a spike at $\pm f_{sin}$. The spectrum of a square wave is a series of spikes starting at $f_{sin}$ and repeating at odd harmonics. Therefore, the spectrum of $|x(n)|$ when $x(n)$ is a sinusoid, is a shifted version of the square wave spectrum by $f_{sin}$. This gives us a component at double the $f_{sin}$ with a bit of DC. In other words, it does full rectification to the sinusoid and it now sounds at double the frequency. We will come back to this.

To ask whether we could recover the $x(n)$ from the $\mathcal{F}(|x(n)|) = \mathcal{F}(x(n) \cdot sgn(x(n)))$ is to ask if there is a monotonic function that realises the mapping:

$$\mathcal{F}(x(n)) = g\left(\mathcal{F}(x(n) \cdot sgn(x(n)))\right)$$

Which if we take one step further, it becomes:

$$\mathcal{F}(x(n)) = g\left(\mathcal{F}(x(n)) * \mathcal{F}(sgn(x(n)))\right)$$

And now we are in trouble, because:

$$\mathcal{F}(x(n)) * \mathcal{F}(sgn(x(n))) = \mathcal{F}(sgn(x(n))) * \mathcal{F}(x(n))$$

Therefore, our $g$ would produce the same output for two different values, which is not the definition of a monotonic function. In other words, you can synthesize the same spectrum in more than one ways.

Now, if you fix $x(n)$ to be a sinusoid, then you could say, I will deconvolve $x(n)$ and a square wave and I will recover the original signal provided that i could also fix the phase. It doesn't necessarily have to start from 0. But it doesn't matter, say you employ some iterative method and after a lot of prespiration you recover $x(n)$. You see here you only have two "actors" and you know both of them very well, so you can tell them appart easily.

BUT, in the general case of some $|x(n)|=sgn(x(n)) \cdot x(n)$, where you only have $|x(n)|$, you can't really tell what its $sgn(x(n))$ was before it was lost!

It's like looking at a photograph where the camera is shooting a scene through a mirror. Can you tell, just by looking at the photograph, if the camera was looking at the real scene OR the real scene through a mirror? Can you recover the "truth"? The mirror here is effected by the modulation function.

So, it is impossible to perform this recovery because it is the product of two components, one of which you have lost forever.

Hope this helps.

• This is a fantastically clear explanation.. thank you! – Yaque Oct 16 '16 at 18:46

Matt L.'s comment said it. Once you take the absolute value of the function, you lose its sign. Whatever you do to the result, like taking the Fourier transform, doesn't help. The information is lost.

It is not a part of your question, but the function could have known properties that enable recovery. If it is band-limited, like your cosine, then recovery is possible up to a sign ambiguity $f(t)$ vs. $-f(t)$. In other words, if you know the absolute value of a band-limited function at all times $t \in \mathbb{R}$, and if you know the sign of the function at time $t_1$, then you also know the sign of the function at time $t_2$. For an algorithm, see Gaurav Thakur (2010) "Reconstruction of Bandlimited Functions from Unsigned Samples".

• The article you linked is beyond my understanding, but the kind of thing I was looking for. Thanks. – Yaque Oct 14 '16 at 17:47