Feedback on audio output circuit?

Status
Not open for further replies.

jwatte

Well-known member
I'm stepping up my Teensy carrier board game, and adding a header to output the DAC0/DAC1 signals. I haven't done analog anything for about 25 years, but here goes :) This circuit goes on a carrier board for the Teensy that also interfaces with the rest of my system (robot.) I'd love some feedback from anyone who does audio/analog more regularly than me.

teensy-analog-output.jpg

The header conveniently also pulls 5V and 12V from the board for powering a small amplifier (one or a few Watts; typically something like http://amzn.to/2sN8vB7 for 12V or http://amzn.to/2sN7Hfh for 5V; of course these don't actually meet the stated power, which is fine by me.)

The concerns I have are:

1) Teensy DAC is 12 bit, and there's no anti-aliasing filter internally, so there will be some stair-stepping crunchiness. I need a bit of anti-aliasing filtering; it's more important to get somewhat smooth output up to 5 kHz than to get the highest sample rate entirely un-attenuated. That being said, this is for piping to two-inch speakers for robot speech and effect music, not for a Hi-Fi sound system, so an expensive (and big) brick wall filter isn't warranted. The 47 Ohm / 1 uF RC filter has a corner frequency of 3.4 kHz, which gives me about 18 dB attenuation at 20 kHz, which seems reasonable. I know that DC blocking is a high-pass filter, and I'm prepared to accept a high-pass filter with a corner frequency at 340 Hz from the 47 Ohm / 10 uF series pair. But how do these two filters interact?

2) The 5V rail is driven by a MuRata OKI-78SR05, which has some ripple at 400 kHz. Other than that, it's a great, reliable part. The 12V rail is driven by batteries or DC in, but also drives a number of motors, so there will be switching/EMI noise on that rail. In order to be nice to the amplifiers (who are cost-optimized, not quality-optimized,) I'm adding a bit of filtering on the power rails. I expect to draw 1A or less from either rail. Is this overkill, not enough, or about right? I'm using 6.3mm electrolytics for the 47 uF capacitors, and my main concern there is size -- anything significantly bigger would be a problem. The inductor is rated for 1.2A. An online calculator puts the Q of a 400 mOhm, 10 uH inductor, and 47 uF capacitor, at 1.15 and the corner frequency at 7.3 kHz, and a resonant frequency of 6.6 kHz. How should I think about this, if at all?

3) The amp will be right next to this board, so I don't worry about shielded connectors or balanced/differential signals or anything like that. But, isolating ground might be valuable in routing. So, what's the best ground pin on the Teensy to return the signals to? AGND or one of the GND pins, and if so, which? (I need to separate the signal ground and the power ground on the connector.)

4) How do surface mount X5R capacitors perform, audio-wise? Are they noisy? Do they pick up vibrations as microphones? Do I need to worry about mylar film capacitors and so forth? (Both 1 uF and 10 uF caps are X5R MLCC)

5) What else am I missing, or should think about? Any and all feedback happily accepted! (And thanks in advance)
 
Last edited:
You can't use X5R or even X7R cermaics for audio path signals. The distortion is too high, and their capacitance value modulates with the voltage across them. The only ceramics you can use are NP0/C0G which do not suffer from the problems. They are only available in very small values however.

You need to use electrolytics or film caps. SMD film caps are what I use on my guitar audio board but be warned, they are pricey.

You may or may not be able to get away with thick film resistors. They have very high self-noise which ends up saturing many of the lower bits in the ADC/DAC with noise. But, since you're doing 12-bit audio, the precision is low-enough you can probably get away with it.

For typical 16-bit audio you must use thin film resistors (much more expensive) in order to make the lower bits useful.
 
Thanks for the feedback! That's very useful.

Separately, I found out that the actual low-pass behavior of the DC blocking capacitor depends on the series resistance, which includes the input impedance of the amplifier. (Pretty obvious once you think about it!) Thus, the 10 uF may be way bigger than I really need.
 
47 Ohm would make the DAC attempt to push > 40 mA at 2V into a short.

470 Ohm sounds better for that case, which means my low-pass needs to shrink to 0.1 uF, which is great, because I need to use film capacitors which are bulkier in general. C1210 footprint 0.1 uF capacitors are readily available and not too expensive, though, so that's good. Thin film resistors seem okay, too; 10x more cost than thick film, but I'm making one board, and the difference between 3 cents and 30 cents won't break the bank :)

And because the amplifier input impedance is 10k and up, this means a 0.1 uF output de-coupling cap will actually be plenty -- the corner for 10k+470R into 0.1 uF is 150 Hz, which is okay for these speakers. (If it feeds a 100k impedance amplifier, the frequency drops to 15 Hz, which my speakers can't play at all... maybe I should put a 22 kOhm resistor in parallel with the output to make sure that never happens...)
 
So, the design that is going to the fabricator uses:
- thin film 470 Ohm resistors
- mylar 0.1 uF capacitors (both for low-pass and high-pass path)
- 0.8A 10 uF power inductors
- 47 uF 25V aluminum power caps

The output impedance of the DAC is "less than 250 Ohm" so 470 Ohm will end up being perhaps 600 Ohm or so overall.
The input impedance of the amplifier I'm going to use will actually be much higher than 10 kOhm; MOSFET inputs can have VERY high impedance.
I should probably have put a 30-50 kOhm thin film resistor after the high-pass filter cap to not be as sensitive to this, but I ran out of time/space/patience.

Once it's all back from the fine people at MacroFab, I'll give it a listen and let y'all know how it sounds :)
 
Status
Not open for further replies.
Back
Top