ADAU1761 - RMS Table RMS TC and Decay do not correspond when set to the same rate

I expect the output graph to look like the one at the bottom in the image, however, the result is asymmetrical like in the top graph in the image. Am I understanding the RMS Table settings incorrectly or...? 

  • 0
    •  Super User 
    on Apr 22, 2021 8:06 PM

         Hello Jeroen,

        The RMS Table block measures its input's RMS average level, then selects a table row according to this level in dB.  The table rows are 3 dB spaced from -93 to +3 dB, and in-between values are interpolated:

     Level      Row      RMS Input

    -93  dB      1          0.00002

    -90  dB      2          0.00003

         . . .

      0  dB      32         1.000

    +3  dB      33         1.414

         You can enter the table values manually or load / save them in a text file (which in turn can be pasted from a spreadsheet column).  I made a table with the RMS Input values shown above -- the resulting text file is attached below.  In the example below, both RMS Table blocks are loaded with this table.  The top trace shows that the block tracks its input linearly.  This is because both the table rows and the table values are 3 dB spaced.

         The bottom trace shows the response to a gated sine wave of 1.0 peak amplitude (0 dB), with both attack and decay set to 20 dB/s.  The result shows that:

    • The maximum indicated level is 0.71 (-3 dB) because the RMS value of a 1.0 peak sine wave is 0.71.
    • Both the attack and decay are "RC" or exponential in nature.
    • The decay appears to be somewhat faster than the 20 dB / s setting.
    • The attack is about twice as fast as the decay despite identical settings.

    Thus as you have observed, the attack and decay do not exactly correspond as one might expect.  

         It appears that your table entries are evenly spaced between rows.  Thus the RMS Table's output relates to dB.  This has the effect of making the decay appear linear, and it also exacerbates the visual discrepancy between attack and decay times.

         There's quite a few EngineerZone threads discussing the dB/s settings in various dynamic blocks -- some of which may be of interest to you.  The best way to find them is to search Google with an entry like this:

    RMS dB/s

         Best regards,


  • Hi Bob, Thank you very much for your detailed reply, this does clear some things up.

    I do however still have one related question that I didn't ask in the starting post. Would it somehow be possible to get a RMS TC and Decay of 4 dB/s?

    I posted the questions as a seperate thread aswell:

  • 0
    •  Super User 
    on May 14, 2021 12:39 AM in reply to JeroenRoth

         Hello Jeroen,

         As you have discovered, the RMS Table's RMS-TC  can't be set as slow as 4 dB/s.  One way around this is to have a fast envelope follower convert the input audio into a varying level.  We can then filter this to achieve the 4 dB/s characteristic, then feed the filtered signal into a RMS Table which works with this easily measured level.  An example is shown below:

        Even here we run into a problem with filter resolution.  4 dB/s works out to a 0.073 Hz filter -- and the filter frequency can only be set to the nearest 0.1 Hz.  A workaround is shown above.  The filter is enclosed in a loop which feeds back 99% of the filter's output and only 1% of the incoming level to the filter's input -- in effect slowing it by a factor of 100.  Thus we can use a 7.3 Hz filter.  You'll need to test this setup for accuracy over the amplitudes, frequencies, and waveforms expected.  Also I'm not sure to what extent this helps with the questions in your other thread.

         Best regards,


         Edit -- The filter shown is now a General 2nd-order set to one first-order section, as this is the only way to obtain a double-precision first-order filter in the ADAU1761.