MUFF WIGGLER Forum Index
 FAQ & Terms of UseFAQ & Terms Of Use   Wiggler RadioMW Radio   Muff Wiggler TwitterTwitter   Support the site @ PatreonPatreon 
 SearchSearch   RegisterSign up   Log inLog in 
WIGGLING 'LITE' IN GUEST MODE

reducing distortion in OTAs (LM13700, etc)
MUFF WIGGLER Forum Index -> Music Tech DIY Goto page Previous  1, 2, 3  Next [all]
Author reducing distortion in OTAs (LM13700, etc)
guest
i did a bit more work on this topic recently, and thought id share my findings.

1. the original dual OTA scheme (not the one shown directly above) had a lot of issues with PSRR and noise pickup (basically the same issue). this is because the impedance is not matched at both inputs of the OTA. good layout and shielding will help with this, but there isnt any way to fix the underlying problem. if you increase the impedance at the non-inverting pins such that its much greater than the inverting pin, then pickup is canceled via the second stage, but the noise floor gets really high due to the high input impedance. i havent gone back and retested the above dual OTA scheme for this pickup issue, but i suspect its better, as the input impedance is matched at the OTA inputs.

2. so, if you have a spare OTA, how do you best use it? depending upon the circuit requirements, the above dual scheme could be good. otherwise, you can just use it as a current source for the linearizing diodes:



the linearizing diodes on the first stage are used to bias the OTA into saturation. two different methods are shown for producing a positive current out, one pulls the non-inverting pin above ground, and the other pulls the inverting pin below ground. the advantage of these methods, is that the transistor on the input stage that is "off" has exactly 0V Vbe, so there will be no leakage associated with it. and, this 0V Vbe is temperature compenstated. this is ensurd by having the diode current be equal to the bias current into the amplifier. and speaking of the bias current into the amplifier, i used a 10uF capacitor here to improve PSRR and reduce noise. its important that the capacitor be referenced to the negative supply rail.

3. what is the optimal value of "R" (input impedance) in the above circuit to minimize distortion? well, that depends. as you increase R, odd harmonics decrease, but even harmonics increase. im not entirely sure about the mechanism behind it, but this is my guess: as R increase, the voltage drop across R increases. if this voltage drop is small compared to Vbe, then any offset voltage it creates due to resistance imbalances will also be small. this offset voltage mainly causes even harmonic distortion. but, as R increases, the input more closely resembles a current source, which is the ideal input for minimal distortion (the diodes want a differential current as an input, not a differential voltage), so all distortion goes down with increasing R.

4. i ran some tests with varying R, and measured the distortion at 1/4 full scale output, and 1/2 full scale output. i also measure the increase in bleedthrough for a 1k increase in the 100k input resistor (worst case unknown source impedance). for larger R, a mismatched input impedance has a larger effect. here are the results in dB:

R || bleedthrough || 2nd | 3rd @1/2 || 2nd | 3rd @1/4 ||
-----------------------------------
1.00k || 00 || 70 | 42 || 76 | 54 ||
2.22k || 00 || 74 | 46 || 75 | 58 ||
5.63k || 00 || 71 | 53 || 77 | 66 ||
10.0k || 06 || 68 | 57 || 75 | 70 ||
22.2k || 10 || 66 | 64 || 72 | 75 ||
56.3k || ?? || 70 | 57 || 76 | 65 ||
100k. || 20 || 59 | 75 || 67 | 90 ||

sorry for the poor table, if someone knows how to do fixed width fonts on here, please let me know. also, there was something wonky with the 56k readings. i ran them twice and they still made no sense. im wondering if my resistor values were mismatched in some peculiar way to create a null in the second harmonic. at any rate, all of these tests were done with feedthrough nulled. you can see that the input impedance mismatch starts to become an issue at 10k, where R is no longer much, much smaller than 100k. the minimal distortion point is at 22k, which is where 2nd and 3rd harmonics are almost equal. coincidentally enough, 22k was the value i had used for the data collected in the paper (which was entirely accidental, but im very grateful for). also, 10k is around the point where the voltage drop across the resistors are equal to Vbe (i ran the tests with 100uA diode current, so 50uA per R = 500mV). so below this point, Vbe mismatches dominate, and above this point R mismatches dominate. but, if this hypothesis is correct, than an "R" trim could improve performance beyond what is shown here.

TLDR: use 10k or 22k resistors if building an OTA with a fixed current source for the diodes (for 100uA diode current, R would most likely decrease for larger currents).
J3RK
I usually do a "code" box for fixed width.

Code:

Blah 12345
Blah 67890
plushterry
Thanks for sharing your work guest
thumbs up
guest
J3RK wrote:
I usually do a "code" box for fixed width.


Code:

thanks, this helps a lot.
Dr. Sketch-n-Etch
Here's how I reduce distortion in OTAs:



(By not using them.)
guest
i havent tested the distortion of the ssm2164, does it perform better than the datasheet says (.02% = -74dB)?
neil.johnson
guest wrote:
i havent tested the distortion of the ssm2164, does it perform better than the datasheet says (.02% = -74dB)?

I believe it can, based on some bench tests.

Neil
Haralds:Werk
You can reach the 0,02% THD with the LM13700 as well. It is possible with the method that Mike Sims introduced in the EDN Magazine January 1995.
You have to carefully select the LM13700 though because they are quite different from chip to chip and manufacturer.

Here is my take on the Sims VCA: http://www.haraldswerk.de/NGF/NGF_VCA_Sims/NGF_VCA_Sims.html
guest
i have an improvement for the sims VCA, which is shown earlier in this thread, and in the paper listed at the beginning. those both go well below the .02% level, and the simple method i show above gets almost to that level. the SNR isnt as good for the sims version as for other LM13700 implementations, and both of those are worse than the SSM2164. but, the LM13700 using the linearizing diodes is temperature compensated, which the SSM2164 is not (but can be made to be so). the SSM2164 has a lower bound on the distortion it can achieve due to its voltage to current converter at the input stage, which has an offset voltage that is signal amplitude dependent. this can be eliminated with an external voltage to current converter, but thats horribly complicated. both good chips, each with their own strengths.
Haralds:Werk
guest wrote:
i have an improvement for the sims VCA, which is shown earlier in this thread, and in the paper listed at the beginning. those both go well below the .02% level, and the simple method i show above gets almost to that level.


Thank you for the reminder. I have read your paper some time ago but totally forgot about it. Sorry. I will apply your improvement to my Sims Version asap.
neil.johnson
So far, on a sample of one original ADI SSM2164, I've got down to 0.006% THD+N at 0dBu sine wave. It does vary quite a bit with amplitude, supply voltages and mode current so for best performance you need to keep it in its sweet-spot.

Neil
guest
awesome, thanks for that information. datasheets tend to be a bit conservative.
Dr. Sketch-n-Etch
guest wrote:
the LM13700 using the linearizing diodes is temperature compensated, which the SSM2164 is not (but can be made to be so).


When the 2164 is used in linearized mode, as per Mike Irwin's circuit (and virtually every VCA in Euroland), it is temperature compensated. The linearized 2164 VCA has no temperature coefficient.
555x555
I've been going over this paper while trying to design a VCA. First off, thanks for all of this; this is a lot of serious, quantified hard work. I'm a little confused about something. I see you measure harmonic distortion, hence linearity, but can't harmonic distortion be made vanishingly small simply by limiting the swing of the input signal? Like if you increase both the resistor on the output op-amp and on the input network, this makes the harmonic distortion better, at the expense of increased noise. So then, isn't the issue the relative ways to use the OTA that give you the best distortion, given a particular SNR? I'm particularly thinking about your 47k resistor on the bias diodes in the non-opamp version you tested. In some quick simulations, 47k/250u gives nearly as good a current source as an LM317 fixed current source, so this seems like a pretty good value. But then you're also using higher values for the source resistors. Can't you just keep those same higher values for the source resistors, hence getting the same SNR, but with less distortion bc the input swing gets smaller? Like, if we drive the LM13700 right to the point of clipping, there are some configurations that give up linearity more gradually than others. But if some configurations also give us lower SNR, then we have to drive the LM13700 less hard to get the same SNR, and hence don't we gain in linearity?

Thanks in advance for the clarification.
guest
you are correct that the issue is THD/SNR, not just THD. the output noise is linear with bias current, and doesnt change a whole lot with diode current or input resistors (up to a point, of course. the noise contribution of the diodes and input resistors is typically small compared to the current noise in the output stage). so, the real metric, is what THD you get for a particular percentage of full scale drive. for example, if you have 100uA of bias current, the ouptut can swing +/-100uA at full scale. so if i give an input that drives it at +/-50uA at the output, im at 50% full scale. the graphs of distortion in the paper are almost these graphs, but not quite. some of the input/output relations are not very linear at high drives, so they get worse at the upper levels. but, for most of the range, the graphs can pretty much be taken as THD/SNR graphs as well.

if you go to small input swings, you get worse SNR (i have some of this quantiifed in my 2164 posts from a few months back). but, you also get worse offset voltage variation. this hurts in a couple of ways. first off, your second harmonic distortion is a function of offset voltage, so that can easily drift into problematic areas, and the feedthrough is offset voltage dependent as well. so if your input signal is 5mV, and offset might drift 1mV, that is a much higher percentage of total range than if you were inputting a 50mV signal.

ive gone through and optimized the design for the case where a current source (of any sort) is used for the diode bias. there is a tradeoff between source resistance and diode current. i think i settled on 100uA diode current, with 10k source resistors. 22k gave better results, but also started to give larger variation in bleedtrhough if an extra 1k was tacked on to the source (as might be the case as some manufacturers put 1k protection resistors at their outputs). so it sort of depends upon your application.
555x555
OK, thank you, that is clarifying. So, theoretically anyway, the tradeoff between SNR and THD is external to the parts of the circuit you're considering. Basically, there is a source resistor/diode current combination that will give the lowest THD at a specific % of the output swing; the relationship between the voltage swing from the previous stage and the resistor on the I-to-V opamp is what's going to determine the SNR to THD ratio.

Of course, if you assume the voltage swing of the previous stage *isn't* adjustable, and we're not adding extra opamps to set levels, then using higher valued source resistors *are* the way to lower the output swing and hence give you better THD at the expense of lower SNR. So there's an extra design consideration, although probably the best thing to do if you're very concerned about THD is to just use an op amp to set the level, or better, to use one of the other configurations you laid out. Anyway, I think I understand how to think about your results now.

Quote:
ive gone through and optimized the design for the case where a current source (of any sort) is used for the diode bias. there is a tradeoff between source resistance and diode current. i think i settled on 100uA diode current, with 10k source resistors. 22k gave better results, but also started to give larger variation in bleedtrhough if an extra 1k was tacked on to the source (as might be the case as some manufacturers put 1k protection resistors at their outputs). so it sort of depends upon your application.


Is this new work you're referring to? I think you said 250uA of diode current in the paper.
guest
yeah, i started using 100uA and it was slightly better. the variation in distortion is pretty small for currents ranging from 50uA to 250uA, so it doesnt matter too much (although the source resistors will have to change to match the diode current).

one thing that does help, is a large input signal voltage swing (before it gets knocked down by the input resistors). the reason for this, is that the ideal OTA is driven with a current source (with the diodes its basically half of a gilbert cell). so, larger input voltage swings mean larger resistors are required to get it knocked down to the same level, and it therefore looks more like a current source (current sources are high impedance, voltage sources low impedance). the resistor in the I/V converter doesnt matter too much, as the signal is already generated by the time it gets to that resistor (both the noise and distortion are in that current), so that resistor just makes everything bigger or smaller, and the ratio stays the same of THD/SNR.
555x555
So I've been simulating a bit--I don't have the equipment to test this properly in a real circuit. Anyway it seems like even with a resistor, Id has pretty low variance. By far the worse issue seems to be nonlinearities in the V-to-I conversion in the input. So I went back to your equations in section 3, and solved for I4-I3, given a constant Id (and constant Vd in the single resistor case), and a given Rs and V3/V4. As you say, there isn't a closed form solution, but you can get a good idea of what's going on for e^x ~ 1 + x + x^2/2. Here's the results:



Observations:

First there's the completely linear element, which is inversely proportional to Rs. Second, there's an element proportional to Vt/IsRs^2-so we know right off the bat that distortion will get worse in direct proportion to temperature increases. That seems bad for people who take a thermal oven approach with the LM13700. Last, while the signal is proportional to 1/Rs, the distortion is proportional to Rs and to 1/Rs^2. Since we have Vs = Va R2/(R1 + R2) and Rs = (R1 + R2)/(R1 R2), maximizing the linear portion means maximizing Vs/Rs, i.e. maximizing Va R1 R2^2/(R1+R2)^2. Minimizing the distortion means, on the one hand, minimizing Rs Vs, i.e. minimizing Va/R1, i.e. maximizing R1, and on the other hand, maximizing Rs^2, i.e. maximizing (R1+R2)^2/(R1 R2)^2. The (R1+R2)^2/R2^2 term is proportional at the same rate to both the distortion and the linear portion. This leaves us with maximizing R1 to maximize the input, minimize the 1/R1 part of the distortion, and minimize the 1/R1^2 portion of the distortion. Of course there are other terms to the e^x expansion that I'm not looking at, but it seems like in terms of linearity there are no tradeoffs to maximizing R1 as much as possible. R2 can then be raised to set the level of the V-to-I conversion, with R1 remaining as the limit, obviously. Raising R2 involves huge tradeoffs with Id, however, if you're actually using the single-resistor scheme.

Anyway, this is consistent with your results, and perhaps might be reduced to "The objective with all of these is to maximize the values of Rd and Rs so that the input signals more closely mimic current sources (current sources are high impedance, whereas voltage sources are low impedance)," but seeing the math makes it clearer to me.
guest
im not sure you can assume a constant Vd, as the amplifier works based on the principal of Vd varying with input current. but, you end up at a very similar place to equation 62 in the paper.

i, too, find equations a useful way of looking at problems. i think of them as unbiased arbiters, who allow me to look past my assumptions (which is not entirely true, as many assumptions are made when assembling the equations in the first place - but i think they are more honest about what those assumptions will lead to). and its been really frustrating with a lot of this analysis ive been doing, that there is no closed form solution. ive resorted to simulation on a number of occasions.

i find it interesting that a differentially driven, resistor diode bias setup, preforms as well as a single sided current source diode drive.

the downside of too large of resistors, is that offset drifts like crazy, and its impossible to trim the 2nd harmonic (for single sided drive). i would reccomend 1k Rs in those cases.

i have a new drive method i intend to test out soon, basically it turns the front end of the OTA into a single sided AD633. im think it might perform a bit better than the 2 opamp setup i had, but not as good as the dual OTA schemes.
guest
heres the, yet to be tested circuit:

555x555
Sorry for the scattershot response; there’s just so many interesting points...

guest wrote:
im not sure you can assume a constant Vd, as the amplifier works based on the principal of Vd varying with input current. but, you end up at a very similar place to equation 62 in the paper.


The equations themselves aren’t really assuming any constants, they’re just focusing on the distortion based on the input voltage to current conversion, assuming some Id/Vd, etc. That is, they won’t tell you much about Id. (And there’s those assumptions sneaking into the math :-).) But if we’re assuming a relatively constant Id through a fixed resistance from the + rail, then Vd must equal Vcc - Id Rd; and so Vd is as constant as Id in the resistor-bias case. Maybe you’re thinking of the voltage below the diodes, rather than above? I might just not get your point...

Quote:

i, too, find equations a useful way of looking at problems. i think of them as unbiased arbiters, who allow me to look past my assumptions (which is not entirely true, as many assumptions are made when assembling the equations in the first place - but i think they are more honest about what those assumptions will lead to). and its been really frustrating with a lot of this analysis ive been doing, that there is no closed form solution. ive resorted to simulation on a number of occasions.


Well that’s why they invented the Taylor series, and Newton’s method, and nonlinear optimization algorithms, etc., a lot of which I assume is inside of Spice. But it’s good to do this stuff by hand sometimes, too, because unlike computers humans can see what the math means. The continued fraction version of e^x is supposed to converge faster; it’d be interesting to see if it gives essentially the same results. Using a term after x^2 for the Taylor series just gets too tedious, so I won’t try that.

And I think of equations as usefully filled with my own bias/purpose ^_^.

Quote:

i find it interesting that a differentially driven, resistor diode bias setup, preforms as well as a single sided current source diode drive.


Me too. This is why I suspect the V-to-I conversion of the input is the worse problem.

Quote:
i have a new drive method i intend to test out soon, basically it turns the front end of the OTA into a single sided AD633. im think it might perform a bit better than the 2 opamp setup i had, but not as good as the dual OTA schemes.


Definitely interesting. Why do you still need the diodes, in this case? (I haven’t looked at the 633 much.)

I had a similar thought, and worked out that as long as the external transistors were matched, a current mirror between the internal transistors and two external transistors would just add a constant scale factor to I4-I3. But I couldn’t figure out a circuit with enough voltage compliance to not cause worse problems.
guest
i was assuming Vd was the voltage on the bottom of the diodes (or across the diodes), thus the confusion.

with the sceme above, the internal diodes are still used to do I to V conversion; the external transistors are just there to move current between them such that the difference is proportional to the input signal, and the sum is kept constant.
guest
just tested out the above circuit. it works really well when differentially driven, just as good as the dual OTA schemes. but, when driven single sided, it has awful 2nd harmonic. worse than single resistor method. i think this is due to the LM3046 i was using, which has really bad transistors in it (beta of 50, and huge beta variation with Ic).
guest
i put cascode current mirrors on the bottom of the above circuit, and it fixed the single ended drive problems (mostly). the issue is the early effect in the transistors, which the cascode fixes by having the collector voltage stay the same. the second harmonic is still higher than i would expect (-65dB @ 50% drive level), and it can not be nulled. ill need to think about it some more but im guessing its the Vbe variations in the signal input transistors as the signal swings.
555x555
I'm definitely interested to see where this takes you. But at this point, how far away are you from using enough transistor pairs to just make your own OTA? Especially considering that Iabc is more often than not coming from an opamp/exponential V-to-I converter anyway.

I seem to get pretty good results from the following configuration, although I can't really replicate your measurements of the harmonics—in LTSpice the "sine" that's getting produced seems to give an FFT which already has ~ -90db on the 2nd harmonic but -30db on the 3rd harmonic. But I get only an additional, say, 30db with the 2nd harmonic (still at -60db) and only -3db additional on the 3rd (@1k 4Vpp input). The distortion is very, very slightly worse for changing the Rs in order to change the offset, rather than the potentiometer to the rails version you had, but I wanted to uncouple the circuit from the power supply as much as possible. This circuit should have high PSRR and shouldn't need adjusting for a ±12 or a ±15 PSU. I'll test this non-simulated next week or so, but like I said I don't have great test equipment. The single resistor bias scheme, btw, is not much worse @ 90ua, but then you lose the power-supply independence. The special sauce seems to be the 100k/3.6k input.

MUFF WIGGLER Forum Index -> Music Tech DIY Goto page Previous  1, 2, 3  Next [all]
Page 2 of 3
Powered by phpBB © phpBB Group