# Interpreting magnitude of DFT results

I'm working on creating a simple program to render spectrograms like this one. In this plot, the X-axis is time, the Y-axis is frequency, and the color represents the magnitude of the DFT at that frequency and time.

I have most of this working, but I'm not exactly sure how to interpret the magnitude value. I'm computing it as follows:

real * real + imaginary * imaginary

(Note that I'm not square rooting it, since Wikipedia indicates that the spectrogram should be related to the square of the magnitude.)

I've seen certain spectrograms which work with magnitude on the dBFS scale. What's the process to translate these magnitudes to this scale? Or, alternatively, is there some easier way to go about this?

• That's more or less the idea I had at first, but it's not clear to me what is the possible range of log(re*re + im*im)? I need to know that range in order to scale the numbers to a different range. Aug 30 '14 at 21:22