Compressor: Independent Ratio, Attack, & Release

GroupDIY Audio Forum

Help Support GroupDIY Audio Forum:

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

Nishmaster

Well-known member
Joined
Aug 25, 2007
Messages
146
Location
Chicago, IL
Greetings all,

I'm struggling a bit with a simple VCA based compressor I'm trying to whip up. I figured it would be relatively straightforward, but whenever I figure that, I'm wrong.

I just can't seem to get a variable attack and release without affecting the voltage divider caused by the configuration. Some values help, but I'm quite certain I'm going to need to go a different route entirely, where the charge and discharge circuit paths have no interaction at all; only, nothing's really coming to me on how I can accomplish that without making yet another interactive voltage divider situation.

Any thoughts? You can treat Input and Input2 as connected. I had them independent in the sim to calculate my attack and release times. It's a full wave rectifier and simple RC time constant to a 2180.
(Schematic attached)

-Matt
 

Attachments

  • N1MComp.jpg
    N1MComp.jpg
    70.7 KB · Views: 197
Come on, these are good easy circuits to learn on... but I'll tell you something else you need to fix too. VCA control ports need to be driven from low impedance for lowest distortion, so you may need to change a few more things.

Hint, to get the att and release to stop fighting each other  consider putting them in parallel with each other since the attack will always be faster than the release (or should be). Also the steering diode drop looks like it's in series with the attack so that will add dead time before it starts limiting. I don't see a threshold control, is that side chain just taking regular audio instead of log converted? The vca only takes a few mV of control voltage per dB so that control law will be awfully fast from linear aiudio...

THAT has plenty of how to app notes on their website.  Start there...

JR 
 
indeed...  The control voltage needs to be buffered and should be a dB/V style of signal (logarithmic linearised) to match the control port behaviour...  check out the app notes for "better VCA performance" as they will have better insight about parasitics like PCB stray capacitance/inductance going into the control port; it is a sensitive node...  The easiest way is to just use the RMS chips from THAT since they are a mirror image analog of control port behaviour...

The diode dead time could be more like a "soft knee" if desirable; this would be true if out of loop diodes with their forward drop was overcome by some gain up-front since the RMS detectors don't put out much... 

I was able to download the SPICE models from THAT (found through google) and I was able to easily import them into TINA TI 9 free simulator to test some of my "stupid VCA pet tricks"... 

The side chain circuits (using a pulse, that would simulate what may come from one of the THAT RMS detector chips, since I did not need to model the RMS detectors to slow down the simulation) may not necessarily need the THAT SPICE models; I think my pulse was similar to the oscilloscope graph in the RMS detector datasheets...  The pulse stimulates the rise time/fall time of the capacitor RCs involved in the side chain for me...

The precision rectifier circuit in the beginning of the side chain tells me that you may be looking for peak response...  There are app notes by THAT that show how to reduce the timing capacitor on their RMS detectors to get more of a peak response...

Pretty much one should read at least 90% of the app notes that deal with the VCAs to glean these little hints here and there as it would seem that the ideas for a design I currently have, for example, in schematic capture/simulation phase borrowed little tid bits from at least 6 or more of the app notes even though the application in the title were seemingly unrelated to what I was looking for...

They also recommend to *not* bread board with a solderless breadboard any of their VCAs (I forget which app note it was in) because of the parasitics (and they have typical remedies for said parasitics in the PCB world, although they seemingly mention it in passing)....

Also check out their evaluation PCBs and the resulting schematics as it is reduced to practice (and some of the evaluation PCBs available from THAT may be in the $100 range)...  This may include these little hints from the multiple datasheets/app notes....

The side chain examples I usually see include a modicum of static gain up front (ratio) with a precision rectifier after the RMS detector, followed by envelope attack/release diode circuits, finally followed with a variable voltage divider or attenuation (the actual ratio tweaky knob on the front panel) of the same amount of sidechain up-front gain to allow getting back to a ratio of 1:1 (overall "unity" gain in the side chain despite up-front gain) or it allows a maximum ratio of what the up-front gain was when set for no attenuation; then the control port is driven with a low impedance op amp circuit.... Since the output of the typical RMS detector from THAT is not that much, the static gain helps to drive any forward diode drops as necessary (although if in a feedback loop a la a "super diode" approach, then maybe not as necessary, but would be an abrupt/hard "knee")...

It seems like you are on the correct path so far, but some modification would be ideal...

Also, pay attention to op amp selection in the side chain, although seemingly not "hi-fi" in the side chain, noisy sidechains (with high value resistors and any additional noise gain after said resistors) or excessive unintended DC offset can have ramifications in the VCA because it is a multiplier (just like superheterodyne style modulators for radio)...

EDIT:  'Twas rushed in this response originally... edited to maybe clear some things up and a spelling mistake...
 
Yes, even the digital gain control app note on the the THAT site was also helpful even though I am not doing digital gain control....  I even gleaned something from the first order filter using VCAs app note too...
 
Twenty Log said:
Yes, even the digital gain control app note on the the THAT site was also helpful even though I am not doing digital gain control....  I even gleaned something from the first order filter using VCAs app note too...

Yup there is lots of good VCA design info on the THAT website. They are keeping up an old DBX tradition of publishing AES papers on design of dynamic controllers, so some old AES papers from the  80's and AES pre prints may be worth digging up too.

I wish there was this much info (and good parts) available back when I designed my first comp... ('80s), but that's ancient history now.



JR
 
Yes indeed... Even in the 1990s and early 2000s it seems to me that it was still the dark ages... when I was starting out trying to design all this audio stuff in my spare time, only to have some unit come cheaper from the local music store than I could buy just the parts for from the usual Digikey and Mouser...  I live down the street from where Mr. Blackmer used to live; just down the "street" from Earthworks... 'Twas nice to see him before his passing...
 
Twenty Log said:
Yes indeed... Even in the 1990s and early 2000s it seems to me that it was still the dark ages... when I was starting out trying to design all this audio stuff in my spare time, only to have some unit come cheaper from the local music store than I could buy just the parts for from the usual Digikey and Mouser...  I live down the street from where Mr. Blackmer used to live; just down the "street" from Earthworks... 'Twas nice to see him before his passing...

I don't know about dark ages, but the VCA technology, inside the IC has continued to advance within the last decade. The general technology for log domain gain control and manipulation seems like it was pretty well sussed out some time ago.

As I understand the history, DB was working for API when he first came up with his VCA design and they passed on the technology... A bit of poor judgement in hindsight. He definitely left his footprints in the melted sands (silicon) of time.. 

JR
 
Thanks for the responses gents. I had been pouring over the THAT app notes already, which are quite good. The 2252 detector would be easier to work with, but as you gathered, Twenty Log, I am looking for a peak response type circuit. The time constant on it is somewhat adjustable, but the release is a bit long for my taste. Also, rolling my own setup helps me learn more than plugging in an app note design and painting by numbers, although I am certainly not disparaging that approach. I have also been looking at the Blackmer RMS detector patent, which has offered some insight. I'm not looking to get that precise, though. This will primarily be a drum compressor and squeaky clean is not the sound I'm going for necessarily.

I've attached a more complete version of the sidechain thus far; what I posted first was more of an LTSpice test jig to try out various attack/release approaches. Things to note that I'm not liking right now:

* Q1 was just what was handy in the sim; I don't work with three legged things enough to know what the usual basic suspects are.

* Sidechain gain is not flat through the audio band, owing of course to the time-constant of R21/C11/R28. I'm worried that this will make for a very "pumpy" design. Stage U7 has some make-up gain to ensure that the offset or "center of ripple" is around the same as incoming AC (before logging), i.e. +/- 2V signal equals 2V DC +/- ripple, but I'm not sure that's the right approach.

* The logging amp will not be all that temperature independent, but I don't see that as a big deal. The threshold is always adjusted by ear anyway, although I suppose it will drift a tad when the unit gets warm.

* Offsets seem to be quite tweaky with the logging amp. I may need some input offset trim at U6, especially if offset from U7 is negative as that of course slams the log amp into the positive rail and adds some delay until the logging action occurs. Might be easier to add it to the bias of U7 and let that carry through to U6, maybe.
 

Attachments

  • N1Sidechain.jpg
    N1Sidechain.jpg
    64.8 KB · Views: 87
Your precision rectifier is NOT a diode. C11 will discharge through R21.

For a low-precision percussion limiter, amplify to a few volts, invert, then use two diodes onto the timing network. The threshold voltage will drop 2mV per degree C..... with levels like 2V and likely performance/studio temperatures the "error" will be insignificant.

> Offsets seem to be quite tweaky with the logging amp.

Yes. I'm thinking you should ponder the Log-Ratio concept. One input is a "fixed" (user knob) reference. The other is the GR request.

> U7 is negative as that of course slams the log amp into the positive rail and adds some delay until the logging action occurs.

You could at least add a PNP parallel to the NPN so it won't slam far. Maybe a diode is ample.

I have a strong feeling you want a linear VCA, not a log VCA.... pity the best ones take log control.
 
I appreciate your trying to design something from scratch, but this is one area where you should consider standing on the shoulders of those who went before.

There are some good generic logging circuits in old national app notes. http://www.ti.com/lit/ds/symlink/lm194.pdf

You will notice they usually use a minimum of two b-e junctions, one for your variable signal, another fed with a unity reference current, this way you get a +/- X mV/dB above and below that nominal 0dB. (I made true RMS using 4 junctions so I could square the signal before I integrated it and then took the square root)

This mV/dB voltage result can be scaled to generate well behaved compressor slopes, etc.

The THAT chip is certainly easier to use. The parts I used to use decades ago to make my own, like cheap transistor arrays are all obsolete now.

JR

PS: You still haven't isolated the attack from release time constants so that can't be adjusted without errors.
 
Thanks John and Paul.

JohnRoberts said:
I appreciate your trying to design something from scratch, but this is one area where you should consider standing on the shoulders of those who went before.

I know. I'm stubborn. ;) I would also like to be able to tweak the sidechain toward a certain sound.

There are some good generic logging circuits in old national app notes. http://www.ti.com/lit/ds/symlink/lm194.pdf

Thanks for that link JR. Some good little circuits in there.

You will notice they usually use a minimum of two b-e junctions, one for your variable signal, another fed with a unity reference current, this way you get a +/- X mV/dB above and below that nominal 0dB. (I made true RMS using 4 junctions so I could square the signal before I integrated it and then took the square root)

The THAT detector datasheet shows a similar configuration to get the square, although they use two transistors in series and keep the offset +1 diode drop going in so the log amp doesn't swing negative at any point. They do have an app note on getting peak response by lowering the charging cap of the RMS detector, but that really doesn't get you log peak, that gets you square peak. Kinda RMS without the "M" part.

PS: You still haven't isolated the attack from release time constants so that can't be adjusted without errors.

The RC shown there is actually just ripple filtering with a quick time constant. The actual compressor attack/release section will come later.

I actually have attached an alternate setup I've been trying, which is more like this:

Code:
Precision Rectifier -> Darlington Pair -> Scaling Amp -> Logging Amp

The darlington pair increases the current drive into the filtering cap C5, which makes the charging of the cap, and thus getting the DC, extremely fast. It then can discharge through R12. U6 corrects the gain error of the preceeding stages so that 1V AC = 1V DC. The offset of Q1 and Q2 carries into U5, which keeps it from ever going negative.

As a transistor lunkhead, I'm sure I've missed some obvious pitfalls, but it seems to sim quite nicely.

-Matt
 

Attachments

  • n1sc.jpg
    n1sc.jpg
    85.6 KB · Views: 61
Nishmaster said:
Thanks John and Paul.


I know. I'm stubborn. ;) I would also like to be able to tweak the sidechain toward a certain sound.
Do whatever floats your boat... the customer is always right.
The THAT detector datasheet shows a similar configuration to get the square, although they use two transistors in series and keep the offset +1 diode drop going in so the log amp doesn't swing negative at any point. They do have an app note on getting peak response by lowering the charging cap of the RMS detector, but that really doesn't get you log peak, that gets you square peak. Kinda RMS without the "M" part.
Using the smallest cap you can get away with on a THAT detector will be close enough to peak for me.

Don't read too much into the RMS square term since in the log domain that is simple 2x, and these results get scaled for VCA dB gain law, so it kind of doesn't matter. It does matter in a proper RMS conversion, because you also apply a square root operation and get a linear result. Staying in the log domain for VCA control, it is just part of the scale term.

Not to go off on another veer, but I did some comparison between RMS and simple average in a console meter I designed a while back and I did not perceive much difference on music. I expect for some specific sound sources it could make a subtle difference, but I suspect RMS is over sold for bringing the magic in dynamics processing.
PS: You still haven't isolated the attack from release time constants so that can't be adjusted without errors.

The RC shown there is actually just ripple filtering with a quick time constant. The actual compressor attack/release section will come later.

I actually have attached an alternate setup I've been trying, which is more like this:

Code:
Precision Rectifier -> Darlington Pair -> Scaling Amp -> Logging Amp

The darlington pair increases the current drive into the filtering cap C5, which makes the charging of the cap, and thus getting the DC, extremely fast. It then can discharge through R12. U6 corrects the gain error of the preceeding stages so that 1V AC = 1V DC. The offset of Q1 and Q2 carries into U5, which keeps it from ever going negative.

As a transistor lunkhead, I'm sure I've missed some obvious pitfalls, but it seems to sim quite nicely.

-Matt

Have fun... if it sims OK and works to your satisfaction, you are home free. Sorry I'm not really enthusiastic enough to pick this apart, since I would take a simpler approach. You don't need to please me, please yourself.

JR
 

Latest posts

Back
Top