InverseSpectrogram

InverseSpectrogram[data]

reconstructs the signal from the magnitude spectrogram data.

InverseSpectrogram[img]

reconstructs the signal, assuming that the image img is the magnitude spectrogram.

InverseSpectrogram[input,n]

assumes the spectrogram data was computed with partitions of length n.

InverseSpectrogram[input,n,d]

assumes partitions with offset d.

InverseSpectrogram[input,n,d,wfun]

assumes a smoothing window wfun was applied to each partition.

Details and Options

  • InverseSpectrogram approximates an inverse of the magnitude spectrogram.
  • To compute the short-time Fourier transform of lists and audio signals, use ShortTimeFourier.
  • InverseSpectrogram assumes that real matrix input is a magnitude spectrogram without the redundant part. This means that the window size used was 2(size-1), where size is the second dimension of the input matrix.
  • The inverse spectrogram can be computed from the spectrogram if the offset d is smaller than half the size of the partition length n.
  • The following options can be given:
  • FourierParameters{1,-1}Fourier parameters to be used
    MaxIterationsAutomaticmaximum number of iterations
    MethodAutomaticthe method to use
  • Possible method settings include:
  • Automaticuses automatic method
    "GriffinLim"iteratively approximates the phase
    "SPSI"uses single-pass spectrogram inversion
    "Hybrid"uses the SPSI as the inital phase for GriffinLim
  • The "Hybrid" method is used by default.

Examples

Basic Examples  (2)

Reconstruct a signal from its magnitude spectrum:

In[2]:=
Click for copyable input
Out[2]=
In[3]:=
Click for copyable input
Out[3]=

Construct an Audio object from an Image:

In[1]:=
Click for copyable input
Out[1]=

Compute the spectrogram of the resulting signal:

In[2]:=
Click for copyable input
Out[2]=
Introduced in 2019
(12.0)