k y m a • t w e a k y — the kyma collective || view the current website || February 2015 Archive

/ WebHome / Sounds / Share.DiscussPrecisionCompressor-Limiter


Share Section



All Sections


Login / Register 
Change password
Forgot password?

Symbolic Sound

Kyma Forum
Eighth Nerve

TWiki Links

TWiki Formatting FAQ
What is TWiki?
%SESSION_ENDIF% twiki.org
This sound is composed of a 5-band stereo (actually dual mono at the moment) noise-gate/compressor/precision-limiter/soft-clipper for mastering. The precision limiter is actually stereo, using the Max-Abs of the left and right output channels coming out of the limiter stages. But otherwise, in the noise gates, compressor, and input to the limiters, the side channels are actually derived only from the channel, not the Max-Abs of the left and right channels, in each band.

I'm afraid we are out of processor time in this sound, even with a fully decked Capy. The DSP allocation appears to require 6 DSP's plus the I/O handler DSP. For some reason, probably related to the feedback mechanism, DSP #(N-2) is fully allocated and all the others are barely used. Probably need to do more work on this to find the reason. But at this point, adding cross-channel sidechains to all the noise gates, compressors, and limiters would completely exhaust the capabilities of the Capy, any myself in dragging all those boxes around...

Despite that, I haven't noticed any particular instances of stereo shift resulting from the use of this Sound. But I have only used moderate settings, appropriate for Mastering, not heavy handed sound bending...

On input the left and right channels are split and fed into two identical chains. Each chain is composed of a 5-band 2-octave wide filterbank using 4th order cascaded Butterworth filters for low levels of interband phase cancellation. These cascades produce bandpass filters.

Each bandpass filter is then fed into a Noise Gate, then a Compressor, and finally a Limiter. All the limiters are summed for that channel's output. The stereo Max-Abs of the left and right outputs is fed into a level detector composed of complementary peak detectors. These peak detectors exhibit both a fast sub-millisecond response to sharp attacks, and a slower 20 ms attack for average energy measurements. The release time of the detector is settable in the VCS. Typical limiter release times are on the order of 1 sec and longer.

The stereo energy detector compares its measurements with a user settable threshold and derives a feedback limiter threshold for each band based on the excess of the RMS level over this threshold. Feedback parameter K is user settable, but I find 1.2 works well enough.

Generally only one or two bands will enter limiting leaving the others operating wide open. The limiters themselves have an upper limit on their thresholds named Limiter in the VCS. In any event, in band sound energy at levels above that threshold will be limited, regardless of the feedback.

I have spent more than 2 years wrestling with the Kyma Compressors, and I finally conclude that these must be table based VCA's. They do not perform well in combinations like I have tried to use in the past for setting two or more threshold breakpoints. For that, if it is really what you want, you probably need to program your own tables for lookup.

But what I also concluded is that dual thresholds are probably unnecessary anyway. So the compression stage in each filter bandpass is set up to allow you to specify the lower dB threshold for compression, named ThrshL?, and another parameter that specifies the dB level at which you get unity gain, named ThrshHi?. Changing ThrshHi? will change the apparent gain in the compressor output stages. But in addition to that, regardless of compression ratio and ThrshHi?, you can specify additional gain or attenuation with CGain.

There is also a Gain parameter in the output stage of the Limiters, but it isn't clear to me yet which of these two is most appropriate to use. In general I have been using the CGain parameter when needed. At issue here is the limited dynamic range of the Motorola DSP's. Pushing the sound levels in any one band too far will simply cause the DSP to saturate, clipping the sound. We'd like to avoid that situation.

The final output of both left and right are sent through a soft clipper that prevents any sound levels from exceeding -3 dBFS. This figure was chosen as a good margin against DAC output filtering phasing effects and Gibbs Phenomena. I actually do measure levels in excess of this -3 dBFS in outboard gear, and it typically ranges from 1.5-3 dB higher. So the phasing effects of output conversion filtering and Gibb's Phenomena are quite real and need to have attention paid to them.

This clipper was designed to present a slope of 1 for small signal levels, and gradually introduces cubic and quintic terms that bend smoothly toward a slope of zero at the -3 dBFS level

Now, about all these elements... You already know what a noise gate does. But what are the actual effects of Compression vs. Limiting vs. Output Clipping?

Most (but not all!) music exhibits a relatively flat average spectrum below 250 Hz, and offers a spectral rolloff toward higher frequencies of somewhere between -3 dB/octave and -9 dB/octave. Rolloffs smaller than -3 dB/octave begin to sound like white noise, and rolloffs heavier than -9 dB/octave sound very dark and dull.

Limiting leaves the signal alone as long as its average level is below the limiting threshold. At that point very strong gain reduction is applied to prevent the average level from rising any further. So when you boost the signal levels ahead of limiting, what you are doing is pushing all of the spectrum higher and clipping the energy levels at that threshold. Frequency bands where the sound level would exceed the limiting threshold get squashed back to that threshold level. Frequency bands still below the limiter threshold operate as though nothing is happening to them.

Hence it should be easy to see that the spectral rolloff of the music is unaffected by multiband limiting, except that the rolloff is progressively delayed to higher and higher frequencies as the bands encroach on the limiter threshold. The result will sound more full and power packed, but bass and midband frequencies will be enhanced in loudness while the higher frequencies simply get boosted by the EQ gain.

Multiband compression on the other hand actually modifies the spectral rolloff of the sound. As you move toward higher frequencies, the average energy diminishes, causing compression to boost them ever more than the lower frequencies were boosted. So unlike limiting, this does not particularly enhance the loudness of bass and midband frequencies at the expense of the higher frequencies. All of them get boosted, and the music becomes generally brighter.

You can estimate the required compression ratio by examining a spectral plot of the average spectrum of a piece of music. If that music exhibits a slope of S dB/octave rolloff above 250 Hz, and if you want it to have a different rolloff of S', then the required compression ratio is simply S/S'. So for example a compression ratio of 2:1 will transform a musical average spectrum from -9 dB/octave into one with -4.5 dB/octave, sounding much brighter overall.

Finally the output soft clipper... I refer to it as soft because of the gentle transition to zero slope at the -3 dBFS limiting level. If sounds actually saturate the output waveform will exhibit a rounded transition into clipping. Once hard clipping acutally occurs you generate a huge number of spurs and harmonics and aliasing. So actual saturation of the DSP's is something to be avoided in most cases.

With the levels of 3rd order and 5th order polynomial coefficients provided in the Wavetables of the clipper, there will be some degree of 3rd and 5th harmonics of whatever sound you push through the clipper. The 3rd order harmonics are roughly 22 dB below the fundamental at full amplitude and die away with decreasing signal amplitude as 1/k^2, compared to the fundamental, where k is the signal amplitude.

The 5th order harmonics are roughly -47 dB at full amplitude and fall away as 1/k^4 relative to the fundamental.

But regardless, in no event will the output of the clipper ever exceed -3 dBFS.

Unlike compression and limiting, which modify the appearance of the average musical spectrum, this output clipper simply ensures that the output never exceed the -3 dBFS level, and some degree of brighting will occur but it is no more than odd harmonics at -22 dB and -47 dB relative to a full strength carrier. You might detect this effect in loud, sharp, drum strikes, sounding like some exciter is applied.

I still have a lot more to explore regarding the parameter space of this mastering processor. But so far with moderate settings in compression ratios, gains, limit thresholds, etc. it sounds quite good and quite strong without ever pushing the limits of my other outboard gear.

You can estimate a reasonable unity gain level and limiting thresholds by figuring that with 5 bands covering the entire audible spectrum, this would cause a pink noise source of A RMS dB to exhibit a strenght of (A-7)dB in each band. Music will be darker than this, but it is a good starting point. So if you see the RMS level hovering around -10 dB then a good starting point would be to consider that the average level in each band is roughly -17 dB.

-- DavidMcClain - 19 Mar 2004

I just re-uploaded the Sound... I found that the Noise Gates in Kyma do not impose any gain reduction the way the Compressors do. I had an output gain of 3 in the Noise Gates that has been dropped back to 1. Should work a little better now...

-- DavidMcClain - 19 Mar 2004

Here's a version with better DSP utilization. Since the Limiter Feedback is in a hot parameters, and since these are only reaped a 1 ms intervals, using a direct sound feedback was a bit wasteful. So instead we simply create a hot parameter from the energy level follower and feed that back as a named hot-parameter. The result freed up DSP #(N-3) considerably and allowed the processing to spread more evenly among the DSP's. Current DSP usage is 5 plus the I/O processor.

-- DavidMcClain - 19 Mar 2004

There was a scaling error in the energy follower. When you add the complementary peak detectors together, they pretty well track mean energy in the sound, but at a bias of +6 dB. Hence you need to simply divide their sum by 2. I wasn't doing that. So here is a correction. The result makes the RMS readout in the VCS not quite so hot looking, and much more reasonable. It is highly unlikely that you can achieve RMS levels around -3 dBFS, and I was routinely seeing that condition. Now we don't anymore.

-- DavidMcClain - 19 Mar 2004

Here is a completely reworked version to implement true stereo processing all the way through, along with the original version. The new version is named True Stereo....

Instead of using the Kyma Noise Gate, Compressor, and Limiter, I defined my own combination chain based on the Log2(x)/32 microsound. When you feed a positive value into this function it computes the same as dB(signal)/192. I go through a 10 ms/200 ms peak folower before taking this dB measure. Once I have the dB level of the signal, I go into a Constant block and execute some Smalltalk code to pull off all of the Noise Gate, Compression, and Limiting. The result of this constant block then feeds a Gain block following a stereo delay on the original input. That delay allows the gain calculation to behave as a lookahead.

5 bands, all stereo, Noise Gating, Compression, and Precision Limiting, with soft output clipping in the final stage.

The true stereo operates on the RMS level of the left and right channels to compute the required gain. Then this gain is applied equally to both left and right channels. The original signal is affected by only one gain block for nice clean sound. Only the sidechain signal is ground up and spit out. All processing has to occur separately in each passband, because attempting to operate on a filtered version of the RMS level would produce frequency artifacts that aren't actually present in the original signal.

Interestingly, while sounding very clean, I do hear a stereo shift when I enable this processing... er, rather perhaps a widened stereo field.

The time constants involved in this version are a little different than in the original version, but probably worth it for the enhancement of true stereo processing. While the main time constant is a 10 ms lookahead, it is possible for sharp impulses to sneak past the precision limiter stage. In this case the final output soft clipper will take care of that overrage. The result may sound a little more excited as the 3rd and 5th harmonics are generated briefly on these sneakaround impulses...

DSP allocation is quite modest at just over 4 DSP's plus the I/O processor, at 44100 sample rate.

-- DavidMcClain - 19 Mar 2004

Sound file now contains yet a third version utilizing the Kyma Noise Gates, Compressors, and Limits. Full True Stereo -- labeled Kyma Based...

I found a way to have Kyma process the input signals in each bandpass, and at the same time, tell me how much final gain is applied to that signal. I perform this processing on the RMS mean level between left and right channels, then throw away their result. But in parallel, that processing is driving an identical Noise Gate and Compressor chain against a constant input value of 1/32. At the end, coming out of the limiter is that constant value suitably modified by the same gains that were applied to the RMS mean signal.

Now I take that limiter output value and multiply by 32 to get back to a normalized gain value and then apply that gain directly to stereo delayed left and right channels. End effect is only one VCA on left and right to do all of Noise Gating, Compression, and Limiting.

The advantage of using the Kyma based tools is that each component (Noise Gate, Compressor, Limiter) has different processing time constants. Using the Kyma elements allows us to have that same collection of time constants applied to the constant value used as a pilot tone, as it were.

Now we have true stereo processing, in 5 2-octave bands, and with appropriate time constants applied to each dynamic controller stage.

-- DavidMcClain - 19 Mar 2004

Okay... I found the cause of the stereo field shift.. after all the editing, one of my HPF's got its cutoff frequency all hosed up. Everything seems to work fine now.

The only remaining question in my mind is how to handle the output gain of the Limiter stages. Should this be gain neutral, or should it have compensating gain reduction as it now has. This has to do with how effective the simple position feedback mechanism is...

-- DavidMcClain - 19 Mar 2004

Okay, Limiter Gain question is resolved in favor of having transparent limiting... by that I mean that when the RMS level of the signal is below the Limiter Threshold, then there ought not be any gain effects coming from the Limiter.

With Kyma Compressors, of which the Limiter is one example, you can get gain neutrality for signals below threshold by means of an output gain expression of the form (3 * !Threshold dB), when the threshold is expressed as (!Threshold dB).

-- DavidMcClain - 19 Mar 2004

Finally, here is a version that includes a totally adjustable 5-band NoiseGate?/Compressor/Precision Limiter/Clipper. All of the bands have been broken out to have individual Noise Gate Thresholds, Compression Thresholds, Compression Ratios, and now Compression PostGains?. All the bands can be varied in frequency by specifiying the nominal center frequency in each. Each channel shows the RMS level after all the processing.

You can turn this into anything from 1 to 5 bands just by setting all the unused bands to some very high frequency and turning the post gains down.

The compressors are now specified by threshold and ratio. With zero dB postgain applied, these all have unity gain below the threshold. So you can think of postgain as amplifying everything below the threshold by that many dB.

-- DavidMcClain - 20 Mar 2004

© 2003-2014 by the contributing authors. / You are TWikiGuest