Silicon ChipUSB SUPERCODEC - September 2021 SILICON CHIP
  1. Outer Front Cover
  2. Contents
  3. Subscriptions: PE Subscription
  4. Subscriptions: PicoLog Cloud
  5. Back Issues: PICOLOG
  6. Publisher's Letter
  7. Feature: The Fox Report by Barry Fox
  8. Feature: Techno Talk by Mark Nelson
  9. Feature: Net Work by Alan Winstanley
  10. Project: USB SUPERCODEC by Phil Prosser
  11. Project: USB Supercodec by Andrew Woodfield
  12. Project: High-power Ultrasonic Cleaner Part 1 by John Clarke
  13. Project: Night Keeper Lighthouse by Andrew Woodfield
  14. Feature: AUDIO OUT by Jake Rothman
  15. Feature: Max’s Cool Beans by Max the Magnificent
  16. Feature: Flowcode Graphia I Programming by Martin Whitlock
  17. Feature: PIC n’Mix by Mike Hibbett
  18. Feature: Practically Speaking by Jake Rothman
  19. Feature: Circuit Surgery by Ian Bell
  20. PCB Order Form
  21. Advertising Index

This is only a preview of the September 2021 issue of Practical Electronics.

You can view 0 of the 72 pages in the full issue.

Articles in this series:
  • (November 2020)
  • Techno Talk (December 2020)
  • Techno Talk (January 2021)
  • Techno Talk (February 2021)
  • Techno Talk (March 2021)
  • Techno Talk (April 2021)
  • Techno Talk (May 2021)
  • Techno Talk (June 2021)
  • Techno Talk (July 2021)
  • Techno Talk (August 2021)
  • Techno Talk (September 2021)
  • Techno Talk (October 2021)
  • Techno Talk (November 2021)
  • Techno Talk (December 2021)
  • Communing with nature (January 2022)
  • Should we be worried? (February 2022)
  • How resilient is your lifeline? (March 2022)
  • Go eco, get ethical! (April 2022)
  • From nano to bio (May 2022)
  • Positivity follows the gloom (June 2022)
  • Mixed menu (July 2022)
  • Time for a total rethink? (August 2022)
  • What’s in a name? (September 2022)
  • Forget leaves on the line! (October 2022)
  • Giant Boost for Batteries (December 2022)
  • Raudive Voices Revisited (January 2023)
  • A thousand words (February 2023)
  • It’s handover time (March 2023)
  • AI, Robots, Horticulture and Agriculture (April 2023)
  • Prophecy can be perplexing (May 2023)
  • Technology comes in different shapes and sizes (June 2023)
  • AI and robots – what could possibly go wrong? (July 2023)
  • How long until we’re all out of work? (August 2023)
  • We both have truths, are mine the same as yours? (September 2023)
  • Holy Spheres, Batman! (October 2023)
  • Where’s my pneumatic car? (November 2023)
  • Good grief! (December 2023)
  • Cheeky chiplets (January 2024)
  • Cheeky chiplets (February 2024)
  • The Wibbly-Wobbly World of Quantum (March 2024)
  • Techno Talk - Wait! What? Really? (April 2024)
  • Techno Talk - One step closer to a dystopian abyss? (May 2024)
  • Techno Talk - Program that! (June 2024)
  • Techno Talk (July 2024)
  • Techno Talk - That makes so much sense! (August 2024)
  • Techno Talk - I don’t want to be a Norbert... (September 2024)
  • Techno Talk - Sticking the landing (October 2024)
  • Techno Talk (November 2024)
  • Techno Talk (December 2024)
  • Techno Talk (January 2025)
  • Techno Talk (February 2025)
  • Techno Talk (March 2025)
  • Techno Talk (April 2025)
  • Techno Talk (May 2025)
  • Techno Talk (June 2025)
Part 1 – By Phil Prosser USB • 192kHz • 24-bit This beauty is the ultimate in high-fidelity audio recording and playback. You could use the SuperCodec for digitising LPs, recording your own music or playing music with a very high-quality stereo amplifier driving excellent speakers. It can also turn your PC into an advanced audio analyser, capable of measuring harmonic distortion down to 0.0001% and signal-to-noise ratios up to 110dB (or even more, with suitable attenuators). T his project was inspired by a reader who wanted to digitise his LP collection, and asked us if we had a USB sound interface that would let him record with very high fidelity. If you want better quality audio for your PC, including the ability to record and playback at high sampling rates and bit depths (up to 192kHz, 24-bit), then read on. In addition to recording and playback of music or other audio, this project enables your PC to become an advanced audio quality analyser. You just need the right software; we’ll get to that later. With the addition of the 2-Channel Balanced Input Attenuator for Audio Analysers and Digital Scopes from the May 2016 issue, you will have a potent measurement tool indeed. 16 It allows you to measure the distortion performance of the very best amplifiers, preamps, equalisers and other audio devices. In designing this project we started by looking for a simple IC CODEC as the solution. There are some all-in-one USB audio chips available, but they fall short on several fronts. They generally limit you to the use of 48kHz, 16bit audio, but more importantly, they generally have quite high distortion figures of around 0.1%, with signal-tonoise ratios topping out at about 85dB. We need better performance than that. The first prototype for this project used the same analogue-to-digital converter (ADC) and digital-to-analogue converter (DAC) boards from the DSP Active Crossover (Jan-Mar 2020). Those boards use the Cirrus Logic CS5381 and CS4398 chips respectively. While they are a few years old, their performance is phenomenal. The CS4398 DAC has a dynamic range of 120dB and signal-to-noise ratio (SNR) of 107dB; the CS5381 ADC achieves an SNR of 110dB, or 0.0003%. So we decided to stick with those chips but put as much as possible onto one board, to make it easier to build and give a nice, compact result. The performance this USB sound card delivers should fulfil even the most ardent Hi-Fi enthusiasts’ desires. We did make several changes and improvements compared to that earlier project, though. This design teases the maximum performance from these parts, in a ‘no-compromise’ approach to low noise and low distortion. Plus, it provides ‘plug-and-play’ operation for Windows, Mac and Android computers. We tested it on Practical Electronics | September | 2021 Windows, but trust the vendor’s promise of Mac and Android compatibility. During the development process, we made several key decisions:  To get the best performance, we need to isolate the PC’s ground from the USB sound card. Computers are noisy things, so we must break the ground loop.  It must be supported by proper drivers in Windows and ideally, all other common operating systems.  The ability to handle different sampling rates is important, though once set, it will generally be left alone.  The PCB layout must minimise noise, plus we need to be able to connect the inputs and outputs in a variety of ways.  Putting a transformer in the box would introduce measurable 50Hz related noise, even if we took measures to minimise it. Since we don’t want a complicated power supply arrangement, we chose a DC plugpack.  For the neatest/cleanest project for PE constructors, everything should be on one PCB. As we have noted in the past, the use of some surface-mount components is unavoidable in projects like this. We need to use specific parts to get this level of performance, and in many cases, they only come in SMD versions. In this case, that includes the USB interface and the ADC and the DAC chips. Where possible, though, we have used through-hole components. This has resulted in the PCB being a bit larger than an all-SMD version would be, but we have found a very nice case that fits it neatly. Principle of operation Fig.1 shows the block diagram of the SuperCodec. It consists of a USB-toI2S (serial digital audio) interface with galvanic isolation to the remainder of the circuit, a local clock generator for Features  Stereo input and output with very low distortion and noise  Connects to computer via USB  Windows, macOS and Android driver support  Asynchronous sampling rate conversion (completely transparent)  Full galvanic isolation between computer and audio connectors  Housed in a sleek aluminium instrument case  Power by 12V DC (eg, from plugpack)  Power and clipping indicator LEDs. the ADC and DAC with bidirectional asynchronous sampling rate conversion (ASRC), the power supply section and the aforementioned ADC and DAC sections. We have chosen to use a MiniDSP MCHStreamer to provide the USB interface. This is a pre-built device that we have integrated into our design. This avoids us having to develop the hardware and USB driver software for the PC which is complex, expensive and needs to be done very well to deliver you an easy-to-use product. It is essential that constructors can reliably install the sound driver software for this project and have it work with a minimum of fuss. The investment in this component is well worth the ease of use it will deliver for you. This project appears to a Windows computer as a sound interface that you select and use just like any other – we show you how to in the box titled Setting up the MCHStreamer. This is essentially a regular audio device then, just one of very high quality. The MCHStreamer is a very clever device that can provide 10 input and output channels (five stereo pairs) with sampling rates of 32-384kHz at 24 bits. It supports I2S as well as TDM and other audio formats. We are using it as a two-channel (stereo) audio interface. This leaves many channels unused, but that is not the aim of this project. If you want to use this design as the basis of a multichannel recorder, be our guest! The MCHStreamer is powered from the USB cable and breaks out the I2S audio interface that we need on a pair of headers. The chip we’re using for galvanic isolation requires a power supply on both sides of the barrier. Luckily, the MCHStreamer has a 3.3V output available on an expansion header which we can use to power the computer-side of that chip. The audio-side power supply is derived from the plugpack, along with power for the rest of the circuit. You can buy the MCHStreamer from: https://bit.ly/pe-sep21-mch – once you register and order it, you can download the PC driver software. We have laid out our sound card so that the MCHStreamer plugs straight onto the underside of the board. This avoids having to send high-speed digital signals over a ribbon cable. When purchasing parts for this, be very careful to get the header specified in the parts list. Any alternative needs a pin pitch of 2mm and a minimum height of 10mm; otherwise, you will not be able to seat the MCHStreamer fully. Performance measurements We used three methods to measure the performance of the USB SuperCodec, and these measurements aided us in improving it over several iterations until we arrived at the final design. The first method was to feed in a very-low-distortion sinewave from a Fig.1: the concept of the USB SuperCodec is deceptively simple, since much of the complexity is hidden in the prebuilt MiniDSP MCHStreamer module. That USB interface module produces a serial digital audio stream which passes through a galvanic isolation section and onto the ASRC, then the separate ADC and DAC sections. It’s all powered from the PC USB 5V and a 12V DC plugpack. Practical Electronics | September | 2021 17 Fig.2: spectral analysis (large window FFT) of the data from the SuperCodec’s ADC when fed a sinewave from a Stanford Research Ultralow Distortion Function Generator. This gives an excellent result of 0.0001% THD (−121.4dB). That’s despite an earth loop causing a larger-than-normal spike at 50Hz, which was fixed with some extra isolation in the final version of the sound card. Fig.3: a close-up of the 980-1020Hz portion of the spectral analysis, showing very little evidence of clock jitter in the ADC system. That’s because the crystal oscillator, digital isolators and ASRCs are all low-jitter devices. High jitter can distort signals since the sampling rate effectively changes between samples. Stanford Research DS360 Ultralow To verify that clock jitter is not a Loopback testing Distortion Function Generator. Very problem, we then ‘zoomed in’ to the The second test method was to conlarge sample sets were run through 1kHz fundamental, as shown in Fig.3. nect the unit’s outputs to its inputs an FFT so we could via a stereo RCA-RCA inspect the close-in cable. This lets us Specifications phase noise. conduct ‘loopback’  Sampling rate: 32-192kHz The reason for dotests using PC audio  Resolution: 16-32 bits (24 bits actual) ing this (rather than analysis software. The  Loopback total harmonic distortion (THD): 0.0001% (−120dB) merely looping the result of the first such output back to the test is shown in Fig.4.  DAC THD+N: 0.00050% (−106dB) input) is that we need You can see that we’ve  ADC THD+N: 0.00063% (−104dB) independent clocks solved the earth loop  Loopback THD+N, no attenuator: 0.00085% (−101.4dB) for the signal generanow as the 50Hz peak  Loopback THD+N, 8dB resistive attenuator: 0.00076% (−102.5dB) tor and ADC to pick is at −130dB! You can  Recording signal-to-noise ratio (SNR): 110dB up any distortion also see the 50kHz  Playback SNR: 107dB caused by clock jitter. spike from the switch Dynamic range: 120dB With both devices mode circuitry.  Input signal level: up to 1V RMS running off the same Importantly, there  Output signal level: up to 2.4V RMS; 2.0-2.2V RMS clock, those effects is no spike at 25kHz, (−1.5 to −0.75dB) for best performance are liable to cancel 12.5kHz or related freeach other out, at quencies, suggesting least partially. that the switchmode The results of this first test are This plot shows spectral data for 1kHz regulators are not squegging – ie, are shown in Fig.2. Note that we had an ±20Hz. This shows that the fundamen- free from subharmonic oscillation that earth loop during this test, leading tal is 120dB down at about ±2Hz from could affect audible frequencies. to a greater than usual spike at 50Hz the fundamental. That’s about as good The harmonics of the very slightly (this was fixed later); despite this, as you can expect, and suggests that distorted 1kHz fundamental are visthe reading is extremely promising jitter in the clock source and digital ible at 2kHz, 3kHz... up to 8kHz, then with a THD figure of just 0.0001% signal path is minimal and has little 11kHz and 12kHz. The strongest hareffect on performance. (−118dB) THD. monic is 2kHz (second harmonic), at Fig.6: the noise floor of the complete DAC+ADC system. Although it is higher than the ADC alone, it is still very low at around −130dB. 18 Fig.7: here the 1kHz test signal has been reduced in amplitude by 10dB, dropping from around 1V RMS to around 0.1V (100mV) RMS. That’s below most normal ‘line level’ signals, but despite this, distortion performance is still excellent, with THD measuring as −112dB/0.0002%. Practical Electronics | September | 2021 Fig.4: the first loopback test, measuring the performance of the complete DAC+ADC system. Performance is still excellent with only slightly higher harmonic distortion than the ADC alone, at −118dB (still rounding to 0.0001%). Fig.5: the noise floor of the ADC, measured with the inputs shorted. The biggest spike in the audible range is at 50Hz due to mains hum pickup, but this is hardly a problem, being below −140dB. Total Harmonic Distortion (%) around −118dB. The result is a very Indeed, if you are using this device We made many other loopback low THD figure of −118dB/0.00013%. as part of a measurement system, you measurements at other test frequencies Remember, that this now includes would need resistive dividers, espe- ranging from 20Hz up to 19kHz, all any distortion from the DAC plus the cially if the device you are measuring with virtually identical results, so the plots are not worth reproducing. We ADC, so this is very impressive. But has gain (eg, an audio amplifier). also ran 1kHz tests with lower this measurement does not and higher signal levels. include noise. Fig.7 shows the results To calculate the THD+N with the output level refigure and signal-to-noise duced by 10dB. This only ratio, the inputs to the ADC increases the THD figure to were shorted out, and a new −112dB/0.0002%, indicating spectrum captured (Fig.5). that you aren’t sacrificing We then reinstated the loopmuch performance by operatback cables and measured ing the codec at lower signal the input level with the DAC levels when necessary. silent (Fig.6). These give us an Fig.8 is at the maximum outidea of the noise floor, which put signal level, which increasis around −104dB for the ADC es second and third-harmonic alone and −102dB for the distortion so that the THD DAC+ADC. Both figures are figure is −111dB/0.0003%. limited by 50Hz hum pickup. This indicates that the optimal Since these levels are The back end of the SuperCodec has all the input and output connectors (the RCA sockets) along with the USB signal level for low distortion significantly higher than the connector and the 12V DC power socket. is a few decibels below maxiTHD alone, that means the So when used as a measurement sys- mum. But you’ll still get decent results THD+N performance figures for the sound card are determined just by the tem, expect slightly better performance at the maximum output signal level, if than the figures given here suggest. Es- that’s what you need. noise levels. By the way, since the DAC has to sentially, the loopback have its output level set no higher than THD+N (and thus the SuperCodec DAC THD+N vs Frequency 19/05/20 14:37:19 .01 −7.5dB to avoid overloading the ADC in measurement limit) will approach the 0.00063% 22kHz BW 0dB the loopback test, we could have gotten 22kHz BW -1dB .005 better results by inserting a resistive (−104dB) figure given 22kHz BW -2dB divider between the output and input. for the ADC alone. 22kHz BW -7.5dB 80kHz BW 0dB .002 .001 .0005 .0002 .0001 Fig.8: the 1kHz test signal has been increased to the maximum DAC output level of a bit more than 2V RMS. You can see that in this case, more isn’t necessarily better, as the THD figure is slightly worse than the 1V test case, yielding a THD figure of −111dB/0.0003%. That’s still excellent, though! Practical Electronics | September | 2021 20 50 100 200 500 1k 2k Frequency (Hz) 5k 10k 20k Fig.9: THD+N (not THD) at four different signal levels for the SuperCodec’s DAC, asFig.9 measured with our Audio Precision System Two. The fifth curve has a wider measurement bandwidth of 20Hz-80kHz, to get a more realistic idea of distortion levels at higher frequencies. Unfortunately, measurements with 80kHz bandwidth also have an unrealistically high noise level. 19 Parts list – USB SuperCodec 1 PCB assembly – see below 1 Hammond 1455N2201BK extruded aluminium instrument case with black panels [Altronics H9125, Mouser 546-1455N2201BK] 1 MiniDSP MCHStreamer USB-to-I2S interface [https://bit.ly/pe-sep21-mch] 1 12V DC plugpack, 1.5A+ [Altronics M8936D, Jaycar MP3486] 2 white (or black) insulated panel-mount RCA sockets (CON6a,CON7a) [Altronics P0220, Jaycar PS0496] 2 red insulated panel-mount RCA sockets (CON6b,CON7b) [Altronics P0218, Jaycar PS0495] 2 plastic TO-220 insulating bushes 2 M3 x 6mm panhead machine screws 1 M3 x 10mm panhead machine screw 2 M3 flat washers 3 M3 shakeproof washers 1 M3 hex nut 2 3mm inner diameter solder lugs 2 3mm inner diameter fibre washers 1 8mm tall adhesive rubber foot [Altronics H0930, Jaycar HP0825] 4 12mm round slim adhesive rubber feet [Altronics H0896] 1 1m length of heavy-duty figure-8 shielded audio cable [Altronics W2995, Jaycar WB1506] 1 30cm length of 2.4-3mm diameter black or clear heatshrink tubing 1 30cm length of 5mm diameter black or clear heatshrink tubing PCB assembly parts 1 double-sided PCB coded 01106201, 99.5 x 247.5mm 1 150µH 5A toroidal inductor (L1) [Altronics L6623] 2 47µH 0.5A bobbin-style inductors (L2,L4) [Altronics L6217] 1 100µH 5A toroidal inductor (L3) [Altronics L6622, Jaycar LF1270] 13 4-5mm ferrite suppression beads (FB1-FB13) [Altronics L5250A, Jaycar LF1250] 2 M205 fuse clips (F1) 1 5A fast-blow M205 fuse (F1) 3 16x22mm TO-220 PCB-mount heatsinks (HS1-HS3) [Altronics H0650, Jaycar HH8516] 1 PCB-mount DC barrel socket, 2.1mm ID (or to suit plugpack) (CON1) [Altronics P0620, Jaycar PS0519] 2 tall 6x2-pin header sockets, 2.0mm pitch (CON2,CON3) [Samtec ESQT-106-03-F-D-360; available from Mouser] 2 4-pin polarised headers with matching plugs, 2.54mm pitch (CON4,CON5) [Altronics P5494+P5474+P5471, Jaycar HM3414+HM3404] 3 mica or rubber TO-220 insulating washers 3 plastic TO-220 insulating bushes 3 M3 x 6mm panhead machine screws 3 M3 flat washers 3 M3 shakeproof washers 3 M3 hex nuts 1 60 x 70mm rectangle of Presspahn, Elephantide or similar insulating material Semiconductors 1 CS5381-KZZ stereo 192kHz ADC, TSSOP-24 (IC1) [#] 7 NE5532AP or NE5532P dual low-noise op amps, DIP-8 (IC2-IC5,IC8,IC10,IC11) 2 CS8421-CZZ stereo audio sample rate converters, TSSOP-20 (IC6,IC7) [#] 1 CS4398-CZZ stereo 192kHz DAC, TSSOP-28 (IC9) [#] 1 MAX22345SAAP+ 4-channel high-speed digital isolator, SSOP20 (IC12) [#] 1 DS1233A-10+ 3.3V supply supervisor, TO-92 (IC13) [#] Audio Precision testing The third measurement method we used was to hook the SuperCodec up to an Audio Precision System Two (AP2) analyser. This was mainly to verify that the above results were all correct, and we weren’t somehow fooling ourselves 20 1 4N28 optocoupler, DIP-6 (OPTO1) [Altronics Z1645] 1 ACHL-25.000MHZ-EK 25MHz clock oscillator module (XO1) [#] 2 LM2575T-ADJG 1A buck regulators, TO-220-5 (REG1,REG2) [#] 3 LM317T 1A positive adjustable regulators, TO-220 (REG3,REG6,REG8) [Altronics Z0545, Jaycar ZV1615] 1 LM337T 1A negative adjustable regulator, TO-220 (REG4) [Altronics Z0562, Jaycar ZV1620] 1 LP2950ACZ-3.3 100mA 3.3V low-dropout regulator, TO-92 (REG5) [Altronics Z1025] 1 AZ1117H-ADJ 1A adjustable low-dropout regulator, SOT-223 (REG7) [Altronics Y1880] 1 BC547 or BC549 100mA NPN transistor (Q1) 2 high-brightness 5mm LEDs (LED1,LED2) 9 1N4004 400V 1A diodes (D1,D22-D29) 2 1N5822 40V 3A schottky diodes (D2,D3) 12 BAT85 30V 200mA schottky diodes (D5-D16) [Altronics Z0044] Capacitors 1 2200µF 25V low-ESR electrolytic [Altronics R6204, Jaycar RE6330] 1 2200µF 10V low-ESR electrolytic [Altronics R6238, Jaycar RE6306] 4 470µF 25V low-ESR electrolytic [Altronics R6164, Jaycar RE6326] 1 470µF 6.3V low-ESR organic polymer electrolytic [Panasonic 6SEPC470MW] [#] 1 220µF 25V low-ESR electrolytic [Altronics R6144, Jaycar RE6324] 4 100µF 25V low-ESR electrolytic [Altronics R6124, Jaycar RE6322] 8 47µF 50V low-ESR electrolytic [Altronics R6107, Jaycar RE6344] 1 33µF 25V low-ESR electrolytic [Altronics R6084, Jaycar RE6095] 4 22µF 50V bipolar electrolytic [Altronics R6570A, Jaycar RY6816] 14 10µF 50V low-ESR electrolytic [Altronics R6067, Jaycar RE6075] 1 1µF 63V electrolytic [Altronics R4718, Jaycar RE6032] 2 1µF 25V X7R SMD ceramic, 2012/0805 size [Vishay VJ0805Y105KXXTW1BC or VJ0805Y105KXXTW1BC] [#] 1 220nF 63V MKT 19 100nF 63V MKT 17 100nF 25V X7R SMD ceramic, 2012/0805 size [Kemet C0805C104M3RACTU] [#] 4 22nF 63V MKT 7 10nF 63V MKT 9 10nF 50V X7R SMD ceramic, 2012/0805 size [Kemet C0805C103J5RACTU] [#] 2 2.7nF 100V NP0/C0G SMD ceramic, 2012/0805 size [TDK C2012C0G2A272J125AA] [#] 4 1.5nF 63V MKT 8 470pF 50V NP0/C0G ceramic [TDK FG28C0G1H471JNT00] [#] 1 220pF X7R SMD ceramic, 2012/0805 size [AVX 08052C221K4T2A] [#] 2 100pF NP0/C0G/SL ceramic [Altronics R2822, Jaycar RC5324] 2 33pF NP0/C0G ceramic [Altronics R2816, Jaycar RC5318] Resistors (1/4W 1% metal film types) 5 47k 6 10k 2 5.6k 4 2.4k 2 1.5k 14 1.2k 3 1k 4 750 4 680 1 560 2 330 2 270 4 240 2 220 4 91 1 0 (or 0.7mm diameter tinned copper wire) 4 10 Resistors (1/10W 1% SMD types, 2012/0805 size) [#] 2 47k 5 2k 2 1k 1 220 1 22 1 10 All components marked with [#] are available from Mouser. Jaycar/Altronics references are used to provide builders outside Aus/NZ with enough information to source alternatives. Likewise, there are lots of possibe vendor tips and ideas here: https://www.siliconchip.com.au/Shop/6/5597 by using the Sound card to measure its own performance. We ran three tests: one to test the DAC in isolation, one to test the ADC in isolation, and one to test the whole system. The first test involved feeding digital sinewaves to the SuperCodec’s DAC, with its outputs then fed into the AP2’s Practical Electronics | September | 2021 .01 SuperCodec ADC THD+N vs Frequency 19/05/20 14:51:30 .01 Total Harmonic Distortion (%) Total Harmonic Distortion (%) 19/05/20 15:20:11 .005 .005 1V RMS (0dB) 0.5V RMS (-6dB) .002 .001 .0005 No attenuator 8.0dB attenuator .002 .001 .0005 .0002 .0002 .0001 SuperCodec loopback THD+N vs Freq. 20 50 100 200 500 1k 2k Frequency (Hz) 5k 10k 20k Fig.10: THD+N (not THD) at two different signal levels Fig.10 for the SuperCodec’s ADC, using our Audio Precision System Two as the signal source. The rise in distortion with increasing frequency seems to be an artefact of the way the audioTester software calculates THD+N. We don’t think it is a real effect. The true THD+N level for the ADC is well below 0.001% across the whole frequency range. distortion analyser. This yielded SNR and THD+N measurements both of 106dB, and the distortion vs frequency and level plot of Fig.9. These figures match the expected performance given in the CS4398 IC data sheet pretty much precisely, suggesting we’ve built the circuit correctly! The second test involved feeding the AP2’s low distortion sinewave generator into the SuperCodec’s ADC and plotting similar curves, shown in Fig.10. These curves are a bit ‘wonky’ due to the weird way that the software we used (audioTester) calculates THD+N, as we will explain in a later article. But despite this, they .0001 20 50 100 200 500 1k 2k Frequency (Hz) 5k 10k 20k Fig.11: THD+N (not THD) calculated in a loopback manner, ie, using just the SuperCodec with its outputs feeding its inputs. As the nominal DAC output level is 2.4V RMS and the maximum input level is 1V RMS, its performance is best with an 8dB resistive attenuator (1.5k/1k) between the outputs and inputs. Otherwise, the SNR is degraded by an additional 7dB or so. confirm that the ADC performance is just slightly worse than the DAC performance, mainly to do with its lower signal levels. The final test involved running more loopback tests, but this time using the audioTester software to measure THD+N, so that we can make a direct comparison to the Audio Precision figures. These curves are shown in Fig.11. This time, there appears to be an artificial drop at higher frequencies, which we think can be ignored. Our assumed real performance is pretty much flat, as shown by the dashed lines. So it seems that a measurement system based around a PC, the SuperCodec and some low-cost software has perfor- mance approaching that of our Audio Precision System Two, which cost many thousands when new. Even good used AP2s are priced at four figures. Plus, you gain additional functions and features with this solution compared to the AP2, such as THD-only measurements (rather than THD+N). Next month The USB SuperCodec circuit is fairly complicated, so we don’t have enough room to describe it in this article. We’ll present all the circuit diagrams next month, along with an in-depth description of how it all works. Then we’ll describe how to build and test it in, along with tips on how best to use it. Reproduced by arrangement with SILICON CHIP magazine 2021. www.siliconchip.com.au Our test setup. We initially built a version of this card without the asynchronous sample rate conversion (ASRC) components, shown at right. The performance is pretty much identical but it’s less flexible, so we decided to stick with the ASRC version. Practical Electronics | September | 2021 21