Forum Rule: Always post complete source code & details to reproduce any issue!
Page 1 of 7 1 2 3 ... LastLast
Results 1 to 25 of 159

Thread: 24 bit audio boards

  1. #1
    Senior Member
    Join Date
    Sep 2013
    Location
    Sonoma County, CA
    Posts
    141

    24 bit audio boards

    I mentioned a while back in the Audio Library thread that I was interested in putting together a high quality (24 bit) audio board. I finally got to a point in my projects where a higher quality audio codec board would be helpful, so I dove in and put together 2 designs. One design uses a slightly better performance codec (a Cirrus Logic CS4270) than the SGTL5000, and the second uses the highest quality codec I could find that is easily hand solderable (the CS4272).

    The CS4270 DAC has slightly better performance than the SGTL5000 (-105dB SNR / 87dB THD+N vs -100dB SNR / 85dB THD+N), but the ADC has much better performance (-105dB SNR / 95dB THD+N vs -85dB THD+N / 73dB SNR).

    The CS4272 has much better performance on both the ADC and DAC (both have 114dB dynamic range and -100dB THD+N).

    In my current project I only really need the slightly better performance that the CS4270 provides, but I wanted to tackle the really high performance design for fun.

    My end goal is to put these designs up on OSH Park once they're finished so that anyone can make good use of them. I've mostly finished the actual design work and will start on the actual layouts for the boards pretty soon (I do this all in my spare time it may take a month or two before I finish), and I wanted to see if anyone in the community had any input or extra wishes that would be easy to incorporate before I start the layout.

    I've attached schematics for the two boards, and I'll quickly go through the highlights of each design:

    Both boards share the same power supply design. The CS4272 and the codec I had originally chose for my middle quality board (the PCM3060) both need a +5V analog power supply and +3.3V digital supplies. I didn't want to try to pull the +5V directly off of the USB supply (or Vin) because the nominal USB voltage can vary quite a bit (+/- 10% if I remember correctly) and can be really noisy. I chose to use a buck-boost converter to take either the +5V from usb or the 4-6V from 4x AA batteries and generate a stable 5.7V, and then LDOs down to +5V and +3.3V. The CS4270 based board can actually run off of a single 3.3V supply, so I could (and I might at some point) make a third board that is just powered off of the Teensy's 3.3V supply. The power supplies are heavily filtered to prevent noise from the switching supply to infiltrate any analog signals.

    I tried to make the power supply pretty flexible (power off Teensy USB power or 4x AA batteries, or skip the switcher and use a 9V battery to power the LDOs), but I was thinking about possibly powering the teensy off the switcher as well in case someone was using batteries to power the switcher, and could use the +3.3V LDO to power the teensy as well as the codec digital supply.

    Both boards also share the digital interface with the Teensy. There's a digital isolator IC that prevents any voltages on the codecs while the power supplies are ramping up, and some series resistors to slow the edge rate on the I2S signals and prevent too much EMI.

    The board based on the CS4270 (NewAudioBoard.pdf) is pretty simple. The CS4270 has all single-ended analog IO, and only requires passive filtering. The output filters are based on the CS4270 datasheet's recommended analog output filter, with slightly larger coupling caps to match the input network. The input filter network is also based on the datasheet recommendations, and is set up for a maximum signal level of 10dBV (20dB headroom above line level), and provides the optimal impedance (1k Ohm) as seen from the CS4270 input pins. The analog IO connectors are all 2 pin headers (signal and ground). The performance of this board should be pretty close to the ideal for the CS4270.

    The board based on the CS4272 (SuperAudioBoard.pdf) is much more complex. The CS4272 has fully differential analog IOs, and good performance requires active input and output drivers. I spent a long time looking for a good audio quality, fully differential opamp that has good performance on a single +5V supply (and easily hand solderable). The only amp that I could find was the THS4521 from TI. The CS4272 eval board uses NE5532 amps, but these are normal single-ended opamps meaning that at least 2 are required for each I/O, it's hard to get much common mode rejection, and they can't really run off of a single +5V supply. The THS4521 has better THD+N and noise specs than the CS4272 and should provide the highest possible level of performance.

    The two input buffers are unity gain buffers that are a combination of the recommended CS4272 input buffer circuit and the THS4521 ADC driving circuits. The resistors are pretty low-valued to maintain the THS4521's phase margin, but this results in a pretty low input impedance. The 100pF caps are for common mode noise rejection, and the 2.7nF cap goes right on the CS4272 inputs for the best ADC performance.

    The output buffers are 3rd order bessel filters with unity gain in the pass band and less than half a dB of roll off at 20kHz.

    The coupling capacitors on the audio inputs/outputs are all somewhat oversized (100uF) with a -3dB corner frequency below 5Hz to combat distortion due to capacitance non-linearity.

    The audio inputs and outputs use 3.5mm audio jacks with the tip connection being the positive differential input, the ring connection is the negative differential input, and the sleeve is ground. This setup allows the use of either fully differential signals on TRS audio connectors, or single ended inputs using mono audio connectors (negative input shorted to ground). Single ended outputs can be set up by using TRS (stereo) audio connectors, and leaving the negative output (ring connection) open.

    The CS4272 board also includes a 24.576MHz crystal to allow the codec to operate in master mode and with different sampling frequencies (48kHz/96kHz/192kHz).

    If anyone has any thoughts on the boards, or if there's something I can add or change to fit your needs better, let me know, and I'll see how easily or if I can incorporate it.
    Attached Files Attached Files

  2. #2
    Senior Member
    Join Date
    Sep 2013
    Location
    Sonoma County, CA
    Posts
    141
    I forgot to mention that, although I will do a little bit of software work to get at least the CS4270 board to work with Teensy, I probably won't do any additional work to set it up in the audio library unless it's really quick.

    I enjoy the hardware side a lot more, and I already do enough software stuff at work, so I'm not inclined to spend more software effort than is absolutely required

  3. #3
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    15,720
    I've often considered making a high-end board... and I'm really glad to see you're taking this on.

    A feature I had hoped to include in a high end board is galvanic isolation for all the I2S and I2C signals, to completely eliminate quality problems due to ground loops. For any moderately complex project, the digital side on Teensy will end up connecting to other stuff, which often gets earth grounded. Even just a tiny ground current results in far more noise than the -100 dB THD+N performance of these high-end chips. I know it sounds like overkill or perhaps unnecessary at first, but I really do believe this feature is essential for a high performance analog board to be useful in a wide range of projects.

    The fast I2S signals would probably need a chip like ADUM3440. I know this adds quite a bit of cost and complexity, and careful testing for the extra propagation delay they'll add. I'm not sure what chip to use for I2C.

    The I2S slave code in the audio library will almost certainly need some work. If you really do make this board (and share the files on OSH Park, or send me a board for testing), I can help with the code side next year, when I'm working on the audio lib again.

  4. #4
    Senior Member
    Join Date
    Sep 2013
    Location
    Sonoma County, CA
    Posts
    141
    I did actually look at putting in full digital isolation when I was first starting on this. I didn't end up putting them in mainly because it adds a lot of cost to an already expensive BOM.

    In an ideal world, I'd build two versions of the CS4272 board: one with a fully isolated digital interface, and one without, and compare the performance. I'll probably start out with the current (not isolated) design, and see what happens with a big ground loop. The analog interfaces are fully differential, so hopefully that will minimize any issues with ground noise. If it is an issue, then it shouldn't be too difficult to change just the digital section of the board to add the isolation as long as good parts can be easily found.

    Unfortunately, the digital isolation doesn't solve any issues if a ground loop is between equipment connected to the analog inputs and outputs of the board. I had considered putting in some common mode chokes on all the inputs, but I was trying not to go too overboard

    My plan at this point is to start with the CS4270 board because it is simpler and closer to what I need at the moment, and then progress on to more work on the CS4272 board. I may layout a 72 board with isolation, and then build and test it when I get the time.

    In an ideal world I'd be able to mess around with this stuff to my heart's content, and it would be really fun to investigate the performance with or without isolation, but who knows if I'll get the time

  5. #5
    Quote Originally Posted by PaulStoffregen View Post
    The fast I2S signals would probably need a chip like ADUM3440. I know this adds quite a bit of cost and complexity, and careful testing for the extra propagation delay they'll add. I'm not sure what chip to use for I2C.
    There's also a dedicated I2C isolation chip in the ADUM series; ADUM1250. SiLabs also makes dedicated I2C isolation chips; the SI860x series, which are cheaper and there are versions that include several unidirectional isolation channels. I've used both to go from 3v3 to 5v logic levels, it worked without a hitch. I only used the normal speed though.

  6. #6
    Senior Member
    Join Date
    Jul 2014
    Posts
    1,454
    Quote Originally Posted by whollender View Post

    The CS4272 has much better performance on both the ADC and DAC (both have 114dB dynamic range and -100dB THD+N).
    But keep in mind that at FS=192 kHz the bandwidth remains around 40 kHz. This seems fine for quality audio processing, but not for ultrasonic.

    @PAUL,
    I could not find any info about the bandwidth of the SGTL5000 chip. Is it also band-limited to audio applications?
    I know its sampling frequencies, but the Cirrus chip shows that 0.5 * fs is NOT always equivalent to achievable bandwidth.

  7. #7
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    15,720
    Quote Originally Posted by whollender View Post
    I did actually look at putting in full digital isolation when I was first starting on this. I didn't end up putting them in mainly because it adds a lot of cost to an already expensive BOM.
    Yes, it's expensive. Unfortunately, it's also very necessary.

    Perhaps the PCB can be designed so either the isolation chips or some jumpers or resistors could be placed?

  8. #8
    Senior Member
    Join Date
    Sep 2013
    Location
    Sonoma County, CA
    Posts
    141
    It looks like the isolators won't add too much cost. I'm looking at the silicon labs SI8662BC for I2S, and the SI8602AC for I2C.

    Unfortunately, with the isolators in, it's pretty unlikely that the quad speed mode (192kHz) would work, because there's less than 25ns for the falling bit clock edge to travel to the teensy I2S interface, trigger the change to the TX (DAC) serial line, and make it back to the codec. In fact, it's likely that the 192kHz mode wouldn't work reliably, even with no propagation time between the two ICs, because the codec requires 16ns setup time, and the teensy spec for max prop delay between bit clock edge and data transition is 29ns, which is already larger than the 40ns available.

    It should be pretty easy to add in the isolators, and put a resistor array on the backside to load instead of the isolators in case someone doesn't need the isolators.

    This will affect the power supply setup I have at the moment, but I'll look a little further into it (maybe an isolated switcher so that it can still pull power from the teensy board?).

    WMXZ, I hadn't even thought of ultrasonic applications, and it looks like you are correct wrt to the limited bandwidth of the codec. It looks like the DAC bandwidth continues to extend with FS, but the ADC appears to be limited to ~45kHz, although the plots in the CS4272 datasheet appendix show that the quad speed (192kHz) filters only rolloff around 10dB at 0.5Fs, so you could feasibly use it up to pretty high frequencies without too much degradation. If you wanted really flat analog input and output >100kHz, you'd probably start needing separate ADC/DAC ICs that aren't purpose built for audio bands.

  9. #9
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    15,720
    Oh, that part from Silicon Labs looks really nice.

  10. #10
    Senior Member
    Join Date
    Jul 2014
    Posts
    1,454
    Quote Originally Posted by whollender View Post
    If you wanted really flat analog input and output >100kHz, you'd probably start needing separate ADC/DAC ICs that aren't purpose built for audio bands.
    Yes I know, I have gone through this before. After getting exciting about a previous cirrus chip, I realized its 'feature' of 0.24 Fs bandwidth for 192 kHz. OK, sigma delta chips are easy to handle (no need for anti-aliasing filters), but the high oversampling rate requires also more current (at least compared to SAR).

    In fact, my typical application (Passive Acoustic Monitoring of ultasonic Cetaceans) asks for dedicated ADC's and the audio boards become expensive. A single AD7982 (single channel up to 1 MHz sampling) costs 36 Euro, and then you need a antialiasing filter, etc.

    Overall, analog systems are not only difficult to design (as discussed above), but seem to cost also more than digital devices.

    But not all my applications have such high demands on audio bandwidth, so I'm waiting for your superAudioBoard.

  11. #11
    Senior Member
    Join Date
    Sep 2013
    Location
    Sonoma County, CA
    Posts
    141
    Alright, I've updated the CS4272 based board to include full isolation, and a bunch of zero-ohm jumpers to populate if the isolators aren't needed. The schematic is attached.

    I don't think I'll bother with it for the CS4270 board because it's lower quality (and probably no-one outside of myself will use it ). In fact, I might toss the whole power supply on the 4270 board out the window and just power the whole thing off of the 3.3V supply from the teensy 3.x.

    While I was updating the schematic, I realized that this will use 1 GPIO pin that isn't used in the audio board for the reset signal to the codec IC. I chose pin 2 on the Teensy because it's only GPIO and SPI chip select, so it's probably least likely to clobber any other usage scenarios. If anyone has a good reason to use a different GPIO pin for this, let me know. I may add a zero-ohm jumper and a header location for it to make it easy to use any other GPIO pin anyway.

    I'm pretty busy until after the new year, but I hope to get started on the layout (or at least the footprints) before then.
    Attached Files Attached Files

  12. #12
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    15,720
    The schematic looks good. My only concern would be the use of headphone jacks for balanced signals, and the lack of any single-ended output.

    If it's just for you, fine. But if this is going to made by others, could be quite a source of confusion. Even people with high-end systems that use balanced audio might like the convenience of a single ended signals for simple testing.

    Oh, also, on page 3, it looks like the output jacks might have the switches shorting the output when the plug isn't inserted. Or maybe I'm just misunderstanding how it's drawn?

    If you decide to sell bare boards or publish the files, I'm looking forward to building an trying one of these.

    Might be best to build with a 22.5792 MHz crystal, so it can generate 44.1 kHz LRCLK.

  13. #13
    Senior Member
    Join Date
    Sep 2013
    Location
    Sonoma County, CA
    Posts
    141
    I'm glad you caught the shorting jacks on the output.

    The connectors are something that I wasn't really sure about. I did a little research on connectors used in balanced audio, and it looks like that, besides xlr connectors, TRS connectors are fairly standard, but I'm open to adding more options. I ruled out xlr connectors because of their size, but maybe there are better options. Maybe three pin headers that could be populated instead of 3.5mm jacks?
    Maybe it would be better to just put in the headers to avoid confusion?

    I wanted to go for the 24.576MHz crystal so that the standard 48/96/192kHz sample rates would be supported. It looks like digikey has a 22.5792MHz crystal that would be a drop in replacement, so maybe that could be a build option? That would make it easier to work with existing audio library objects.

  14. #14
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    15,720
    I really don't know about balanced audio connectors. I do not own any high-end audiophile equipment. Some DJ friends I know have XLR jacks on their gear.

    My feeling is balanced audio is pretty rare, outside of professional use. A board without an option for single ended signals will probably not be useful for a lot of people, unless they buy more stuff. I'd highly recommend adding the circuitry for at least the outputs. It shouldn't cost a lot more board space, and it'll give people the option to get compatible signals. For the inputs, it's easy enough to just ground the negative side and feed a single-ended signal to the plus side.

  15. #15
    Senior Member
    Join Date
    Sep 2013
    Location
    Sonoma County, CA
    Posts
    141
    Using the outputs as single-ended instead of differential should be as easy as leaving the negative side open, and just using the positive output. The unbalanced loading of the output diff amp does degrade the balance of the circuit slightly, but not much more than the resistor tolerance does already (unless the input resistance loading the one side is practically a short).

    I think that maybe using header pins instead of the 3.5mm jacks, and having a note to leave the negative output open for single-ended use should be ok. What do you think?

    I'd like to make this as easy to use as possible, so I appreciate your feedback. It's really easy to get wrapped up in the engineering and not look at it from a fresh perspective.

    I do plan on publishing the design files, but I want to verify at least basic functionality of the design beforehand. Eventually, I also would like to do some performance verification, but I should be able to find something that will do here at work when I get some time (I work for Keysight, formerly Agilent, Technologies).

  16. #16
    Senior Member
    Join Date
    Nov 2012
    Location
    Boston, MA, USA
    Posts
    1,068
    Quote Originally Posted by whollender View Post
    Using the outputs as single-ended instead of differential should be as easy as leaving the negative side open, and just using the positive output.
    No; put the negative side to ground on your single ended input and the positive side to signal input.

    Pin headers to allow a choice of connector is the best idea. Having said that, high end equipment using balanced connections is unlikely to be using the low, single rail voltages that you are using here.

    If you are relying on normal tolerance resistors to produce balanced inputs and outputs they you will find the measured common mode rejection ratio is nowhere near what you would expect. There are good single chip solutions for that, such as the ones from THAT Corp, but they do assume the availability of bipolar supplies at a reasonable level (12 to 18V).

  17. #17
    Senior Member
    Join Date
    Sep 2013
    Location
    Sonoma County, CA
    Posts
    141
    Quote Originally Posted by Nantonos View Post
    No; put the negative side to ground on your single ended input and the positive side to signal input.
    That is certainly true for single-ended inputs. However, I was speaking of using single-ended outputs.

    Pin headers to allow a choice of connector is the best idea. Having said that, high end equipment using balanced connections is unlikely to be using the low, single rail voltages that you are using here.
    I agree that going with the pin connectors is the best solution for maximum flexibility.

    If you are relying on normal tolerance resistors to produce balanced inputs and outputs they you will find the measured common mode rejection ratio is nowhere near what you would expect. There are good single chip solutions for that, such as the ones from THAT Corp, but they do assume the availability of bipolar supplies at a reasonable level (12 to 18V).
    All the passives that I have selected for the differential circuitry are the minimum tolerance that I can find for that very reason (maintaining CMRR).

    I'm not using the kind of bipolar supplies used in most analog equipment to minimize the power supply cost and complexity (2 power rails instead of 4). This makes it a little more difficult to find a suitable amplifier, but the THS4521 has good enough specs that the performance of the board should be mainly determined by the codec, and not the input and output buffers. All the analog inputs and outputs are AC coupled anyway, so the power supply rails that I use shouldn't be an issue.

  18. #18
    Senior Member
    Join Date
    Sep 2013
    Location
    Sonoma County, CA
    Posts
    141
    I've updated the circuit with 3 pin headers for the analog IO connections.

    I think that this is good enough to start laying out. Thanks for all the input!
    Attached Files Attached Files

  19. #19
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    15,720
    Just one quick question. Any idea what the performance is like if someone uses only the positive side of an output?

    Every balanced output DAC I've ever seen has recommended using an opamp to substract the 2 signals, for a single ended output. I believe this one does too, in figure 14 on page 33.

    My question, I guess, is whether the common mode voltage out of these DACs is really low noise+distortion, and also low impedance? I honestly don't have a good feeling for what it really is with these chips, and of course they don't spec it.

  20. #20
    Senior Member
    Join Date
    Sep 2013
    Location
    Sonoma County, CA
    Posts
    141
    I don't think that the performance will degrade much if someone only uses the positive output. The main thing is really losing half the signal swing. The other side effect is that, by making the output diff amp drive unbalanced loads, the common mode rejection ratio will degrade somewhat depending on how unbalanced the loads are. The high open loop gain of the diff amp will minimize the imbalance that is seen by the DAC itself.

    I did some quick calculations on how the imbalance would affect the open-loop output of the diff amp, and it looks like someone would have to really load down one of the outputs to really unbalance the circuit. Even with a 600 ohm load on one output and an open on the other, the diff amp only sees an open-loop output imbalance of ~4%. The high open-loop gain of the amp should then minimize the actual imbalance when the loop is closed.

    The only effect that the DAC should see is a larger than normal offset voltage at the input of the diff amp.

    TLDR: I'm not really sure exactly what the effect will be of loading down only one of the balanced outputs, but I don't think that it will make much of a difference. I may add a single-ended output as you suggested, at least for testing. You are right that it shouldn't take up much board space, and I already have a good op-amp picked out from before I decided to go with fully differential amps.

  21. #21
    Senior Member
    Join Date
    Nov 2012
    Location
    Boston, MA, USA
    Posts
    1,068
    Quote Originally Posted by PaulStoffregen View Post
    Just one quick question. Any idea what the performance is like if someone uses only the positive side of an output?

    Every balanced output DAC I've ever seen has recommended using an opamp to substract the 2 signals, for a single ended output. I believe this one does too, in figure 14 on page 33.
    Using an op-amp or other circuit to subtract the signals (and thus rejecting common-mode signals) is what makes it a balanced input. It is also possible, though less desireable, to interconnect balanced and unbalanced inputs and outputs. There are good and bad ways of doing so, and a widely cited reference on this is
    RANE Note 110: Sound System Interconnection
    (Also useful: RANE Note 151: Grounding and Shielding Audio Devices)

    Naturally, higher-end systems don't include this in their spec sheets, because normally they pick the best configurations which will give the most impressive figures for their sales, er, spec sheets.

  22. #22
    Senior Member
    Join Date
    Jul 2014
    Posts
    1,454
    Balanced input/output?
    Does it not also depend on the available or planned input and output devices? if they provide or expect balanced in/output. Also, long cables with possible electrical interferences ask for differential transmission.
    So, having both solutions available would facilitate wider acceptance.

  23. #23
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    15,720
    I'm looking at the schematic again, and I have another quick question.

    I'm looking at the "VCOM" label on the wire between pins 3 and 5 on the the OPA2348 opamp (U302). Does that label mean it's connected to pin 15 on the CS4272 codec (U301)?

  24. #24
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    15,720
    Looking at opamp specs.... it's really unfortunate the THS4520 doesn't come in a hobbyist friendly package!

  25. #25
    Senior Member
    Join Date
    Sep 2013
    Location
    Sonoma County, CA
    Posts
    141
    Nantonos, those are excellent resources. Thanks for the links!

    The connection that I had imagined for single-ended outputs corresponds to diagrams 3,9, and 10 in the first link, where the negative output is left un-connected at the source, and only the positive and ground (shield) connections are connected to the following single-ended input.

    WMXZ, I'm trying to set up the circuits so that either single-ended or differential devices can be connected without having to change the audio board circuit. This should be as simple as shorting the negative inputs to ground for a single-ended connection, and leaving the negative outputs disconnected for a single-ended output.

    Paul, you are correct that the "VCOM" pin on the codec is connected to the inputs on that opamp. The opamps get used to match the input and output buffer common mode voltages to what the codec expects to maximize voltage swing on the inputs, and to provide a minimal common mode load on the DAC.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •