SynthMaker

fast RMS estimator

Archive · 2010 16 old posts

From the original SynthMaker forum (2004–2014), with its members’ names and dates.

bootsy ·

Here is a fast RMS estimator already optimized in asm. The constant factor is tuned to samplerates around 44.1/48k. have phun, bootsy

exonerate ·

Thanks 🙂

So this is a 'fake' RMS using a lowpass filter?

How did you get the constant factor? I'd like to make that sample rate independent.

Cheers 😉

Exo

bootsy ·

no, this is a realtime continuous RMS and not a simple LP filter. At double SR the constant should be the half, I think ...

oddson ·

I'm not ASM savvy but I see a root and a square but where's the mean?

It seems like it is still doing something like a low-pass to achieve the averaging part since it looks like there's only 1 sample worth of memory here.

Can you write out what it's doing in pseudo-code so we non ASM people can see what it's doing?

MichaelBenjamin ·

i would guess its like this:

rms=(in*in-rms)*0.00225+rms; out=sqrt(rms);

oddson ·

Then it's the root of a low-pass of the squared input...

It has the advantage of being an accurate reflection of the power of the signal because it is the root of the squared inputs 'averaged' in a sense.

So the coef determines the cutoff for the lowpass. It could be brought out of the code and made an adjustable parameter to give an approximation of the 'windowing' used for the 'average'.

(The scare-quotes are there because I am not really sure whether the terms are valid where I'm using them.)

bootsy ·

MichaelBenjamin wrote: i would guess its like this:

rms=(in*in-rms)*0.00225+rms; out=sqrt(rms);

it is. the constant is tuned to match it to an (array based) averaging calculation over 512 samples.

Andrew J ·

At 44.1KHz this seems to be within 0.5% accuracy on smooth monophonic signals such as vocals. Accuracy is out to 3 or 4% on something like a drum bus. The error can occasionally get out as far as 7% error on a full bus mix.

That's pretty good for something that runs at 1/6th the cycles of true RMS.

sunsynth ·

Hi bootsy,

i just tested your ASM RMS:

Even if i only input a Denormal value of 1e-020 the CPU rises 1.5 % 🙁

Please have a 2nd look @ it because i need an optimized ASM right now!

MichaelBenjamin ·

when you put a denormal number in its no surprise that cpu goes up. why would you do that anyway?

sunsynth ·

😊 ...Michael and bootsy

...in the heat

i have a schematic here and it 'prevents denormals with 1-e020' and i overlooked that i usually set a 1e-009 Value 😮

Go back to my knitting 😉

bootsy ·

So, as attached this should be the samplerate independent version. @Michael: Even on my ancient PC it takes only around 0.2% cpu but I've noticed that with shortest timings there could be indeed some denorm issue which one should compensate for ...

exonerate ·

Hey bootsy, I'm I ok to add this to the Dev toolkit?

Cheers 😉

Exo

bootsy ·

surething.

platinumears ·

bootsy wrote: So, as attached this should be the samplerate independent version.

Thanks for this bootsy. I used it in FL4TT3RY: http://www.kvraudio.com/get/4640.html

Much appreciated! 😀

MDMA ·

Thanks alot mate, I was looking for something like this and this one is really good. Nice work!

Wrote something here? To have a post removed or your name hidden, write to [email protected].

Before your first post

A few rules keep this a friendly place. You agree to them once.

Shown next to what you post, here and in the app. It doesn’t have to be your real name: 3–24 lower-case letters, digits or _ (capitals become lower case, spaces become _).

    Then your post goes up straight away.

    Delete this reply?

    Open it in SynthMaker?

    It goes on the track you’re editing there, in place of that track’s sound, and into My sounds. Your other tracks stay as they are.

    Want to keep that track’s sound? Start a new song in SynthMaker first (Song › New song), then open this.

    Report this reply?

    Only the developer reads reports. The person isn’t told who reported them.

    What’s wrong with it?

    Block this person?

    You won’t see their posts and replies here any more. They aren’t told, and you can unblock them at any time.

    People you’ve blocked

    Their posts and replies are hidden from you. Unblock someone to see them again.

    The community rules

    A few rules keep this a friendly place. Everyone agrees to them once, before their first post.