Saturday, January 3, 2015

Exponential VCA, first try

After getting a very good result from the linear VCA, I felt like making an exponential version as well. The Lockbox VCA has an exponential converter, so why not try to use the same thing here?

I have written a long text about the exponential converter and learned a lot about it, so I had everything I needed in terms of theory ready. Reading this will give good insight to why the exponential converter is like it is and how it works, but it is not necessary to follow the reasoning in this post.

The most important result from the document is that the output current from the converter, Ic, can be written as:

   Ic = Is * e^(Vb/Vt)

where

  • Is is a constant reference current
  • Vb is the voltage at the base of a transistor in the converter, which is a fraction of the CV.
  • Vt is a constant that - unfortunately - changes with temperature.


The exponential curve

My big question when I started looking at the exponential VCA was how exactly the exponential curve should be. Where should it start?

Now, this may sound strange, one would always like the control current to be 0A when the CV is 0V, and at its maximum when the CV is at max. Unfortunately, the formula above will NEVER be zero. When the CV is 0V, e^(Vb/Vt) equals 1, and so Ic = Is. We may add a negative voltage so that e^(Vb/Vt) becomes less than one, but it will still never be zero.

The question then is, how close to zero do we have to get before we cannot hear the signal passing through the VCA any more?

Offness

I tried some component values and looked at the result on the scope. It looked good, but when I tried connecting the output to an amplifier, I could easily hear the sound even when the CV was 0V. After some googling, and realising that I had what I needed in my bookshelf, I discovered a few nice rules.

Douglas Self writes about this in the chapter "Volume and Balance control" of his book "Small signal audio design".

He states that a good volume control should cover at least 50dB, and at least -70dB attenuation is needed to get a good "offness", where you cannot hear much of the signal any more. But what the heck does that mean?

I will not go into details about decibels, but here is a rule of thumb: If you increase a signal 10 times, you have raised the volume by 20dB. Increase it a 100 times and you have raised it by 40dB. Similarly, divide the signal 10 times and you have decreased it by -20dB. Divide it by 100 and you have decreased it by -40dB.

Volume controls (and VCAs) work by attenuating the input signal. The input should be at its highest and the volume control only "pinches off" parts of it, reducing the volume. So, as a consequence of the previous paragraph, when the volume is reduced to 1/10th of the initial volume, it has been reduced by -20dB.

To figure out how much -50dB and -70dB are, we can use the formula

   Change in dB = 20 * log(Output/Input)

Where log is the 10-logarithm.

Refactoring the formula gives us that

   Output = Input * 10^(Change in dB / 20)

At -50 dB:

   Output = Input * 10^(-50 / 20) = Input * 0,00316

At -70 dB:

   Output = Input * 10^(-70 / 20) = Input * 0,000316

In other words, the output is 0.00316 times the input when reduced by -50dB and 0.000316 times the input when reduced by -70dB. So, now we got something to aim for.

What attenuation to aim for

So, should you go for the -50dB or -70dB slope? Well, that depends of course. I have build both, and there is a significant difference in the offness. There is a faint but clearly audible sound from the -50dB VCA even when the CV is at 0. With the -70dB VCA I had to walk up to the speaker and put my ear next to it, and even then could only hear an extremely low sound (my wife actually heard it before me).

The problem with the -70dB contra the -50dB is that what you gain in offness, you lose in fine control of the higher-volume parts. You have to turn the volume pot of the -70dB one a bit before you reach the starting point of the -50dB one so you get less pot travel for controlling the rest. The difference is not extreme but it's necessary to be aware of it.

I would probably go for the -70dB, but if you do not need the output to be completely off (maybe the output is masked by the output of other sounds?) you may choose the -50dB version.

-50dB curve. Straight line is CV, 0 to 5V. Curve is response of a 5V input signal. Note: not finely adjusted so top misses 5V a bit.
-70dB curve. Straight line is CV, 0 to 5V. Curve is response of a 5V input signal. Notice how the bend is sharper and starts later than on the -5dB one.

Calculating vital parameters

We already know from the linear VCA that a maximum control current of 1.515mA will give unity gain within the circuit used, so we'll use that as a starting point. I will only show calculations for -70dB, but it is similar for -50dB and -100dB.

With a maximum current of 1.515mA, the minimum current must be

   0.000316 * 1.515mA = 0.479 uA for -70dB attenuation.

To see what this means for input CV voltage, we need to use the exponential formula again.

Remember,

   Ic = Is * e^(Vb/Vt)

which means that

   Vb = Vt * (ln(Ic) - ln(Is))

Vt varies with temperature, it is in fact

   Vt = ((degrees in celcius +273.16)*1.38*10^-23) / (1.6*10^-19)

This means that at 20 degrees celcius ("room temperature"), Vt = 25.3mV

Is is a constant that we choose ourselves. From my initial trials I found that an Is of 15V / 510kOhm = 29.4uA worked fairly well, so I chose that for my further calculations

Now we  can find Vb:

   At 0.479uA, Vb = 25.3 * 10^-3 * (ln(0.479*10-6) - ln(29.4*10^-6)) = -100.6mV

   At 1.515mA, Vb = 25.3 * 10^-3 * (ln(1.515*10-3) - ln(29.4*10^-6)) = 96.27mV

In other words, the voltage span needed to control the VCA from 0 to -70dB is

   96.27mV - (-100.6mV) = 196.8mV

Ah, but our CV spans 5V, and it starts from 0, not -100.6mV? Well, that can easily be corrected by an opamp summer with gain < 1.

By using a 1k feedback resistor and a 25k input resistor, our 5V CV is reduced to a 0.2V CV. To move the starting point to -100mV we only need to add a negative voltage. If we use the negative supply rail, -15V, we have to divide it by 150 to get to -100mV. As it has to run through the same 1k feedback resistor, we need to run it through a 150k resistor to get this attenutation.

A word of confusion

I have neglected to mention one thing. The exponential converter described above requires a positive Vb and it has its positive reference current Is and control current Ic running down into the collectors of the exponential converter transistors.

The output of the opamp summer connected to the CV circuit however, inverts the voltage giving us a negative CV. At the same time, the LM13700 requires a positive current running INTO pin1.

Fortunately, a PNP-transistor based exponential converter works exactly opposite of the NPN based one described in my texts about the exponential converter. Instead of a positive Vb it requires a negative one, and its reference current Is must run out of the collector. So by connecting the reference current generating resistor to -15V instead of 15V we are good to go.

Temperature is a bastard

Although we now have a working exponential VCA, it only responds accurately to the CV when the temperature is exactly 20 degrees celcius. This is because of the Vt mentioned earlier.

To see just how bad this gets, we can do some quick calculations:

TemperatureVtIc maxPercentage of 20 degrees
023.6mV2.02mA133%
1024.4mV1.74mA115%
2025.4mV1.52mA100%
3026.1mV1.33mA88%
4027.0mV1.18mA78%
5027.9mV1.05mA69%

This may pose a bit of a problem. It is likely that the temperature will be higher rather than lower than 20 degrees, so the current will probably never be too high. Still, it may be a good idea to add a trimpot to the voltage that moves the starting point so that you can adjust your VCA to work best at your desired temperature. This will also alter the maximum attenuation, but not dramatically.

An exponential converter that works better with temperature changes will be suggested later.


Suggested resistor values for -50dB, -70dB and -100dB:

attenuationGain, R15CV, R4Trim, R3Trim if variable voltage/pot.
-50dB1k33k292k220k
-70dB1k25k150k120k
-100dB1k18k84k275k

If a trim pot or variable voltage is connected to the CVTRIM input, use the resistor value in the last column. If not, connect CVTRIM to -15V.
Dual exponential VCA with -50dB attenuation, 0-5V CV

No comments:

Post a Comment