I am using adau1701.

I use a MCU to do some audio level value read back.

I have follow the below thread which solve half of my problem

http://ez.analog.com/thread/2278?tstart=0

Another problem I found is the different between using a peak envelope and RMS envelope.

I do a sine wave source, with a gain control, follow by a envelope block and finially the reading block.

I can get the reading correct when I use the peak envelope.

But when I use the RMS envelope, with the same equation,

I get -6dB when i didn't apply any gain.

I get -26dB when i apply a -10db gain.

If I apply a gain of -20dB, the reading is -46dB

If I apply a gain of -15dB, the reading is -36 dB

It is I have a base of -6 without any gain, and then the resulted reading is -6+(2*whatever gain I apply)

Is there any equation to get the value from RMS envelope to be correct?

What is the different between the two?

In the help file, look for Envelop RMS section, it clearly says,

"Mathematically speaking, RMS refers to the square root of the average of a set of values. This particular implementation of the algorithm however, outputs the "mean square" since it does not take the square root. If true RMS is required, connect and external Square root algorithm to find the RMS envelope of the signal"