The information on this page needs to be verified for validity.
What is RMS
The Root Mean Square is a way to express the actual sound pressure of a piece of audio. It is a sort of averaging method that suits audio well.
Calculating and displaying RMS
- Select a 50 ms piece of audio (uncertain here, please confirm)
- take each sample and multiply it by itself
- take all those resulting values and add them
- divide that by the amount of samples added (let's call that value "x")
- x = sqrtf(x);
- silence is now 0.00, and the max (0 dB) point is 1.00 (but higher vales CAN occur in Buzz!)
- scale this to the size of the graphics, leaving some space for the headroom (e.g. +6 dB)
If you want the RMS value scaled onto the x^3 curve as suggested by JoaCHIP's audio gui design page, simply replace step 5 with x = powf(x, 1/6).