Engineers Thumb (V2 2016) - Gain Plots and Compression Ratio

Started by Rob Strand, May 17, 2023, 01:15:48 AM

Previous topic - Next topic

Rob Strand

FYI, some interesting results for non-inverting feedforward compressors like the Engineers Thumb.

Due to some recent threads I used this Engineers thumb as a test case for
some stuff I've had on the back-burner for a while.

I may update the results if I find errors or refine the spice models
but overall the results look OK to me.
--------------------------------------------------------------
Engineers Thumb V2.0 (2016) - gain curves
Rob S, V1.0, 17 May 2023

Main aims:
- Experimental method of generating compression ratio curves
  in LTspice
- Show the Engineers thumb does not have an implicit blend
  despite the non-inverting configuration.

The circuit to be analysed is the Engineers Thumb V2.0 (2016) [2].

In [1] and [3] I argued that the Engineers Thumb has an
implicit clean blend as a result of the non-inverting
configuration.  It turns out that is *not* the case.

Why doesn't it clean blend?   
- The primary reason is because the  OTA input is Vout and not the
  voltage across the feedback resistor.
- A second observation is when the transconductance is high the OTA
can actually set the gain below unity, which should not be possible
if the non-inverting configuration is a clean blend.

Where the non-inverting configuration comes is the base-line gain
(ie. the "1" in the low level gain = 1 + R2/R1).

Reference [4] gives a detailed analysis of similar compressor using
an inverting configuration.
--------------------------------------------------------------
Plots:

I did some plots for different values of the ratio pot, which I call "R2" below.
R1 is the 10k feedback network resistor to Vref.

The plots use peak levels and the dB levels are dBV peak.

The drop in the compression ratio (CR) at high levels is suspected
to be caused by the OTA deviating form the ideal performance
at high IABC currents.

I have not done an exhaustive verification on the LM13700 spice model
used in the simulation.  The CR deviation might be caused by
the model.







--------------------------------------------------------------
Summary: (gain and CR curves)

The plots are scaled for peak voltages.
The dB scaling is shown as dBV peak.
Traditionally dBV is based on rms levels and is 3dB lower than dV pk in the plots.

Effect of components:
- The compression ratio pot (1M) actually sets the threshold,
not the compression ratio.  In ideal terms the pot shifts the
gain curve left/right.  In practice the non-ideal OTA behaves
cause some deviation from this at high levels.
- The feedback resistor to Vref (10K) sets the gain
   and hence the unity gain point.

For rms voltage levels from simulated curves
   R_ratio   Input Threshold   Unity Gain
   1MEG   -48dBV      -16dBV
   100k   -36dBV      -17dBV
   10k   -21dBV      -17dBV

The threshold is defined here as the knee point on a dB vs dB plot.
--------------------------------------------------------------
Expected Values: (calculations)

- In the following kV is the voltage divider ratio feeding the input of the OTA (kV ~1/46.5)

- The LM13700 transconductance is,

   gm ~ (IABC / 500uA) * gm0,  gm0 = 9600uS.

Since the detector sets IABC = 1mA when Vin pk = 1V, we have,

   gm  = (Vin_pk / 1000) * (1/500u) * 9600u = Vin_pk / 52.1

*** The side-chain limits the input to about 1V peak.

- The unity gain point is when gm = 1/(kV * R1)
  where,
   R1 is the 10k feedback resistor

We can relate R1 to the unity gain point,

   gm = Vin_pk / 52.1 = 1/(kV * R1)

or   Vin_pk = 52.1 / (kV * R1)

The calculated unity gain point with R1=10k is -15.3dBV.
There is about 1dB attenuation at the output due the 1k + 10k pot,
making the unity gain point -16dBV, which agrees with the simulation.

- The threshold can be loosely calculated as the point where gm = 1/(kV * R2).
  Here the threshold is the the 6dB gain reduction point, not the knee point.
  where,
   R2 is the ratio pot resistance the ratio pot.

We can relate R2 to the threshold,
   gm = Vin_pk/52.1 =1/(kV R2)
=>   Vin_pk = 52.1/(kV * R2)
   If R2 = 100k then Vin_pk = 24mV pk
   or Vin = -35dBV

  This just happens to agree with the knee point but
  at R2 = 10k and 1MEG the agreement is not as good
  due the different threshold definitions.

- The output limit voltage is when Vout_pk = 52.1 / (kV R1//R2)
  which is approximately Vout_pk = 52.1 /(kV * R1) when R2 is large.

  Which is approximately equal to the -6dB reduction threshold point.

  For R1 = 10k we get Vout_pk = 240mV or -12dBV pk, and -13dBV pk
  allowing for the 1dB output attenutation, which agrees with
  the simulation plots.
--------------------------------------------------------------
References:

[1] Merlin, post: "THE ENGINEER'S THUMB... At last, a better compressor!"; April 21, 2012
    https://www.diystompboxes.com/smfforum/index.php?topic=97123.0

[2] Merlin, "The Engineer's Thumb: LM13700 Compressor / Sustainer"
     Version 2.0, 2016
     https://www.valvewizard.co.uk/engineersthumb2.html

[3] fryingpan, post: "Available compressor circuits?"; April 18, 2023
https://www.diystompboxes.com/smfforum/index.php?topic=130452.0

[4] A.J. Oliveira, "A feedforward side chain Limiter/compressor/de-esser with improved flexibility", 
https://ajoliveira.com/ajoliveira/gen/pdf/preprints/paris88.pdf
(If this link doesn't work try later.  Access comes and goes.)

[5] National Semiconductor, LM13700 datasheet.
--------------------------------------------------------------

Send:     . .- .-. - .... / - --- / --. --- .-. -
According to the water analogy of electricity, transistor leakage is caused by holes.

merlinb

Clean blend can be proven a much simpler way:

1: The ratio knob changes the compression curve, anywhere between unity gain and limiting;
2: The ratio knob has no affect on the the sidechain or the control current being fed into the Iabc pin;

Therefore the only thing that is changing the compression curve is the changing combination -or blend- of linear and nonlinear feedback around the opamp.

Rob Strand

Quote from: merlinb on May 17, 2023, 04:30:01 AM
Clean blend can be proven a much simpler way:

1: The ratio knob changes the compression curve, anywhere between unity gain and limiting;
2: The ratio knob has no affect on the the sidechain or the control current being fed into the Iabc pin;

Therefore the only thing that is changing the compression curve is the changing combination -or blend- of linear and nonlinear feedback around the opamp.
I don't think it's clean blend as we know it.

On one hand at small signal levels the side-chain is essentially providing little current to the OTA so the OTA output current is very small (basically gain scaled back to nothing when IABC is small, or zero and hence the OTA is not present).   So for small signals the signal that passes is essentially clean signal with gain 1 + R2/R1.   That's the gain part below the "threshold".

*However* if we derive the transfer function (along the lines of reference [4]) but with the addition of the feedback resistor (instead of the minimum IABC current in ref [4]) then we get,

     gain = vo / vi = (1 + R2/R1) / (1+ kV*gm*R2)

or,
     vo = vi * (1 + R2/R1) / (1+ kV*gm*R2)

At low inputs we get gm ~ 0 so vo = vi (1 + R2/R1)   ; the non-inverting amp gain.

but at high inputs where gm <> 0 we can't write vo as

    vo = vi * clean gain  + vi * controlled gain                ; this is the form required by the clean blend.

because no matter how we spin it there is a gain dependent term (1 + kV*gm*R2) in the denominator.
We only get the a pure clean part at when gm --> 0 (ie. close to zero input level).

So I think technically it's not a clean blend.

However *if* kV*gm*R2 is  small then we can approximate 1 / (1 + kV*gm*R2)  ~  1 - kV*gm*R2 and the gain is approximately,

           gain ~ (1- kV*gm*R2) * (1 + R2/R1) = (1 + R2/R1) - (1 + R2/R1) *kV*gm*R2.   

The (1+R2/R1) is now the clean gain part and the (1 + R2/R1) *kV*gm*R2 is the gain controlled part.

So it *approximates* clean blend only when the input is small.    We already know it should do that because that's the gain region below threshold.   All I've done here is show that mathematically.
Send:     . .- .-. - .... / - --- / --. --- .-. -
According to the water analogy of electricity, transistor leakage is caused by holes.

merlinb

Quote
(1 + R2/R1) / (1 + kV*gm*R2)
Simplify this down to just x and y:
(1+x) / (1+y)

= (1+x) * (1+y)^-1

Apply the binomial theorem:
= (1+x) * (1 − y + y^2 − y^3 + y^4...)

Put the original terms in:
=(1 + R2/R1) - (1 + R2/R1)(1 + kV*gm*R2) + (1 + R2/R1)(1 + kV*gm*R2)^2...)

The linear term is right there, no?





Rob Strand

Quote from: merlinb on May 17, 2023, 07:17:23 AM
Quote
(1 + R2/R1) / (1 + kV*gm*R2)
Simplify this down to just x and y:
(1+x) / (1+y)

= (1+x) * (1+y)^-1

Apply the binomial theorem:
= (1+x) * (1 − y + y^2 − y^3 + y^4...)

Put the original terms in:
=(1 + R2/R1) - (1 + R2/R1)(1 + kV*gm*R2) + (1 + R2/R1)(1 + kV*gm*R2)^2...)

The linear term is right there, no?
Yes, when you add more terms the approximation becomes better but (1 − y + y^2 − y^3 + y^4...) only converges to 1/ (1+y) when y  is less than 1.  So only valid when kV*gm*R2 < 1 which is the region below "threshold".
(A series has a radius of convergence or region of convergence, which in this case is |y| < 1.)
Send:     . .- .-. - .... / - --- / --. --- .-. -
According to the water analogy of electricity, transistor leakage is caused by holes.

Rob Strand

Here's the correct mathematical way to handle the case where kV R2 gm isn't small, ie. above the threshold:

If Vin is not small then kV R2 gm isn't small. However we can rewrite things as,

   1 / (1 + kV R2 gm) = ( 1/(kV R2 gm) ) * 1 / ( 1 + (1/(kV R2 gm) )

Now 1/(kV R2 gm) is small and we can make the approximation,

   1 / ( 1 + (1/(kV R2 gm) ) ~ 1 - 1/(kV R2 gm)

So,
   1 / (1 + kV R2 gm)  ~  ( 1/(kV R2 gm) ) * ( 1 - (1/(kV R2 gm) )
                         = 1/(kV R2 gm)  - 1/(kV R2 gm)^2
                          ~ 1/(kV R2 gm)   ; the obvious result from the start as kV R2 gm > 1

Both terms are dependent on gm, so the gain at high Vin
does not look like a clean blend.   

So it's clean blend at low levels and gain controlled at high levels.

In fact since gm is proportional to magnitude of Vin_pk due to the feedforward
side-chain and we can show Vout approaches a constant.  That means we
have a limiter.  (That would not be possible if we had a clean blend.)





Send:     . .- .-. - .... / - --- / --. --- .-. -
According to the water analogy of electricity, transistor leakage is caused by holes.

Rob Strand

Just for the sake of it I made an inverting opamp version of the engineers thumb with the same base-line gain as the non-inverting version.   I then inverted the signals just so all the signal phases were the same so we can compare the two versions.

The motivation here is we might see the potential for clean blend from the non-inverting stage, but we do not expect any clean blend from a non-inverting stage.   By clean blend I mean inherent blending due to the non-inverting form of the circuit, not the clean gain when the OTA is off.

The two circuits essentially produce the same output, as seen by differencing the outputs.  1mV error with 1V in.


Send:     . .- .-. - .... / - --- / --. --- .-. -
According to the water analogy of electricity, transistor leakage is caused by holes.

Eb7+9

Quote from: Rob Strand on May 17, 2023, 09:17:42 PM

By clean blend I mean inherent blending due to the non-inverting form of the circuit, not the clean gain when the OTA is off.


notice that R13 (1Meg) was included to make sure OTA never shuts off completely ...
and side-chain kicks in at around 15mVpp, as mentioned on merlin's page (verified with SPICE)

there's no clean-blend here ...

---

Quote
"AUTOMATIC LEVEL CONTROL
The NE570 can be used to make a very high performance ALC as
shown in Figure 17. This circuit hook-up is very similar to the basic
compressor shown in Figure 2 except that the rectifier input is tied
to the input rather than the output. This makes gain inversely
proportional to input level so that a 20dB drop in input level will
produce a 20dB increase in gain. The output will remain fixed at a
constant level.
As shown, the circuit will maintain an output level of
±1dB for an input range of +14 to –43dB at 1kHz. Additional external
components will allow the output level to be adjusted"

https://www.experimentalistsanonymous.com/diy/Datasheets/SA571%20AN.pdf

the earliest reference I could find was in Walt Jung's paper on page 442, although there's a little bit of confusion there ...

https://archive.org/details/hamradioversion/HR_1977/page/n441/mode/2up?view=theater

most audio processors don't use the ALC approach ...
in this sense, THUMBS is quite unique

more importantly, at low RATIO this circuit starts acting like its FBK counterpart - the (simple) compressor

www.lynx.net/~jc/THUMBS-IN-OUT-transfer.jpg

so, the idea is by no mean useless per se of course ...
ie., nothing wrong with having the circuit operate in either mode at the throw of a switch

nonetheless, THUMBS is an ALC structure (maybe well disguised) and it does a darn fine job as an ALC circuit

http://www.lynx.net/~jc/THUMBS-ALC-sinewave-regulation-2Vpp.gif


in the above extreme (101:1) simulation R13 plays no role, so it's removed ...
the side-chain RATIO is also dropped by factor of 4 ... for those curious to go further with this

---

steady-state stuff ...

Rob Strand

Quotenotice that R13 (1Meg) was included to make sure OTA never shuts off completely ...
and side-chain kicks in at around 15mVpp, as mentioned on merlin's page (verified with SPICE)

there's no clean-blend here ...
In my books it's clean.   If you pull the side-chain off completely the IABC current simply sets a fixed (clean) gain.   The signal passes through the OTA but it is not gain controlled.  So it's a clean signal using the OTA. [The other way to say it is it sets the gain, and isn't part of any dynamic gain control.]

The OTA has characteristic,

          gm = (gm_ref/IABC_ref) * (IABC0 + IFF) = kg (IABC0 + IFF)

where,
          kg = gm_ref / IABC_ref = 9600uS / 500uA
          IABC0 = DC bleed current through IABC resistor
          IFF = side-chain current (through transistor)

Now take the gain function given above:

Without the DC bleed current

          gain = vo / vi = (1 + R2/R1) / (1+ kV*gm*R2)
                =  (1 + R2/R1) / (1 + kV*R2*kg*IFF)

With the DC bleed current,

             gain  =  (1 + R2/R1) / (1 + kV*R2*kg(IABC0 + IFF))
               =  (1 + R2/R1) / ( (1 + kV*R2*kg*IABC0) + kV*R2*kg*IFF)
               =  (1 + R2/R1) * { 1/ (1 + kV*R2*kg*IABC0) } / (1 + kV*kg*IFF* R2 / ((1 + kV*R2*kg*IABC0)) )
               = (1/R1 + 1/R2) * { R2/ (1 + kV*R2*kg*IABC0) } / (1 + kV*kg*IFF* R2 / ((1 + kV*R2*kg*IABC0)) )

We can write,

            R2' = R2/ (1 + kV*R2*kg*IABC0) = 1/(1/R2 + kV*kg*IABC0)  = R2 // Rg

where, 
            Rg = 1/(kV*kg*IABC0)

then,

        gain = (R2'/R1 + R2'/R2)  1/(1 + kV*kg*IFF*R2')

Compare that form to the case where there's no bleed current (IABC0 = 0):

- In effect the DC bleed current acts like a resistor in parallel with R2.
  In fact we can pull R2 and just use IABC0 - that's what the Oliveira reference does.

- The base-line gain is slightly lower than just replacing R2 with R2' since
   the base line gain is R2'/R2 + R2'/R1 instead of 1 + R2'/R1.
   If we used the inverting form the replacement of R2 with R2' is exact (IIRC).

[With R13=1M, IABC0 = 3.3uA, it creates a parallel resistance of Rg = 730k.]

Quotemost audio processors don't use the ALC approach ...
in this sense, THUMBS is quite unique

more importantly, at low RATIO this circuit starts acting like its FBK counterpart - the (simple) compressor
IMHO the Engineer's Thumb is the non-inverting form of the Oliveira (ref [4] above).    Back in the early 90's I did a version using NE571/NE572 which used the feedback resistor like the Engineers thumb instead of the DC bias current of the Oliveira compressor.   I was using the compressor/limiter before a power amp instead of a pedal.  Instead of making R2 variable, or IABC0 variable, I varied the input level to the side-chain.   That way when the compression is dialed off the OTA/gain control is completely disabled and out of circuit.

In one of the Philips NE570/NE572 application notes there was a variable ratio compressor/expander [AN174 Variable Slope Compressor-Expandor].   However it was limited to 2:1 1:2 ratios.  I wanted a limiter for high levels so I took the ALC form from the NE570 application notes and played around until I got the Oliveira/Engineers Thumb form of the circuit.  I'm pretty sure I did that before I found the Oliveira paper.  I like the R2 form instead of the IABC0 form Olivera used as the signal doesn't pass through the OTA.

I expect the NE570 applications notes had the ALC form before Jung.

Later I added two gain control devices in parallel to reduce noise.
Send:     . .- .-. - .... / - --- / --. --- .-. -
According to the water analogy of electricity, transistor leakage is caused by holes.