DAC (PCM1681): Distortion to high! - Page 1
Forum section: electronics / projects

author: Cs4System
author_rank: Newbie
timestamp: February 27, 2023, 01:14:23 pm
content: Hello,I'm designing open source hardware synthesizers to make electronic music. At the moment I'm in the process of designing an audio interface based on ADAT (8Ch of audio in optical Light pipe) There are 8Ch input and 8Ch output.I have a working prototype, but I noticed way more THD on the DACs (PCM1681) output then the datasheet says. In case I do a roundtrip (PC->DAC->ADC->PC) measurement I get 0.09% THD (datasheet of DAC says 0.002%)Directly measured on an open analog output pin of the DAC I get even stronger harmonics? See attachment. Scale is 10dBV, you can see fundamental and the first and second harmonic.Supply voltages are spot on.I have installed all recommended bypass-caps and have used some thick wire across the PCB to ensure good GND and 5V connection.(both measure 0.0 Ohms on my multimeter)Since that had no positive influence on THD, I have no ideas what to try next :/Does anyone ever solved something like this?Thanks a lot for your help!

author: gf
author_rank: Super Contributor
timestamp: February 27, 2023, 02:16:00 pm
content: Consider that your instrument may not be suitable for measuring such low levels of distortion. Chances are the oscilloscope itself introduces more distortion than the level you want to measure.

author: MasterT
author_rank: Frequent Contributor
timestamp: February 27, 2023, 02:16:39 pm
content: 8-bit oscilloscope to measure below 0.1%? I would not use scope for THD measurements, only for evaluation down to 1 %.Analog front end distortion usually about this value, may be 0.1% (-60dBc) in the audio 20-20kHz band.

author: Cs4System
author_rank: Newbie
timestamp: February 27, 2023, 04:31:21 pm
content: Oh well, that's a good point!I never thought about that before, thanks!Could you explain why a low resolution would end up in THD? I mean low resolution does mean you get a lot of noise, but distortion?Anyway, I still wonder where the distortion is added...It is present in my digital audio workstations FFT graph, and a measurement plugin was able to measure it(I tried both on other audio interfaces with much better results)Maybe I just use a simple opamp Buffer and my well working audio interface as a scope....I'll come back with better measurements and more questions, thanks so far!

author: Kleinstein
author_rank: Super Contributor
timestamp: February 27, 2023, 05:27:19 pm
content: How linear the 8 bit ADC actually is depends. There can be quite linear low resolution ADCs (e.g. those used as part of some high performance SD ADCs), but often the linearity is not that much better than the resolution. With scope the input stage is often a JFET source follower and this tends to be somewhat nonlinear.For a THD mesurement one can reduce the effect of the ADC by using a nothc filter and this way reduce the amplitude of the main signal by some 40 dB and this way get less THD from the detector.The still leaves the question in the THD seen in the simple loop back test.With many SD ADC chips the input is sampled in short bursts and the design of the driving amplifier, ggf. AA filter (MHz range) and the reference buffer can effect the linearity. Similar the decoupling capacitors and power supply can effect the linearity. With the decoupling one can have bad luck with resonaces if multiple capacitors are on the same net / power supply grid. More capacitors can make things worse, if there is little damping.

author: ejeffrey
author_rank: Super Contributor
timestamp: February 27, 2023, 06:03:26 pm
content: Quote from: Cs4System on February 27, 2023, 04:31:21 pmADC data sheets will usually list a bunch of different but related parameters: INL (the non-linearity of the transfer function), the 2nd/3rd harmonic distortion, the intermodulation distortion, the SFDR, and so on.Here is a data sheet of a 1 GS/s 8 bit ADC, it's an older product but representative of the type of ADC that many < 200 MHz oscilloscopes probably use:https://www.ti.com/lit/ds/symlink/adc081000.pdfthe typical THD is -57 dB, or 0.14%. That is measured at much higher frequency where there are more non-linear effects (like slew rate limiting), but a portion of that will be from the resistor trimming in the ADC and apply even at low frequency.It could also be added in the oscilloscope input amplifier. Remember transistors are inherently non-linear devices. They rely on feedback to linearize them. High speed analog front ends have to trade feedback with bandwidth.The basic moral of the story is that instrument are designed for a purpose. An 8 bit oscilloscope is not designed for high dynamic range measurements, and every part of it will be designed around that expectation. A 12 bit oscilloscope would do considerably better.I'd strongly recommend doing this with a notch filter to block the fundamental. It's much easier to make sure a passive notch filter is operating linearly than any active instrument. A twin-T filter is traditional for this purpose at audio frequencies where good inductors are rare. It has good rejection and uses only capacitors. Use film capacitors not ceramic.

author: hanakp
author_rank: Regular Contributor
timestamp: February 27, 2023, 07:48:27 pm
content: Quote from: MasterT on February 27, 2023, 02:16:39 pmEven 1% is too optimistic for most scopes, or at least high speed (>1 GSa/s) ones. My old trusty Agilent DSO6032A has >3% THD at audio frequecies, for example. On the other hand, there are fast scopes which are specifically designed to represent the input as accurately as possible. An MSOS104A in my workplace has THD below 0.5% at 20 GSa/s, but of course such hardware is way above the price range of your typical hobbyist.

author: Cs4System
author_rank: Newbie
timestamp: February 27, 2023, 08:05:49 pm
content: Wow, thanks a lot for the explanations!And you all were totally right! I used my audio interface as a "scope" and the DAC is performing as expected! See green FFT in attachments.The problem shows up in the output opamp which drives the 10kOhm inputs of the following audio gear. See red FFT in attachments.If anyone is interested: the schematic is in the attachments. "OUT1" is the bipolar and inverted signal from the DAC. The harmonics are not present in this signal. I removed the LED, it has no effect on THD.Caps are C0G and I have 100nF and 10uF bypass caps directly next to the opamps supply pins. Power supply is a clean bench PSU. Any ideas?The THD is not frequency dependent. As far as I could measure, between 40Hz and 10kHz it's identical.If there is a better circuit for my purpose, let me know ;)Thansk a lot!

author: Kleinstein
author_rank: Super Contributor
timestamp: February 27, 2023, 08:14:46 pm
content: The TL084 is not exactly known for low THD. So a higher grade OP-amp can be an option.The inverting circuit is good for low distorion as the input stays at essentially a fixed voltage - so no common voltage effect.Chances are there is a little contribution to the distortion from the OP-amps ouput stage cross over (change in the current sign). For lowest distortion, if power consumption is less of an issue one can load the ouput put with a constant biasing current to keep the amplifier in class A mode. Not really needed for audio, but it helps the measurement.

author: Cs4System
author_rank: Newbie
timestamp: February 27, 2023, 08:20:40 pm
content: Well, I would argue, that the 0.00012% THD+N the TL084 is rated is a hole magnitude better than my DAC (0.002% THD). So the OpAmp it self can't be the problem, I guess.

author: moffy
author_rank: Super Contributor
timestamp: February 27, 2023, 09:07:13 pm
content: Quote from: Cs4System on February 27, 2023, 08:20:40 pmThat figure is quoted with the following conditions: Vs=40V, Vo=6V RMS, Av=+1, f=1kHz, Rl=10k. You have Vs=?, Vo=?, Av=-5, f=1kHz, Rl=?Notice that in their measurement the peak output is at least 11V away from the supply for both +/- excursions. Keeping the output well away from the supply is often very important in obtaining low distortion, especially in a generic opamp like the TL084. Your gain is working against you also, more gain less error compensation therefore more distortion, generally, for the same set of conditions. But thanks for the heads up about the TL08x distortion performance, didn't know it had it in it.P.S. The distortion figure might only be applicable to genuine TI parts, there is no guarantee that other manufacturers match that figure. e.g. ST only quotes a figure of 0.01% for one set of conditions and about 0.003%(on the graph) for conditions nearer to TI.

author: Cs4System
author_rank: Newbie
timestamp: February 27, 2023, 09:27:36 pm
content: Ah, that makes sense. the distortion starts to kick inI have Vs = +-12V, Vo= 10Vpp, Av=-5.3, f=1kHz.I'm more the 7V away from the rails.I can't use opamps like the OPA2134 since that bad boy needs 5mA supply current. I need 42 opamps in this project. And that would be too much power consumption.If anyone can point me to a good low power, low noise, cheap opamp, I'm the happiest guy on earth... but that device does not exist, I guess.

author: moffy
author_rank: Super Contributor
timestamp: February 27, 2023, 09:41:22 pm
content: You could experiment a little, adjust your output level until you get your desired distortion. Can you work at that level? Can you adjust the supply voltage to get the desired distortion level? Can you work with that, say +/-15V rather than +/-12V and a 9Vp-p output? Are you using genuine TI parts, and if not, do they make a difference? Just some suggestions for possible compromises.

author: Cs4System
author_rank: Newbie
timestamp: February 27, 2023, 09:52:19 pm
content: Thanks for all the ideas. I do develop for a synthesizer format called Eurorack.It is a modular environment.https://en.wikipedia.org/wiki/EurorackSo sadly I have to stick to the +-12V supply. A normal audio signal is 10Vpp in this synthesizer format.But maybe that's a good news, since in case I can't do anything about that distortion, It's part of the game using such a synth for making music. Distortion don't has to be a bad thing, ask a guitaristEdit: Distortion is not a problem at Vo = 1.5Vpp which is -18dB below my desired signal level. Yes, I use the TI part

author: Kleinstein
author_rank: Super Contributor
timestamp: February 27, 2023, 10:02:50 pm
content: Price wise the TL084/TL074 is probably hard to beat. The TL07 series should have slightly better noise specs, though with modern one the Tl08x supposedly usually also meat the tighter specs.For high speed at moderate costs and not too much power the OPA1679 may work.For good performance at low power, the OPA1692 looks good - though not cheap.One may not need to use the same chip at all positions. (e.g. the LED drive could be with an LM324).

author: MasterT
author_rank: Frequent Contributor
timestamp: February 27, 2023, 10:20:36 pm
content: " I removed the LED, it has no effect on THD. "You can't just remove the LED, OPA turns into comparator with high switching distortion.