Experimental compressor design with knee distortion.

GroupDIY Audio Forum

Help Support GroupDIY Audio Forum:

This site may earn a commission from merchant affiliate links, including eBay, Amazon, and others.

rodv92

Member
Joined
Feb 16, 2023
Messages
6
Location
France
Hi, some time ago I decided to design a compressor after looking at theory but without getting too much inspiration from existing designs to see how far I would get from a real-life design.
The design is more or less a log domain compressor (A/R working on log sidechain signal), but with the gain computer working after the A/R
That seems quite frankly a deviation from theory and may be quite questionable.
The hard part was the soft knee implementation. no pun intended. Here too, my approach is quite experimental.
In the end, I got something that was able to provide soft knees but also knees that provide more compression than set by the ratio just after crossing the threshold, before reverting to a smoother application of the compression. This obviously introduces distortion but could be useful for transient management.
The big if is the manageability of making a real-life compressor from the design, the THAT2180 being quite susceptible. The knee effect could also be not reproducible in reality and be just a simulation fluke.

Anyway, the LTspice model is attached, and more information on the simulation behavior is available on :
The knee-breaker - SKYNEXT Tech.

Feel free to comment. I'd really like to know if it is worth making a prototype, knowing that it could not be done on a breadboard and would require a full PCB design.

Be warned, The simulation speed is really slow if you supply it a wavefile compared to a LF sinewave.
Cheers,
 

Attachments

  • COMPRESSOR_v0.91.zip
    14.9 KB · Views: 4
Last edited:
Well, it was an experiment that turned sour. I reckon that it could be disastrous on a bus compressor, but could give interesting distortion on an instrument, basically turning the compressor into a waveshaper. I am planning to redo the compressor for a more linear knee using standard interpolation.
But there are setting ranges that don't generate distortion though.
 
When I was at university in the early 70s, my final year project was "An improved Compressor/Limiter". The basic idea was to rectify both the input and the output, then pass the rectified input through a piecewise linear approximation to create the desired input/output curve. Lastly the output of this was compared with the rectified output and the result fed to the gain cell (a FET). It was not birilliant (it used a handful of 741 op amps which was about all that was available back then) but it did basically work. My prof liked it so much he asked if I would be interested in patenting it and then basing a PhD on it. It was very tempting because I had an idea to replace the piecewise linear section with one of those new fangled microprocessors that had just come out. But unfortunately I had a job to go to and a fiance to marry so it never happened. I still think a microprocessor based side-chain is a good idea.

Cheers

Ian
 
I still think a microprocessor based side-chain is a good idea.

The RNC ("Really Nice Compressor") from FMR Audio does that.
"The RNC achieves such high performance at a low cost by using using a microprocessor to replace discrete sidechain components (resistors, diodes, capacitors, opamps, transistors, etc) with chunks of software, thereby reducing the component cost. This approach, however, still processes the main audio in the analog domain, avoiding the problems associated with digital audio conversion (e.g., latency, digital artifacts). Even the problem of "scratchy" pots and switches are avoided: no audio flows through the front-panel controls. The front-panel pots and swtiches merely feed DC voltages to the microprocessor and it takes care of adjusting parameters and signal path with components—like sealed-relays and VCAs—located close to the input/output jacks avoiding noise pickup and audio quality reduction due to aging controls! With this blend of technology, the RNC offers the accuracy and precision of digital control with the clean tonal character of an all-analog signal path."

RNC at FMR Audio
 
The RNC ("Really Nice Compressor") from FMR Audio does that.
"The RNC achieves such high performance at a low cost by using using a microprocessor to replace discrete sidechain components (resistors, diodes, capacitors, opamps, transistors, etc) with chunks of software, thereby reducing the component cost. This approach, however, still processes the main audio in the analog domain, avoiding the problems associated with digital audio conversion (e.g., latency, digital artifacts). Even the problem of "scratchy" pots and switches are avoided: no audio flows through the front-panel controls. The front-panel pots and swtiches merely feed DC voltages to the microprocessor and it takes care of adjusting parameters and signal path with components—like sealed-relays and VCAs—located close to the input/output jacks avoiding noise pickup and audio quality reduction due to aging controls! With this blend of technology, the RNC offers the accuracy and precision of digital control with the clean tonal character of an all-analog signal path."

RNC at FMR Audio
Interesting. I wonder which micro they use? Anyone looked inside one??


Cheers

Ian
 
I've shared this story before. Last century when I was a product manager at Peavey I proposed a product that involved a single microprocessor side chain controlling multiple analog VCAs. This was before I popped my digital cherry so I was depending on an outside consultant to tell me what was possible. My plan was a single space rack unit controlling 4/8 channels of basic compressors. A handful of common controls could be assigned to different channels as desired. Each channel would have a status meter and master level control. It was possible but not as easy with the technology of the day...so never happened.

Now with todays technology I know it would be trivial. In fact I would be tempted to use inexpensive codecs for each channel instead of analog VCAs, but with digital recording environments this all becomes a software plug in.

JR

PS: Years ago but this century, I coded up a 6 channel automatic mixer using a single microchip MCU for the side-chain. I ended up using DPOTs for the channel gain manipulations. This one didn't make it into the market either when the company I designed it for cancelled the product.
 
I still think a microprocessor based side-chain is a good idea.

I did something like this using the main 32Bit ARM MCU in an "All in one" product (Smart Speaker).
This includes a hardware dynamic bass boost (the limiter is based on the LF Speaker capability) with override from the MCU and adjustment from the MCU, a Physiologically corrected volume control in 8 steps and a 0.5dB per step electronically controlled resistor ladder digipot Plus a switchable power supply that operates at low voltage for "normal" conditions.

The system is driven of an "approaching clipping" detector that triggers at 1dB below clipping.

It is a kind of "telescoping" system, if the "near clipping" detection is triggered the first action is to boost the power supply voltage. Running Class D Amplifiers with the lowest possible supply voltage for the output stage allows the amplifiers modulator at a higher modulation index, allowing more of the available resolution to be used, so a dynamic power supply is very useful.

The control system is actually a direct loop with MCU override, once the PSU is at maximum the MCU will hold it for appx 1 second before releasing the system back to it's own control, unless encountering another "near clipping" event.

If we get another "near clipping" Bass boost is cancelled (it normally is already in saturation by it's own control) and the physiological volume control is cancelled.

After that we use the attenuator to lower the volume until we stop getting indications of near clipping.

After a set time without "near clipping" we release the various measures.

Attack time is essentially MCU loop time, while release was tuned "by ear" for the greatest bass output and volume without perceptible "pumping".

The system is incredibly successful in maximising clean output from a limited size/power active speaker. Subjectively it goes lower and much louder than bigger speakers.

I think using a MCU to in effect act as "sound engineer" allows systems that operate beyond simple limiter/compressor based "processed" speaker systems.

Thor
 
With the huge advances in digitally based audio projects and products over the years, it is fascinating to find that some of the 50 + year old analogue compressor concepts are still alive and well - at least in the hobby world!
Those projects that still use opto-couplers, tubes or even distortion prone FETs for their gain control elements, for example....
I suppose they're really just audio engineering versions of things like steam engines and vintage cars....but slightly less costly! :)

As for the commercial viability of many purely digital audio software projects, looking ahead?....
Well, you do have to wonder if there's likely to be much money to be made, when even complex projects like this: Hellfire Broadcast Audio Processor are being offered for free! :)
 
I did something like this using the main 32Bit ARM MCU in an "All in one" product (Smart Speaker).
This includes a hardware dynamic bass boost (the limiter is based on the LF Speaker capability) with override from the MCU and adjustment from the MCU, a Physiologically corrected volume control in 8 steps and a 0.5dB per step electronically controlled resistor ladder digipot Plus a switchable power supply that operates at low voltage for "normal" conditions.

The system is driven of an "approaching clipping" detector that triggers at 1dB below clipping.

It is a kind of "telescoping" system, if the "near clipping" detection is triggered the first action is to boost the power supply voltage. Running Class D Amplifiers with the lowest possible supply voltage for the output stage allows the amplifiers modulator at a higher modulation index, allowing more of the available resolution to be used, so a dynamic power supply is very useful.

The control system is actually a direct loop with MCU override, once the PSU is at maximum the MCU will hold it for appx 1 second before releasing the system back to it's own control, unless encountering another "near clipping" event.

If we get another "near clipping" Bass boost is cancelled (it normally is already in saturation by it's own control) and the physiological volume control is cancelled.

After that we use the attenuator to lower the volume until we stop getting indications of near clipping.

After a set time without "near clipping" we release the various measures.

Attack time is essentially MCU loop time, while release was tuned "by ear" for the greatest bass output and volume without perceptible "pumping".

The system is incredibly successful in maximising clean output from a limited size/power active speaker. Subjectively it goes lower and much louder than bigger speakers.

I think using a MCU to in effect act as "sound engineer" allows systems that operate beyond simple limiter/compressor based "processed" speaker systems.

Thor
Sounds clever... The thing I really like about digital design is that you can incorporate in if/then decision making. To perform similar tricks using old school analog technology is complex and not very cost effective.

JR
 
Those projects that still use opto-couplers, tubes or even distortion prone FETs for their gain control elements, for example....
I suppose they're really just audio engineering versions of things like steam engines and vintage cars....but slightly less costly! :)

Hardly. The dynamic LF boost in the product I mentioned uses a J-Fet as control element, precisely because it produces some low order harmonics while limiting.

As for the commercial viability of many purely digital audio software projects, looking ahead?....

I think the combination of both analogue and digital side chain with classic analogue control elements, or modern digitally controlled stepped attenuators are interesting.

A digital side chain do thing nothing analog can do. What's more, we now have many options for digitally controlled analogue gain.

So a new generation of analogue and even Multiband dynamic processing are possible.

I also have these systems in hardware DSP, but even the best routines sound "digital" to various degrees.

Thor
 
Sounds clever... The thing I really like about digital design is that you can incorporate in if/then decision making. To perform similar tricks using old school analog technology is complex and not very cost effective.

Yes.

You can also use a modern 32 bit MCU to perform AD conversation on multiple inputs, analyse the resultant signal and act predictive to start limiting a strong transient before it reaches thresholds, acting on slew rate and other parameters.

My system uses one sensor "almost clipping") and four effectors in the power supply control, bass boost control, physiological volume control and actual stepped gain control.

At each near clipping event the program evaluates the system state and takes the sonically least damaging action to avoid (repeated) clipping.

Making each system analogue control only with interlocks and other means is a nightmare and likely needs more than the simple sensor I use.

In practice, I have not even really seen an equivalent system in purely the digital domain, in a Speaker DSP we end up using dynamic EQ with its own control and reaching the end of the "dynamic" part before the output limiter/compressor engages.

Thor
 
Yes.

You can also use a modern 32 bit MCU to perform AD conversation on multiple inputs, analyse the resultant signal and act predictive to start limiting a strong transient before it reaches thresholds, acting on slew rate and other parameters.

My system uses one sensor "almost clipping") and four effectors in the power supply control, bass boost control, physiological volume control and actual stepped gain control.

At each near clipping event the program evaluates the system state and takes the sonically least damaging action to avoid (repeated) clipping.

Making each system analogue control only with interlocks and other means is a nightmare and likely needs more than the simple sensor I use.

In practice, I have not even really seen an equivalent system in purely the digital domain, in a Speaker DSP we end up using dynamic EQ with its own control and reaching the end of the "dynamic" part before the output limiter/compressor engages.

Thor
One lesson I recall from Peavey's decades of experience with analog clip limiting (DDT used on all Peavey amps), is that combining fast attack with fast release can make it less objectionable sounding. The fast release avoids audible level pumping and envelope cross modulations.

In theory you could do even better with a look ahead delay, but you probably need the powered speaker to play in real time. Anticipating the clip with the slightly lower threshold will buy you some time, but not much. DDT was triggered only by actual clipping or any discrepancy between output and input (like current limiting, etc).

JR

PS: Back when I was doing consoles I would provide overload indicators that fired 3dB before clipping, JIC.
 
I agree that DSP has advanced to a point where many things that are still very expensive and complex to implement in analog, are now quite simple for a DSP, however one must consider that a digital sidechain incurs an unavoidable amount of delay compared to an analog sidechain or analog dynamics signal path.
Processing delay is not an issue with speaker processors and large distributed audio systems and any small processing delay is imperceptable to the user since audio enters as digital, or is converted from analog to digital, processed and sent to the speaker amps in a single linear path.
With a digital sidechain controlling an analog dynamics path there will be a disparity in speed between the analog and digital signal paths.
Regardless of sample rate and processing speed, each step in the digital chain:
-A-D conversion, DSP processing and D-A conversion to control the gain element, all generate delays that add up.
The resulting sidechain control voltage will lag behind the analog transient you are attempting to control, no matter how fast the DSP chain is.
Cv processing lag will probably not be an issue for the majority of compression function, and certainly no problem where a less than instantaneous attack is actually desirable, but the processing delay could create undesirable artifacts for fast peak limiting, especially on high frequency transients.

George Massenberg stated in an interview not long ago, that the idea of developing a DSP based core to replace the extremely complex analog computer in his 8900 dynamics processor was one of his hopes many years ago, but feels that it is only now becoming possible, and likely only with the latest highly advanced DSP cores.
Another example of speed and power required for digitally controlled dynamics, check out how much processing is required for dynamics plug-ins on any DAW. You will find even relatively simple dynamics plug-ins require, at minimum 4x the processing power of even the most powerful eq plug-ins.

The RNC does prove that some form of digital dynamics sidechain is not only practical, but really quite useful.

None of the above statements should be considered anything but points that need to be considered. It is now up to the perfect collaboration of electronic design and elegant coding and see what happens.
 
One lesson I recall from Peavey's decades of experience with analog clip limiting (DDT used on all Peavey amps), is that combining fast attack with fast release can make it less objectionable sounding. The fast release avoids audible level pumping and envelope cross modulations.

Fast release can help, but if the limiter is activated by strong bass signals (it usually is) we get "pumping" which a longer release time avoids.

With a MCU we can use repeat events to adjust the release time, as it is purely programmed and can have a much more complex decision tree than analogue timing via RC. It is also easy to manage multiple effectors.

We could combine (for example) a RMS/average based auto leveler using dynamic timing to -12LUFS with a frequency dependent peak limiter and all controlled with an 0.5dB/step digipot with zero crossing to change levels using a completely digital sidechain with a 5 USD ARM Cortex MCU which includes a 12 Bit 1MS/s SAR ADC and still use the Pot also for Level setting (and auto-level around the set nominal level).

Thor
 
I agree that DSP has advanced to a point where many things that are still very expensive and complex to implement in analog, are now quite simple for a DSP, however one must consider that a digital sidechain incurs an unavoidable amount of delay compared to an analog sidechain or analog dynamics signal path.

Analog sidechains with RC timing are subject to delays and we call these delays "attack timing:... :cool:

Current commodity MCU's allow (for example) 4 Channel ADC at 250KS/sec (or 250kHz) and the DSP timing is down to what we do, e.g. how many samples we average. Analogue outputs would use PWM in the MHz range and likely be at a given "rest" level.

I actually worked on a system like this (it was not completed as the overall project was cancelled for commercial reasons not related to the tech) for an active all analogue speaker. It originally had fairly complex analogue side chains to control LF EQ, LF Level (optoresistors) and HF Level based on thermal driver modeling (RMS), excursion modeling (LF only) and amplifier clipping avoidance.

Moving the sidechain to a MCU was a major step forward, though the software was still being developed when we cancelled the project.

I maintain that a digital sidechain can be "faster" than an equivalent analogue sidechain, especially as we can include some degree of "predictiveness"

Cv processing lag will probably not be an issue for the majority of compression function, and certainly no problem where a less than instantaneous attack is actually desirable, but the processing delay could create undesirable artifacts for fast peak limiting, especially on high frequency transients.

Modern MCU's operate at 32 Bit with 100's of MHz core speed at commodity pricing. They are fast enough in fact for fully digital processing at 96k/24Bit of complex dynamics and, EQ and other effects to have no lag perceptible to musicians or for TV use in Lip Sync. I use such a SOC in products currently under development. They are loaded with studio mastering grade algorithms developed by a famous sound engineer at a famous studio for use original with Pro-Tools. Sound extremely good.

Such MCU's will eat sidechain processing for dynamics for breakfast, without salt.

George Massenberg stated in an interview not long ago, that the idea of developing a DSP based core to replace the extremely complex analog computer in his 8900 dynamics processor was one of his hopes many years ago, but feels that it is only now becoming possible, and likely only with the latest highly advanced DSP cores.

This may be true. It may however also be true that using alternative approaches that do not emulate analogue via DSP but use different approaches may end up superior and can use much older DSP/MCU systems and perform adequately.

This is always the dichotomy.

Do we try to use digital audio systems to emulate analogue workings and try replicate old analogue controls, or do we go ever forward into this brave new world of digital and try to maximise what we get in this new world.

Do we look back or do we look forward?

 
Fast release can help, but if the limiter is activated by strong bass signals (it usually is) we get "pumping" which a longer release time avoids.
FWIW the design intentions of DDT was to make it sound better than clipping, and to protect loudspeakers from customers turning up amps too loud. (ironically perhaps customers often preferred the sound with DDT turned off because it was..... louder). That said DDT saved lots of speakers and power transformers from customer abuse.

My sense of pumping is when some transient event(s) reduce the wide band gain and we hear the recovery as everything else builds back up to the prior gain level. Very fast release can avoid this apparent pumping but at the expense of visible (audible?) distortion on steady state LF tones. Compared to hard clipping loud bass, a little extra distortion was not a problem.
With a MCU we can use repeat events to adjust the release time, as it is purely programmed and can have a much more complex decision tree than analogue timing via RC. It is also easy to manage multiple effectors.
exactly, that is the beauty of digital side chains. (y)
We could combine (for example) a RMS/average based auto leveler using dynamic timing to -12LUFS with a frequency dependent peak limiter and all controlled with an 0.5dB/step digipot with zero crossing to change levels using a completely digital sidechain with a 5 USD ARM Cortex MCU which includes a 12 Bit 1MS/s SAR ADC and still use the Pot also for Level setting (and auto-level around the set nominal level).

Thor
From my bench work using DPOTs for gain control if the resolution (steps ) are small and frequent enough, only switching on zero crossings was not necessary, of course better is always better. When I designed the automatic mixer I coded in the hooks for zero cross switching, but never implemented it. But that SKU died on my bench unfinished when the company I was working with dropped the project (for other reasons). I might have included zero cross switching on a final release version.

JR
 

Latest posts

Back
Top