wrong running average parameter calculation
Hello,
How can I calculate the dsp data values for running average.
The help file say following for : 1-RMSTC / (10*Fs)
Comparing the calculated value for
Fs = 48000
RMSTC = 5000
the result is 0.9895833, but result from Sigmastudio is 0.024275.
I get the same wrong results for other calculations.
What's the correct formula for RMS TC ?
Hi,
I checked the wiki but the incorrect formula is there also. Empirically it appears to be approximately:
Parameter = RMSTC / (4.3*Fs)
Bob
Hi Bob,
thank you for your fast answer. Is it possible to give (later) the correct formula please.
I've done in my micrcontroller code some unittests, that checks the (generated) dsp data words.
Also I've found that the first and last dsp data word (4 Bytes) are in 5.23 format
but the second dsp data word (4 Bytes) has to be send in 2.80 format.
Hi Barricade,
JeradL provides the exact formula in the post https://ez.analog.com/message/14502
(this is for the limiter block, but the RMSTC calculation for all the dynamic blocks is the same).
Parameter = abs(1.0 - 10^(RMSTC/(10*fs))) (edited 6/2/2013)
This one works, as shown in the table below:
The exact formula's downside is it involves a 10^x function, which hopefully is available in your micro's C compiler. I honestly don't understand why my empirical formula (with only a simple division) comes close. There must be a theoretical connection between the two, but I'll have to leave that to some curious soul who had decent math professors in college.
As you correctly noted, the middle parameter is in integer (28.0) format. In general, parameter inputs are in whatever form is most convenient tor the runtime DSP algorithm, to save on instructions.
Best regards,
Bob
Message was edited to add brackets to the exact formula
Thanks Bob. I was just about to dig into the code to find this, but luckily Jerad already posted it!
Hello Brett and Bob,
thank you for your investigation. But I think there is another small error.
Checking the formula against the sigma studio results give for me:
Parameter = abs(1.0 - 10^(RMSTC/(10*fs)))
Please look at the brackets around (10*fs) ! Can you please check this ?
Best regards
Hi Brett and Barricade,
Absolutely, the extra brackets prevent confusion with the order of operations. Thanks for catching this! I edited my post above to add them.
Best regards,
Bob
Please log in to reply.

