In analogy with the 8-bit grayscale image color depth, in which the intensity of a sample pixel is normalized to a value between 0 and 255 by taking into account the minimum and maximum intensities present in the original image, is there a standard for normalizing the powers/magnitudes (of short time Fourier transform buckets) in spectrograms of audio samples?

(I am new to audio signal processing, so please let me know if my question does not make sense.)

  • $\begingroup$ Maybe your assumption of a "8 bit standard" is flawed. I wouldn't see this as a standard. There are also images with different gray scale depths, see for example DICOM, which is a standard image format in the medical field. It usually has 12 to 16 bit. So probably you will also find various possibilities in the audio field. $\endgroup$ – M529 Apr 21 at 6:59

there isn’t any one solution to this problem. the application governs the solution.

There are a few issues associated with mapping a DFT bin from a STFT calculation to a pixel on a display.

In many applications, the spectra tends to fall off with increasing frequency. The low frequencies tend to dominate in the signal. Spectral leakage can cause these low frequencies to mask the high frequencies. Picking an appropriate window is important. Whitening your signal prior to taking DFTs is usually a good idea and can help picking a proper window. The window influences your overlap fraction.

One can also do some short term averages (of power) in time of sequential spectra to help improve SNR for some classes of signals. This also compresses spectra in time which saves display bits.

One issue is gray scale or colors? This influences how many pixel bits you have. Color gives you more bits to map to but one needs to tune a color map.

Color is useful for overlays on gray scale like cursors.

Using the log of intensity (dB) does a very good job of mapping the dynamic range out a FFT to the range of a display pixel.

A fixed point FFT can be easier to map to pixels over a floating point FFT.

One reason that there isn’t a standard display technique is that display technology keeps advancing. I first did this sort of display with a total of 480 bits across.

One trick is to set all the pixels below a threshold (like a median) to zero. This cuts down a lot of clutter. Scene complexity can cut either way.

I would recommend that making your spectra flatter over frequency is worth the effort.

One should also think about the interactions a user will have with the STFT image. Things like zoom, drill down, harmonic cursors, measurements like time differences and frequencies, ......


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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