connect the output of an audio amplifier to an ADC - Page 1
Forum section: electronics / projects

author: luiHS
author_rank: Frequent Contributor
timestamp: January 07, 2024, 08:13:20 am
content: helloWhat would be the best way to connect the output of an audio amplifier to an ADC?.The idea is to capture the audio output of an amplifier and convert it digitally so that it can be analyzed with a microcontroller or a Raspberry with software to know the characteristics of that amplifier, such as harmonic distortion, intermodulation distortion, crossover, signal-to-noise ratio, width frequency band, dumping factor, etc.I have thought that I could use some type of impedance transformer, but I don't know if it is correct or ideal.

author: moffy
author_rank: Super Contributor
timestamp: January 07, 2024, 09:24:33 am
content: You could just use a capacitively coupled resistive divider, but that won't provide voltage isolation if you need it. If you need the isolation I would use the previous divider, ac coupled, followed by a very high grade audio transformer.

author: shapirus
author_rank: Super Contributor
timestamp: January 07, 2024, 09:56:40 am
content: If your ADC is a separate chip (outside of the MCU/SBC), then you can first feed the analog signal into it and then have a digital isolator IC sitting between the ADC and the MCU.That is, if you need isolation at all. Why would you?

author: MarkT
author_rank: Frequent Contributor
timestamp: January 07, 2024, 10:26:32 am
content: Quote from: shapirus on January 07, 2024, 09:56:40 amGround loop noise might be an issue if not isolated.Certainly need an attenuator for a power amplifier, otherwise you'll fry the ADC. To measure distortions you'll need a good quality I2S ADC, 24 bit, preferrably running at 192kSPS or higher (so you can analyze harmonics above 20kHz).An easier strategy might be to use a differential attenuator into a differential input USB soundcard, direct to your PC - easy to pull the data off and save to a wav file with Audacity. I use Python's numpy + scipy.signal for data analysis like this.The other issue is you need a low distortion oscillator or DAC to be able to generate test tones for distortion measurement - USB soundcard solves this too.

author: NiHaoMike
author_rank: Super Contributor
timestamp: January 07, 2024, 01:39:04 pm
content: An off the shelf recording interface will do, only thing to add is a voltage divider to reduce the signal. XLR is differential so "isolation" can be done the same way most differential scope probes do it.

author: CaptDon
author_rank: Super Contributor
timestamp: January 07, 2024, 03:20:49 pm
content: You don't want any transformer in your measurement chain and I think you hit a wrong key as it is 'Damping Factor' which I doubt you can measure with your proposed setup. And for your measurements to have any meaning you will need the purest of pure sinewave generation with the ability to do two separate waves for I.M.D. studies. Your amplifier performance will vary greatly depending on if your load is purely resistive or is an actual speaker. Your measurements will be relative to the exact load because amplifiers regardless of quality respond differently to huge variances across the impedance range of a speaker. An 8 ohm speaker could easily show a range from 5 to 100 ohms. We still use the Potomac Instruments AA Audio Analyzer and AG audio generator to comply with F.C.C. measurements of the audio chain although things are changing in the digital world.

author: moffy
author_rank: Super Contributor
timestamp: January 07, 2024, 11:38:20 pm
content: Quote from: CaptDon on January 07, 2024, 03:20:49 pmIf they can be avoided you are absolutely correct as they introduce THD and are not perfectly flat, but then there are the problems of ground loops, equipment protection etc. and the level of accuracy that is needed. Just for information I include the specs of a good audio transformer for completeness.https://www.jensen-transformers.com/wp-content/uploads/2014/08/jt-11p-1.pdf

author: SiliconWizard
author_rank: Super Contributor
timestamp: January 08, 2024, 12:03:15 am
content: You first need to make explicit what exactly you want to measure, with what kind of accuracy. Otherwise it's impossible to answer the question in a relevant manner.I know you mentioned types of measurements, but these are vague requirements. Mentioning accuracy and resolution is important as this can lead to widely different approaches.And regarding impedances, you also need to elicit if this needs to comply with any kind of standard and what your goal is exactly.For instance, for any kind of amplifier, it makes sense to be able to make measurements with the min/typical/max load impedance (so loading the output appropriately) at different output power levels. So you should load the output with adequate loads. After that, any high-impedance input to a decent ADC, with some attenuation if needed (I would just suggest using a decent audio card for this, why bother creating your own unless you have ultra specific needs in mind) would do. The audio card would also be used to feed the input of the amplifier.You could indeed use some transformers to act both as a load and attenuator, but such transformers with very low THD are extremely expensive and would limit your possibilities of emulating different loads. So I would stick with resistive loads and purely resistive attenuators. And nice heatsinks.

author: luiHS
author_rank: Frequent Contributor
timestamp: January 09, 2024, 02:14:29 am
content: Thank you all.In the end I think I will opt for the simplest and most economical solution, but I think that with features that may be enough for what I need.Hardware: a Soundblaster x3 card, with a 24-bit input resolution for Mic/lin to capture the sound, and a 32-bit output for the signal generator.As software, I will use Visual Analyzer, it is free and has practically everything I am looking for, oscilloscope, spectrum analyzer, signal generator (waveforms, pink noise, etc...) and special functions to measure THD and others.To connect the speaker output of the amplifier to the Mic/Lin input of the sound card, I have seen this simple circuit that was published in Nueva Electronica magazine, in an article on how to measure Harmonic Distortion using Visual Analyzer and an interface that manufactured that magazine, but it can be replaced by a sound card.

author: Vovk_Z
author_rank: Super Contributor
timestamp: January 09, 2024, 06:47:50 am
content: Quote from: luiHS on January 07, 2024, 08:13:20 amQuestion is a bit unclear. The best way is to use wires, connectors and resistive dividers. But it depends on balanced/unbalanced too.A question which bothering me is why you can't use just a PC with an appropriate sound card and existing software? Possibly, there is an existing solution.For example, I use ARTA (in demo mode, I'm DIYer not pro) and Asus Xonar Essence STX.

author: magic
author_rank: Super Contributor
timestamp: January 09, 2024, 09:20:44 am
content: I don't see the point of C1.OTOH, I would want a resistor in series with the top of the potentiometer in order to ensure that attenuation ratio can never exceed a safe level like 1% or 10%, depending on output power of the amp.

author: MarkT
author_rank: Frequent Contributor
timestamp: January 09, 2024, 10:22:51 am
content: C1 keeps any DC offset from the wiper of the pot. DC on a wiper can lead to scratchiness, not sure if that's really an issue here.

author: Vovk_Z
author_rank: Super Contributor
timestamp: January 09, 2024, 11:16:18 am
content: Quote from: magic on January 09, 2024, 09:20:44 amI may add that it is much more convenient and safe (fault-proof) for me to almost always use a fixed divider (1:10). You can always calculate a signal level with a fixed-ratio divider.

author: luiHS
author_rank: Frequent Contributor
timestamp: January 09, 2024, 04:19:37 pm
content: In another magazine where there is a complete interface for use with the Visual Analyzer software, which is like an old sound card using a PCM2902, they have included a three position switch (x1-x10-x100) for the same function than voltage attenuators in a laboratory oscilloscope. The card additionally has an impedance adapter at the input, which includes a unity gain amplifier and a low-pass filter. In this way, voltages between several millivolts and more than 150 volts can be measured.I don't know if it could really be interesting to include that impedance adapter with a low-pass filter in my attenuator design.This is the complete explanation that the magazine gives about the input attenuator and filter:Once it has passed through the capacitor C1, whose function is to eliminate any continuous component, the signal to be measured is applied to the divider formed by the precision resistors R1-R2-R3 connected to the 3-position switch S1 (x1-x10-x100 ) that performs the function of selective input attenuator.By selecting one of these positions, voltages between tens of millivolts and about 170 volts peak/peak can be measured:- In the x1 scope, signals up to 1.7 volts peak/peak can be measured.- In the x10 scope, signals up to 17 volts peak/peak can be measured.- In the x100 scope, signals up to 170 volts peak/peak can be measured.The ceramic capacitors C2-C3 are connected to the resistors R1-R3, whose function is to compensate the input attenuator in frequency.It is important to keep in mind that the compensation is calculated for the use of a normal coaxial cable or an oscilloscope probe set to the x1 position. We do not recommend using these probes in the x10 position, since in this case the input divider will not be compensated.NOTE: Capacitor C1 eliminates the DC component of the signal. For this reason it is not possible to measure continuous voltages with the LX.1690 interface card. The minimum frequency of the signal to be measured is 10 Hz.The center terminal of switch S1 is connected to the non-inverting input of operational IC1/A, which performs the function of impedance adapter.The two zener diodes DZ1 and DZ2 used to limit the maximum amplitude of the signal to +/-4 volts are connected to the same operational input. In this way, even if excessive voltage is applied to the card input, damage to the circuit is avoided.A second operational (IC1/B) is connected to the output of the operational IC1/A, also with unity gain, which together with the capacitors C7-C8 and the resistors R5-R6 constitute a low-pass filter with a cut-off frequency of 40KHz. This filter eliminates signals with a frequency close to the sampling frequency of the converter. From the output of the integrated IC1/B, the signal is sent, through the capacitor C20, to terminal 12 of the USB converter IC2, which proceeds to convert it into digital format and transmit it to the USB port of the computer.