1
$\begingroup$

I have a signal's spectrogram and frequency spectrum (which, if i'm not mistaken, is its the signal's fourier transform) as given below:

Spectrogram (top) and Frequency Spectrum (bottom)

I understand that the spectrogram plots the frequency (y-axis) vs time (x-axis) and that the colors represent the amplitude. I also understand the frequency spectrum as the plot of amplitude vs. frequency. But I'm not quite sure how to produce one graph from the other. Since there is no time axis on the frequency spectrum, surmise that it is impossible to create the spectrogram from a frequency spectrum. It seems plausible to derive the frequency spectrum from the spectrogram, but I'm not quite sure how to remove the time parameter.

Any help with this would be greatly appreciated.

$\endgroup$

2 Answers 2

2
$\begingroup$

The data that when colored produces one vertical slice of your spectrogram image is a spectrum. If you have the color mapping function, and it is invertible, you could take the array of colors from one vertical column in a spectrogram and attempt to produce the original spectrum for that point in time. But the inversion process would likely be lossy, since there are usually less quantized colors than spectrum amplitudes.

Since a spectrum is only one vertical slice of a spectrogram, a spectrogram produced from just one spectrum would only be something like 1 pixel wide, thus not very useful. But a bunch of spectrums at evenly spaced time increments could be used to produce a wider spectrogram.

Also note that due to time-frequency-resolution trade-offs, the width of time data used for each FFT/DFT spectrum array can be different between spectrum and spectrogram analysis presentations.

$\endgroup$
3
  • $\begingroup$ I see... so, you are saying that the frequency spectrum does not summarize the data over the entire time frame? It is just the data at one particular time? I was under the impression that the frequency spectrum some how encapsulates the data over the entire time frame. Am I mistaken? $\endgroup$
    – Paul
    Oct 14, 2012 at 20:29
  • $\begingroup$ The time encapsulated by a spectrum is a parameter, could be from a tiny instant to the entire data frame (essentially complex averaging or summing all the smaller sub-frames). $\endgroup$
    – hotpaw2
    Oct 14, 2012 at 21:05
  • $\begingroup$ So, you're saying that it could be done either way and that there isn't really a way to determine which way it is just by looking at these graphs? $\endgroup$
    – Paul
    Oct 15, 2012 at 2:37
2
$\begingroup$

If you know the parameters that generated the spectrogram (time-frequency image) and you have the magnitude + phase information of the short-time Fourier transform (STFT), you can reconstruct the time domain signal and then calculate its DFT.

If you all have is the magnitude squared of the STFT (i.e. the spectrogram) then inversion is ill-posed. One option is to build ``fake'' phase values into it. Also see the paper by Griffin and Lim (1984) on STFT inversion.

Similarly, going from the magnitude frequency spectrum (magnitide of DFT) to time domain is ill-posed, if you don't have any phase information. If you do have phase information, then you can get the time domain signal and then calculate its spectrogram.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.