1

First I use Audacity to perform an FFT of an audio clip with a rectangular window. Then I sum all the FFT bin values. Since the FFT bins are expressed in dB, I perform the "decibel sum" like this:

sum = 10*log10(10(bin1/10) + 10(bin2/10) + 10(bin3/10)...).

The resulting value is always identical or extremely close to Adobe Audition's "Total RMS Amplitude".

My Audition settings are set to full-scale sine=0dBFS. (Audacity, however, considers a full-scale square to be 0dBFS. So summing the bins results in an expected 3dB discrepancy).

Error seems to be very minimal (a few hundredths of a dB). But it only works this accurately when I use a rectangular window and with larger FFT sizes (2048+). My questions is: Why does this work? Does it always work? Intuitively it kind of makes sense but I can't figure out how RMS relates to FFT. Is there an easier way to calculate RMS amplitude (besides trusting Adobe)?

  • hmmm interesting question. will have to think about this. In the meantime, you'd also get some value from posting this on the DSP stack exchange site. – Mark Jul 12 at 8:10
  • In addition to Mark's answer, below, it should also work when appropriate windows are used (Hamming window, for example, with steady-state sounds). If the start and end of the rectangular window are at different amplitudes, it will cause a small amount of frequency domain leakage but the overall RMS amplitude should still be accurate. – Chris K8NVH Jul 12 at 10:46
  • See Parseval's Theorem. – Paul R Aug 12 at 9:21
0

I'm going to have a crack at this one - from the perspective that the translation between time-domain and frequency-domain samples (via FFT) does not make any changes to the overall energy of the audio, which is what RMS calculating.

You can go from Time domain to Frequency domain and then back to Time domain loss-lessly - without any changes to the sample values that you started with. So it follows that the 'energy' is conserved through the transformation.

It also follows that the energy (amplitude) of the frequency samples is therefore doing to be identical to the time-domain samples for the sample buffer you are working with.

Of course the right way to answer this is to perform a mathematical proof, but I'll have to have a right old ponder about this. In the meantime, it might be worth trying the DSP or the Mathematics stack.

Further to this, it's worth remembering that the input to and output from the FFT is a complex number. Obviously the imaginary part of the input is zero, but the imaginary part of the FFT is not insignificant and must be considered when calculating overall energy.

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.