# How to reconstruct a sound from magnitude spectrogram?

I have an audio magnitude spectrogram but I don't have the phase, try to randomize the phases of each container and then make a reverse fourier, but only pure noise is heard

How can I reconstruct the phase information so that the audio is heard somewhat decent.

Anyone know an algorithm that does this?

• I know that if you use a Gaussian window there is a direct mathematical relationship between magnitude and phase. I’ve done the paper derivation before but it was years ago. Maybe someone here knows of a reference to the relationship? Aug 19 '19 at 13:33

In general the whole complex Fourier transform is needed to reconstruct the time domain signal.

However, it's possible to reconstruct a real signal it from its Fourier transform magnitude alone (or phase alone) by using some iterative techniques, or very large matrix solutions.

Have a look at the papers by Monson Hayes...

Your question is at the heart of a still-current topic in signal processing or image analysis, often under the names phaseless recovery or phase retrieval.

For instance, in January 2019, Yoshiki Masuyama et al. published a paper on phase recovery from amplitude spectrograms: Griffin-Lim like phase recovery via alternating direction method of multipliers (Signal Processing Letters). Once again, deep learning kicked in data processing: the Yoshiki Masuyama et al. published a conference paper (ICASSP 2019, May) on Deep Griffin–Lim Iteration.

Some Matlab code is provided on Yoshiki Masuyama web page, with the abbreviation ADMMGLA --- alternating direction method of multipliers (ADMM) and Griffin–Lim algorithm (GLA).

You can find older references, with keyword "spectrogram inversion", like the Phase Retrieval Toolbox for LTFAT, the The Large Time-Frequency Analysis Toolbox.

• actually the basic exact algorithm for signal recovery from phase alone (or magnitude vice versa) is quite old & simple and I have it implemented in my matlab. But it requires a very large matrix solution... Hence, new iterative techniques are investigated instead possibly. Aug 19 '19 at 16:16
• Implementing the basic version is something I should have done, which I did not. Which reference did you use? Aug 19 '19 at 16:24
• From the book 2D signal and image processing Jae S Lim ch.1 gives a definition... Aug 19 '19 at 16:29
• here the link: i65.tinypic.com/15p3mv9.jpg Aug 19 '19 at 16:40
• Retrieved, excellent Aug 19 '19 at 16:45