News:

SMF for DIYStompboxes.com!

Main Menu

Differential Input to ADC

Started by AdamB, August 06, 2019, 05:15:44 AM

Previous topic - Next topic

AdamB

Hi,

markseel posted this for me in the wm8731 thread and it has sent me on a voyage of discovery;



So I've been trying to understand differential inputs in general. Looking at a similar setup on the CS4272 (it looks very similar to me), the chip takes a differential input and recommends this configuration for the input buffer...



So if I understand correctly, the differential architecture is desirable because it cancels the common noise between the hot and cold inputs, with the resulting digital signal representing the difference in voltage between the two inputs.

So thus am I right in thinking in the CS4272 example A+ would be the guitar signal in, and A- would be tied to ground? This appears to be what's happening in Mr. Seels example.

So question 1; If this is the case, in these two setups in the images above, what is controlling the input gain? I imagine I wouldn't want to add another gain stage in-front of this, as I guess the whole point is to maintain the same gain on the hot as the cold so that the noise is in the same ratio on both input lines, right? So instead I would tweak the input gain of the differential op-amps somehow to get my signal in range?

Question 2; What's controlling the input impedance? I'm used to seeing a 1M pull to Vref to set this high for guitar signals in a typical 9V effect, but neither design has something that looks familiar to me so I'm trying to figure out what's controlling that. At a stab in the dark I'd think it's R32 and R33 in Seel's design and the two 10K's in the 4272 reference design that connect between the hot and cold before the op-amp stages. But why 10K and not higher, I'd of expected 500K or more so I think I'm missing something.

Question the third then; how would I handle overload protection? Like if someone puts a massive mega distortion of death into the inputs of this thing I wanna make sure it doesn't damage the ADC - I've seen this done with diodes to Vref in other designs but don't understand how you'd handle that here. A simple diode network to ground after the hot op-amp stage output?

Thanks!
[indifferent::engine]
http://www.indifferentengine.com

ElectricDruid

What's the advantage of a differential input if you then tie one half of it to ground? I thought the idea was to have signals that were out-of-phase copies of each other, thereby allowing you to cancel common mode noise.

I suppose you still get that effect to some extent if the grounded-buffer produces similar noise to the ungrounded one, which it would at least as far as power-supply related noise is concerned.


AdamB

#2
Well the way I was thinking of it was that if you fed two copies of the signal 180 degrees out of phase to the hot and cold, they would cancel on the input and then the differential signal would be ONLY the noise that exists on one and not the other...? And so it made more sense that it should be tied to ground.

Edit: Or would the signal now have a gain of 2, because the difference is twice the original PP voltage (from + voltage to - rather than from say + to gnd)?
[indifferent::engine]
http://www.indifferentengine.com

ElectricDruid

Yes, twice as loud, I should say. It's the *difference* between them that counts. That's why the common mode noise disappears.

Perhaps another way to think of that is that the differential signal improves the S/N ratio because you've basically got two copies of the signal - twice as much signal to the same level of noise (or less, if you get rid of the common mode noise).


AdamB

So I'd need to stick some kinda phase inverting buffer stage from AIN+ into AIN- to make the most of it? I'd assume that could just be an inverting unity gain opamp?

but either way it should work right, just gives me better SNR if I use the inverted signal mgee?
[indifferent::engine]
http://www.indifferentengine.com

markseel

Quote from: AdamB on August 06, 2019, 05:15:44 AM
So if I understand correctly, the differential architecture is desirable because it cancels the common noise between the hot and cold inputs, with the resulting digital signal representing the difference in voltage between the two inputs.
Yes!  Differential/balanced has the advantage of common mode noise rejection as well as larger signal swing.  For long signal runs or traces the common mode noise adds up.  Biasing opamps with the usual resistor divider can also couple power supply noise into the source signal.

Google differential amplifier circuits and look at TI's notes on diff amps to see similar circuits (single ended to differential conversion) and for discussion on the advantages of diff/balanced signaling.

Quote from: AdamB on August 06, 2019, 05:15:44 AM
So thus am I right in thinking in the CS4272 example A+ would be the guitar signal in, and A- would be tied to ground? This appears to be what's happening in Mr. Seels example.

Right.  My circuit isn't new or original or clever -it just helps with noise but at the expense of signal swing. One half of the circuit, like Tom points out, is just used to subtract noise introduced by the ground/supply/biasing at the expense of achieving the full dynamic range of the ADC (since the instrument is only applied the +ADC and not -ADC.  The gain of each op amp is 1 and each ADC input has a range of 1Vrms therefore the input to the opamp (instrument) can be 1Vrms.  Since 1/2 of the ADC is sensing the instrument signal then only 1/2 of the ADC's range is utilized.  I was OK with that.  One could do better with more parts though :-)

Or you could use two OPA's and copy the circuit in this data sheet to achieve the full signal dynamic range of the differential input ADC without much complexity:

https://www.analog.com/en/technical-articles/adc-driving-single-ended-to-differential-conversion.html.

Your question of input impedance; The circuit I posted has about a 1Mohm input resistance due to the 1M biasing resistor ... the +input of the OPA won't factor in much.  The circuits you see in data sheets typically have 10K or so input impedance so as to match up with other analog circuits in various products (line out, mic preamps, etc).  They're not designed to be high impedance (for MIC's, pickups, etc) by themselves.  You can add buffers for that.  Or use an instrumentation amplifier or similar.  The advantage of the circuits in the data sheet is that they're are both balanced (partially) and have gain.  For fully balanced gain stages look at fully differential opamps.  Overkill but fun to look at :-)  And even with those you'd still need a buffer to present a high-impedance load to your pickups.

Overload protection; There's two forms, input signal swing as well as common mode voltage, and ESD events.  I generally don't worry about it and use a DC blocking cap with a 1K resistor on the inputs.  Might be a good idea to have clamping diodes somewhere but I'm not an expert on this.  It also depends on the process by which the OPA was designed; CMOS would be more ESD sensitive, bipolar seems robust, JFET maybe somewhere in between?  Many OPA's have clamping diodes built in for overload. 

Hope this helps.  I'd not overthink it to start with.  Just be sure to have a high impedance input for the guitar, a clean power supply, a clean opamp mid-supply bias, and use balanced if you're picky.

AdamB

OK that's all real helpful! Cheers!

OK so mocked this thing up as an example for the CS4272, think I understand what's happening.




[indifferent::engine]
http://www.indifferentengine.com

mhelin

You could also use OPA1632 which has differential output. Anyway, the common voltage output from ADC (Vcom or VQ) should be buffered too, unless there isn't much load (100k isn't much). It is also possible to use audio transformer to drive the ADC differentially. If the secondary has middle output connect the Vcom there. The you would need just a single opamp stage for impedance matching and gain setting, and maybe get a little bit more interesting sound.

gena_p1

Simplest example of differental input and ouput could be obtained from alesis al1101 / 1102 / 3201 or femto verb

mhelin

Quote from: gena_p1 on August 12, 2019, 07:02:32 AM
Simplest example of differental input and ouput could be obtained from alesis al1101 / 1102 / 3201 or femto verb

That doesn't work well with CS4272 as the the outputs are not referenced to Vcom but floating. AL1101 has self-biased inputs, but CS4272 not.

gena_p1

Oh, thanks!

We did CS4272 cartridge, but , mostly by  datasheet recommended schematics