BJ and Kurt comment on how to create a RMS averaged signal for side-chain dynamics purposes. (among others)
________[How]________
If you multiply a signal by itself, using MIO Channel Multiplier,
you get the “Square”. If you put that result through a lowpass,
you get a kind of “Mean Square” (an exponential moving average).
If you take the square root of that (using Square Root under Math),
you get the Root Mean Square.You get to choose the time constant for
your averaging by tuning the lowpass. This is essentially an RMS-based envelope extractor.
To do the “square” part, you use a Channel Multiplier with both inputs feed by the same signal.
To do stereo, you use the Max primitive, which will pass through the larger signal.
To do the mean part, you can use a Low Pass filter.
_______[Why]________
the standard definition of mean is
mean = sum (x0, x1, x2 … xn)/n
That yields the mean, but that would not be useful for a continuously applied process, so the mean used in an RMS detector could be a moving window mean
mean_n = sum(x(n-m), x(n-m+1), … x(n))/m
This is a FIR filter, with equal coefficients of 1/m and m taps.
This is a type of low-pass filter. This sort of FIR is generally inefficient to simply compute a moving average. You can build an IIR filter that has similar pass-band and stop band characteristics as the FIR, but the phase characteristics will be very different, and the transition band will be very different. But that doesn’t matter that much for a detector filter.
So when you use an IIR low pass filter, you are basically measuring the mean value. (The mean value is the DC component of a signal. The lower you set the cutoff of the filter, the closer the output of the filter will be to the mean value). For an RMS detector, you don’t really want the the RMS of the signal for all time. You want an new signal that approximates the “instantaneous” RMS level of the signal.
Square -> LPF -> Square-root gives you that.
Thanks BJ & Kurt