RMS in compressors; how is period of time determined?

DSP, Plugin and Host development discussion.
RELATED
PRODUCTS

Post

I've just been reading up on RMS, tried prototyping something in a modular environment.. and then I considered this:

When designing compressors which respond to the RMS of the signal, how do you decide how much time to RMS before the volume is altered?

I just wonder, I've not seen a compressor plugin which gives me the option to change the window over which the RMS is calcluated. It seems like it might be an interesting value to be able to change.

It feels like a dumb question, but I really can't tell.

Post

Blue Cat Dynamics?
Klanghelm DC8C3?
Tranzistow Tutorials: http://vze26m98.net/tranzistow/
Xenakis in America: http://oneblockavenue.net

Post

We are the KVR collective. Resistance is futile. You will be assimilated. Image
My MusicCalc is served over https!!

Post

You know the sample rate, so you can calculate the number of samples you need to count in...

Post

CinningBao wrote: Wed Oct 10, 2018 12:27 am I've not seen a compressor plugin which gives me the option to change the window over which the RMS is calcluated.
They do exist, for example the free ReaComp. And yes, you're right, it really is an interesting feature to have. Not always useful, but also not always in the way. As quikquak pointed out, you know the samplerate which tells you how many samples pass through per second. Divide the samplerate by 1000 (or better multiply by 0.001) and you get the number of samples passing through per millisecond. From there on it's essentially just resizing and iterating a for loop. Changing the RMS window timing boils down to just that, resizing the loop limit.
Confucamus.

Post

quikquak wrote: Wed Oct 10, 2018 6:48 am You know the sample rate, so you can calculate the number of samples you need to count in...
I'm not trying to be rude, but I'm not thick.

You misunderstand the question.. I was asking _why_ choose .. half a second.. or 300 ms? Or any period of time! Does music at 120 bpm suit an RMS of 250ms? I was hoping to start a discussion.. but it seems to have failed.

Post

Rockatansky wrote: Wed Oct 10, 2018 7:02 am
CinningBao wrote: Wed Oct 10, 2018 12:27 am I've not seen a compressor plugin which gives me the option to change the window over which the RMS is calcluated.
They do exist, for example the free ReaComp. And yes, you're right, it really is an interesting feature to have. Not always useful, but also not always in the way. As quikquak pointed out, you know the samplerate which tells you how many samples pass through per second. Divide the samplerate by 1000 (or better multiply by 0.001) and you get the number of samples passing through per millisecond. From there on it's essentially just resizing and iterating a for loop. Changing the RMS window timing boils down to just that, resizing the loop limit.
Maybe I should have mentioned that I'm not a complete spid and do understand how to math a little bit..

Ok, yes, folks have pointed out Blue Cat and some other manufacturers do offer RMS window adjustment - I'm not much of a compressor whore so I guess that's my failing.

But those compressors with a fixed RMS, how do developers choose how big the window should be?

I guess I'm also asking how non-IC technology handles the window of time. Analogue doesn't work in samples.. so is RMS not something which can work in old-school pre-transistor circuits? That question might be for another forum..

Post


Post

That looks interesting resynthesis, thanks :) I'll definitely take a good look at it.

And Bertkoors link to Sound Level Metering.

Post

The question "how is period of time determined?" was misunderstood, sorry.

Post

quikquak wrote: Wed Oct 10, 2018 9:09 am The question "how is period of time determined?" was misunderstood, sorry.
No worries :)
I guess you only read the subject line and not the post ;)

Post

CinningBao wrote: Wed Oct 10, 2018 8:33 am But those compressors with a fixed RMS, how do developers choose how big the window should be?

I guess I'm also asking how non-IC technology handles the window of time. Analogue doesn't work in samples.. so is RMS not something which can work in old-school pre-transistor circuits? That question might be for another forum..
If I say some things you already know please don't panic. :)

The RMS is:
1. Square the signal
2. Average (take the arithmetic mean) of the squared signal
3. Take the Square Root of the Mean to get RMS amplitude

The Mean of the Squared Signal is power. Power is 10 * Log10(Level) and Amplitude is 20 * Log10(Level). Therefore for a dynamics processor or meter plugin, the final square root may not be necessary. You can sometimes figure the level to display on a meter or the amount of dynamics to apply based on the power measurement, making the final square root unnecessary.

You can take the mean by averaging an n-length window of samples: add n samples then divide the sum by n. You can also get the mean by applying a lowpass filter of some kind. In fact, an averaged window of samples is a lowpass filter sometimes called a Box FIR filter. A Box filter is sometimes "as good as it gets" for some tasks but for many purposes is not a very "sharp" filter.

Some analog dynamics processors used as simple as first-order analog lowpass filters to perform the arithmetic mean, and fancier analog dynamics processors used fancier analog filter networks.

Though the following applies to any dynamics processor, lets consider compressors-- If you feed a pure sine wave into the envelope detector but the envelope smoother is not "perfect" then the envelope output will be a DC level with a sine wave riding on-top of the DC level. That signal leaking thru on-top of the envelope DC output is often called ripple. When you modulate the level of the input sine wave with that DC signal with ripple riding on-top, then the ripple will distort the shape of the input sine wave, and the output sine wave will have added distortion harmonics. This is called intermodulation distortion.

In the case of more complex audio, single instruments with real-world higher harmonic content or polyphonic instruments or full mixes, any ripple in the control signal causes everything (that leaks thru in the ripple) to modulate each and every harmonic of the input signal, which can cause rather nasty distorted output.

If you don't want the bass intermodulating the carp out of bass, mids and highs, you have to figure some way to smooth the bass ripple as good possible. There is a linkage between time and frequency and "nearly always" if you want to heavily smooth low frequencies you have to use long time constants, which results in slow envelopes. So a short/fast envelope will typically allow more low frequency ripple and more intermodulation distortion. Contrariwise, a long/slow envelope can have low IM distortion but rather slow in tracking rapid changes in the music.

If using a simple "not very sharp" filter such as an arithmetic mean box FIR filter or a 1st or 2nd order analog or IIR lowpass filter, you need real long time constants to minimize intermodulation distortion. 100 ms or much longer, to really clean out the bass ripple and bass IM, if using "not very sharp" simple filters.

The "fancy design work" in envelope designs is trying as good possible to fool mother nature and somehow get fast envelopes which are also smooth.

Post

CinningBao wrote: Wed Oct 10, 2018 12:27 amhow do you decide how much time to RMS before the volume is altered?
Trial and error is one method. I think I read some take a look at outboard, try to measure it and compare to their own implementation to find the "right" length.

I'd also simply go by ear, what gives the expected results or how it behaves if the rms window gets altered. Maybe that way you find a sweetspot fitting fast, slow or dynamic material. Or you recognize a pattern which can be setup with adapting rms windows.

But I never read in a compressor manual that it follows some standard. Even in metering a good rms meter has an adjustable rms length. That is another option: take a look at the loudness standard like EBU. It defines how to measure for loudness, maybe you can adapt that for compressor rms.

Post

Rockatansky wrote: Wed Oct 10, 2018 7:02 am
CinningBao wrote: Wed Oct 10, 2018 12:27 am I've not seen a compressor plugin which gives me the option to change the window over which the RMS is calcluated.
They do exist, for example the free ReaComp. And yes, you're right, it really is an interesting feature to have. Not always useful, but also not always in the way. As quikquak pointed out, you know the samplerate which tells you how many samples pass through per second. Divide the samplerate by 1000 (or better multiply by 0.001) and you get the number of samples passing through per millisecond. From there on it's essentially just resizing and iterating a for loop. Changing the RMS window timing boils down to just that, resizing the loop limit.
Dmg Compassion allows this as well.

Post

Aaaaaah, now THAT makes sense! Thanks JCJR :)

And I look at what you've said, about how hard it is respond to both low and high frequency material without compromising, and wonder if splitting the signal up and using clever maths to work out how to combine the outputs to create a more responsive envelope. Is that reasonable? Do developers already do it?

Post Reply

Return to “DSP and Plugin Development”