I am trying to draw a spectrogram from FFT data I get from audio files. The problem is that I can't figure out is what the yielded power (decibels) are relative to. I'm getting some arbitrary -100db-ish numbers, but I don't understand how I can have them represent a finite intensity-scale.

enter image description here

If I have a gradient which will represent the intensity of these numbers, where silence is black and the maximum is yellow I need to know what the maximum is. I'm really not good in the DSP-area so help would be appreciated.


3 Answers 3


For audio files you want to use dBFS, dB relative to full scale:


  • $\begingroup$ Ah this made it look so much better! Though I saw this formula at the stack-exchange 'valueDBFS = 20*log10(abs(value)/maxValue)' and I'm wondering what the maxvalue is supposed to be? Currently I have the maxvalue to be set of the songs maximum reached magnitude. Is this the correct way? $\endgroup$
    – Tokfrans
    Jun 18, 2015 at 0:01
  • $\begingroup$ Any more explanation would be appreciated in order to expand your answer. $\endgroup$
    – jojeck
    Jun 18, 2015 at 6:31
  • $\begingroup$ Full scale for an audio file format is the highest amplitude that can be represented by the format. If you're reading raw PCM frames from a wav file, this will depend on the bit depth: $\endgroup$
    – Daverz
    Jul 22, 2017 at 1:11

An accurate FFT should give you an estimate of the volume of the component sines contained in one area of the sound graph. If you have 3 sines playing of energy level 0.33 of max SPL, and the FFT shows 3 peaks, there should be 3 peaks who's value is 0.33. the values will be averaged in F and T, however the ideal theoretical value is the real value of the individual sines that make up the sound, or the sum of the sines that cohabit that area of the graph.


dB are in fact meaningless units on their own. They are a ratio unit, so for dB to be meaningful, it needs to be computed within a context. For example, dB SPL (sound pressure level) is computed with respect to the pressure of 20 micropascals, which is the threshold of audibility in terms of sound pressure.



Your Answer

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

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