A Discussion About True Power Summing for Stereo Compressors

Where we discuss new analog design ideas for Pro Audio and modern spins on vintage ones.
User avatar
JR.
Posts: 3700
Joined: Sat May 24, 2008 7:21 pm
Contact:

Re: A Discussion About True Power Summing for Stereo Compressors

Post by JR. »

Yes I have been making Pk/VU meters for a few decades so familiar with crest factor. I even calibrate my meters in fixed dB steps so crest factor can be visually imputed from simple observation.

Regarding crest factor related errors, I am more familiar with errors associated with RMS circuitry saturating in the x^2 stage. Most RMS chips specify a maximum crest factor for this very reason.

Yes, I was using final mixes, from a friend's personal studio recordings, Not compressed as much as commercial music, but final mixes so compressed some by the complex mix, and probably some compression on a few individual elements.

I know from the math, there are real differences in the heating value (power) of different waveforms. I suspect part of my inability to discern much difference on my meter is the relatively long time constants (250 mSec). Since this is on my slow (VU) display.

I will revisit this, later and when I do I will request some raw individual tracks since that is more likely to express a difference. Just not this weekend.

JR

PS: regarding the RMS software complexity, it isn't how many lines of code, but how much processor time is consumed in critical path processes. Squaring the signal requires very little overhead as multiplies are a hardware function in the microprocessor, so a couple of clock ticks. The square root, was the PIA, since there is no hardware SQRT function. There is a divide function in firmware, but even that takes multiple clock ticks and would require iteration to get a result. I wrote a routine to calculate SQRT using the multiply function iteratively. While I forget the details it was probably 20+ lines of code, and less 5-10 ticks to execute.

The good news is that I didn't have to perform the SQRT on every sample, just the squaring operation, so overhead increase was a few ticks to square each sample before integration. Same exact integration routine as with average, then run the SQRT routine, only when I update my meter output at a fast enough rate to appear continuous, but slow in microprocessor terms.

I removed this because I didn't finish all the detail work and added complexity that doesn't deliver benefit is something to accumulate bugs in so I kept it simple. As perhaps too much information, in many DSP processes they square the raw audio data since that automatically gives a positive result for even the negative portion of audio waveforms. For my peak meters, I needed a proper rectification step.
---------
PPS: I seem to recall one of the arguments presented by DBX back in the day regarding tape NR accuracy, was that RMS detection was supposedly more tolerant of the phase shift in the tape record/playback process. It seems to me that phase shift that alters the time relationship between harmonic content would cause precisely the kind of wave shape variations that would cause measurement errors between RMS detection vs, simple average. In other words wave shape matters more for RMS than ave, so mistracking could be worse not better. But this is all water over the dam(n).
Cancel the "cancel culture", do not support mob hatred.
User avatar
mediatechnology
Posts: 5442
Joined: Sat Aug 11, 2007 2:34 pm
Location: Oak Cliff, Texas
Contact:

Re: A Discussion About True Power Summing for Stereo Compressors

Post by mediatechnology »

Regarding crest factor related errors, I am more familiar with errors associated with RMS circuitry saturating in the x^2 stage. Most RMS chips specify a maximum crest factor for this very reason.
x^2, by logging and then multiplying by two, (squaring in the linear domain but expressed in the log domain) is part of the advantage Blackmer had.

The THAT2252 has a 1 dB typical error with a crest factor of 8. (I'm not sure of the test level. A 1 ms pulse repetition rate is given.) For crest factors of about 4, the error drops to about 0.2 dB.
I know from the math, there are real differences in the heating value (power) of different waveforms. I suspect part of my inability to discern much difference on my meter is the relatively long time constants (250 mSec). Since this is on my slow (VU) display.
For level metering with a long Tc there may be no real advantage to RMS with all the DSP MIPS overhead.
Regarding the RMS software complexity, it isn't how many lines of code, but how much processor time is consumed in critical path processes.
I kinda thought you'd say that but didn't know if you had a "MIPS meter" to read it. :D
I seem to recall one of the arguments presented by DBX back in the day regarding tape NR accuracy, was that RMS detection was supposedly more tolerant of the phase shift in the tape record/playback process. It seems to me that phase shift that alters the time relationship between harmonic content would cause precisely the kind of wave shape variations that would cause measurement errors between RMS detection vs, simple average. In other words wave shape matters more for RMS than ave, so mistracking could be worse not better.
I recall that argument too.
"In other words wave shape matters more for RMS than ave, so mistracking could be worse not better."
I'm not so sure of that though. Compare the half-wave rectified sine vs the triangle wave below. There's about a 15% difference between the power of a half-wave rectified sine vs. triangle. Under the same conditions the mean magnitude (avg.) difference between the two is 36%. Average is over/understating the difference in power by a factor >2.

Image
Image Courtesy of Wikipedia

It might be worth noting for our readers that the peak voltage in all cases are identical.

I'll go out on a limb here and say that you want to use peak values to monitor headroom and maintain headroom via dynamics in a channel or medium.

If you want to measure loudness, or control loudness to improve density, then you want a power measurement (RMS) or an approximation of it (avg.) in the meter or dynamics sidechain.

There's certainly a case for using both peak and RMS in the same chain as well.
User avatar
JR.
Posts: 3700
Joined: Sat May 24, 2008 7:21 pm
Contact:

Re: A Discussion About True Power Summing for Stereo Compressors

Post by JR. »

mediatechnology wrote:
Regarding crest factor related errors, I am more familiar with errors associated with RMS circuitry saturating in the x^2 stage. Most RMS chips specify a maximum crest factor for this very reason.
x^2, by logging and then multiplying by two, (squaring in the linear domain but expressed in the log domain) is part of the advantage Blackmer had.

The THAT2252 has a 1 dB typical error with a crest factor of 8. (I'm not sure of the test level. A 1 ms pulse repetition rate is given.) For crest factors of about 4, the error drops to about 0.2 dB.
OK this is getting a little esoteric, but Blackmer's RMS circuit suffers from the same errors as any log based approach, Instantaneously the anti-logging transistor junction which gets 2x the Vb-e step, must develop the square of the instantaneous current step. Real transistors have a real resistance term (Rbb) in series with this base-emitter junction and this linear term causes an error for large instantaneous steps. At equilibrium there is a first order cancellation of similar Rbb terms in log/anti-log circuitry.

I recall this Rbb term caused my old TS-1 dB meter to over report at the top end of it's dB range (a fraction of a dB hot at +20 dBu).
I know from the math, there are real differences in the heating value (power) of different waveforms. I suspect part of my inability to discern much difference on my meter is the relatively long time constants (250 mSec). Since this is on my slow (VU) display.
For level metering with a long Tc there may be no real advantage to RMS with all the DSP MIPS overhead.
Regarding the RMS software complexity, it isn't how many lines of code, but how much processor time is consumed in critical path processes.
I kinda thought you'd say that but didn't know if you had a "MIPS meter" to read it. :D
I don't need a MIPS meter... I write machine instructions, literally , move this, multiply that, etc.. I tell the micro what to do each clock tick. I know when I get into trouble because I run out of clock ticks to finish the task within the interval I have allocated.
I seem to recall one of the arguments presented by DBX back in the day regarding tape NR accuracy, was that RMS detection was supposedly more tolerant of the phase shift in the tape record/playback process. It seems to me that phase shift that alters the time relationship between harmonic content would cause precisely the kind of wave shape variations that would cause measurement errors between RMS detection vs, simple average. In other words wave shape matters more for RMS than ave, so mistracking could be worse not better.
I recall that argument too.
"In other words wave shape matters more for RMS than ave, so mistracking could be worse not better."
I'm not so sure of that though. Compare the half-wave rectified sine vs the triangle wave below. There's about a 15% difference between the power of a half-wave rectified sine vs. triangle. Under the same conditions the mean magnitude (avg.) difference between the two is 36%. Average is over/understating the difference in power by a factor >2.

Image
Image Courtesy of Wikipedia

It might be worth noting for our readers that the peak voltage in all cases are identical.
My point, is that phase relationships between harmonics will change the crest factor of any given waveform. For example the square wave is made up of a series of harmonics and altering the phase relationship of those identical harmonics will alter the wave shape. It might be instructive to see how the peak/ave/rms content of that same original signal changes. My intuition was that ave would be the more reliable measure, but this too needs to be inspected more closely.... (of course this falls after my review of RMS vs.AVE music, since I'm no longer making tape NR.)
I'll go out on a limb here and say that you want to use peak values to monitor headroom and maintain headroom via dynamics in a channel or medium.

If you want to measure loudness, or control loudness to improve density, then you want a power measurement (RMS) or an approximation of it (avg.) in the meter or dynamics sidechain.

There's certainly a case for using both peak and RMS in the same chain as well.
I am very comfortable in promoting Pk/VU meters for monitoring modern signal chains. I may convert to RMS for the VU because I can, but am not yet convinced it makes a significant difference for metering.

In a comp working on individual instruments, is probably the most likely area where it may make a difference between RMS and simple ave. This is even further confounded when asymmetrical attack/release times are used. I will reserve further comment until I do more research.

JR
Cancel the "cancel culture", do not support mob hatred.
Crusty
Posts: 69
Joined: Mon Aug 20, 2007 1:42 am

Re: A Discussion About True Power Summing for Stereo Compressors

Post by Crusty »

mediatechnology wrote:
That said using "RMS" detection (or IMO any rectification) before summing, will over report incoherent signals relative to coherent.
Thanks for the discussion John. I agree with most everything else except the above.

I believe the opposite of the above is true: Summing prior to rectification will over report coherent signals. Equal level signals of opposite polarity (about as incoherent as it can get) when summed prior to detection will produce an output of 0V. Keith illustrates that in his ssl turbo mod video where he shows a GSSL doing exactly that: No GR when equal inputs are applied with opposing polarity. The GSSL is well known for punching a hole in center due to coherent bass. More coherent = more GR.


With the That Corp. detector, aren't you really summing during detection and not after? I mean it's rectified at that point but not scaled anyway. http://www.thatcorp.com/datashts/2252data.pdf
Seems to me that, if you're altering the mean weighting of the detector by adding an external current at that cap node, then you are detecting RMS with coherent signals (and something else when they go stereo LOL).
User avatar
mediatechnology
Posts: 5442
Joined: Sat Aug 11, 2007 2:34 pm
Location: Oak Cliff, Texas
Contact:

Re: A Discussion About True Power Summing for Stereo Compressors

Post by mediatechnology »

With the That Corp. detector, aren't you really summing during detection and not after?
In part, but consistent with RMS.

It's summing the left and right channels after each individual squaring operation, (by linking them to sum their currents), obtaining the average (with a capacitor), and performing the root by implication. Ignore for the moment that the detector works in the log domain.

If you look at the power sum equation from a mathematical model for a series of values, the sum of the squares are in the numerator, the mean, "n," is in the denominator, and the entire fraction has the square root taken.

RMS = sqrt{ (a^2 +b^2 +c^2 + ... +n^2)/n }

When you combine the two channels as shown in the diagram below you're essentially doing the following:

RMS = sqrt{ [(L1^2 +L2^2 +L3^2 + ... +Ln^2)+(R1^2 +R2^2 +R3^2 + ... +Rn^2)]/n }

where the L1^2 and R1^2 etc. are the left and right squared terms and n represents the mean based on the number of terms in the numerator.

By combining the outputs of the left and right detectors you're essentially adding more terms to the numerator. The mean is then taken for the combined L+R terms. This is consistent with RMS math and it's still RMS.

Electrically combining them as shown in the drawing below is just extending the number of terms in the numerator to include both left and right. It's still RMS.

[I think - though it may not be technically accurate - that the denominator becomes "2n." The timing current is doubled (4301) and the capacitor is made twice as large (2252 and 4301).]
Seems to me that, if you're altering the mean weighting of the detector by adding an external current at that cap node, then you are detecting RMS with coherent signals (and something else when they go stereo LOL).
With the cap there averaging them no. Remember that it's the mean of the sum of the squares not the instantaneous sum of the squares regardless of where they come from (left or right) or their vectors.

No squared term in the numerator is ever going to produce a negative result. The numerator terms either add, or fail to contribute (add 0) to the total. They can never subtract from the result. Right? (Which is why we have a timing resistor to pull current out and allow recovery.)

Using the math definition of RMS we're just adding more terms (Left and Right channels) to the numerator to calculate power. For three phase power it could just as easily be three 2252 detectors summed together into a common capacitor to read total phase A, B and C RMS current regardless of their vector differences.

The academics of this is interesting, but we can't ignore the fact that when you build one (a Pico Compressor) and actually test it with two equal level input sources*, and then vary the frequency/phase angle of both inputs independently, the detected level does not change. If the detector had some means to discriminate between coherent/incoherent its providing no indication of that. Please, for sake of discussion, accept that as fact or build one and prove me wrong.

If the integration time is very short, which would produce unacceptably high ripple and THD, this might be the case. We call that the peak mode. :) But with the averaging time long (to make it a good compressor), it just doesn't happen. The capacitor washes out the phase angle differences for everything except the low-level LF ripple.

*They don't have to be equal level, that was just the test I used so each contributed equally making any change more obvious. Having them equal level also allowed me to see the +3 dB power increase. But it was +3 dB regardless if both inputs were 1 kHz from two async generators or one 1 kHz and the other 1.1k, 10k, 100 Hz etc. Fully coherent e.g. both inputs connected to the same generator is - guess what - +3 dB.

Here is the design note showing two 2252s providing true power summation.

Image

The sum of the "left and right" squares occur because pin 6 on each 2252 are connected together. C3 is providing the mean. (Edit: I should also add R3 to the mean function.) The square root function is not computed explicitly and is "performed" after the mean is taken.

Image

I'm no math genius but I'm smart enough to know that it works as "advertised" and have the ability to observe that correlation, or the lack of it, between inputs has no effect as long as the mean (average) occurs over a sufficiently long enough period.

You guys can argue the math all you want, but build one using a 10-22 uF cap that can detect the difference between correlated and uncorrelated inputs and I'll be convinced. They just wash out due to averaging.

It's similar to the "real" SSL compressor (not the toy one) where the outputs of the two peak detectors are combined. The hold time is sufficiently long so that only the greater of the two peaks are detected. The "real" SSL comp is also not affected by coherent/incoherent inputs. The toy GSSL ;) is affected by correlation and "deaf" to uncorrelated inputs.
User avatar
JR.
Posts: 3700
Joined: Sat May 24, 2008 7:21 pm
Contact:

Re: A Discussion About True Power Summing for Stereo Compressors

Post by JR. »

I will second that the math is valid. The SQRT in log domain is simply a scale factor (div/2). There are subtle errors in practice from not symmetrically performing the square root in actual device junctions, but this will only confuse the discussion, the error is surely modest.

I really need to butt out of this discussion, but how tough would it be to make this a switchable option? Maybe use the mode that sounds best for a given situation, or not. :idea:

JR

PS: I appreciate the downside to too much choice and complexity. Do what sounds good...
Cancel the "cancel culture", do not support mob hatred.
User avatar
mediatechnology
Posts: 5442
Joined: Sat Aug 11, 2007 2:34 pm
Location: Oak Cliff, Texas
Contact:

Re: A Discussion About True Power Summing for Stereo Compressors

Post by mediatechnology »

JR - I think that's how our M/S matrix will be used - with comps either in the primary/main path or sidechain. Hopefully the comps will be Picos...

Thanks for your posts here!
Crusty
Posts: 69
Joined: Mon Aug 20, 2007 1:42 am

Re: A Discussion About True Power Summing for Stereo Compressors

Post by Crusty »

mediatechnology wrote:
No squared term in the numerator is ever going to produce a negative result. The numerator terms either add, or fail to contribute (add 0) to the total. They can never subtract from the result. Right? (Which is why we have a timing resistor to pull current out and allow recovery.)
Ah, there you go; that 'clicks' for me.

The method does sound good (I've built Picos before there were Picos LOL). I have had comments that it is too tight sometimes - the M/S in the detector path might be a way to go...
User avatar
mediatechnology
Posts: 5442
Joined: Sat Aug 11, 2007 2:34 pm
Location: Oak Cliff, Texas
Contact:

Re: A Discussion About True Power Summing for Stereo Compressors

Post by mediatechnology »

In restrospect I suppose I could have just said "it's full-wave rectified." Duh. :oops:
Crusty
Posts: 69
Joined: Mon Aug 20, 2007 1:42 am

Re: A Discussion About True Power Summing for Stereo Compressors

Post by Crusty »

Nah bro, that wouldn't have done it for me. LOL I like the whole RMS for Dummies thing. It all helps me - I'm not the most absorbent sponge, it takes awhile for me, especially with math.
I still want to make a fully variable attack/release circuit on that timing pin. What do you think?...
Post Reply