Effects of Y-splitting line level audio on signal integrity - Page 1
Forum section: electronics / beginners

author: Zbig
author_rank: Frequent Contributor
timestamp: February 07, 2024, 09:06:48 pm
content: HiI have this project in mind that involves my circuit going in between two line-level audio devices, essentially tapping off of the signal like a Y-splitter cable, i.e. hooking my device in parallel to the receiving device's line input. Inside my device, the signal is to be DC-biased and fed into a single-ended unipolar ADC inside of an MCU for further processing. The MCU in question is STM32L0 series that specifies the following parameters for ADC input impedance:That's the first time I've seen ADC input Z specified like this; they don't tell the inherent ADC channel's input impedance but instead tell you what impedance should you put in front of it to get desired results? Not sure I get it...Anyway, what I'm trying to ask is how should I design the input stage to the MCU as to not affect the signal quality in any perceptible way. My device should basically be as close to being "transparent" to the audio devices on both ends as practically possible. I am hoping for a basic solution like a voltage divider consisting of two 50k resistors for DC-biasing and a 10nF capacitor for AC-coupling. I'm reluctant of putting an op-amp in front due to power consumption considerations. Does a setup like this stand a chance of working properly and not messing up the audio signal? On the surface, due to the typically low output impedance of line-out sources and relatively high impedance of line-in inputs, I should should be able to get away with what is essentially Y-splitting the audio into two separate inputs so maybe I'm overthinking this?

author: ataradov
author_rank: Super Contributor
timestamp: February 07, 2024, 09:27:29 pm
content: This R_AIN is not what you need to put in front of the ADC, but the maximum source impedance. ADC has a capacitor that is charged before the conversion. This capacitor is charged by the source current, so source impedance affects how fast the capacitor can be charged.The best way to do what you want is to put a buffer opamp and decouple ADC from the source. It will work without the opamp, but the result depends on what you want to do with the signal. If you know that the source impedance is low, then the pass though signal is not going to be distorted, but it is hard to predict how ADC will deal with this AC coupled signal.

author: Zbig
author_rank: Frequent Contributor
timestamp: February 07, 2024, 09:47:57 pm
content: Quote from: ataradov on February 07, 2024, 09:27:29 pmRegarding R_AIN: that makes perfect sense, I get in now, thanks!Regarding buffering with opamp: that's the thing, the device is supposed to sit unattended, battery-powered for years and take action based on presence or lack of an audio signal. I chose the MCU especially because of its sub-2-ish microamp stop current that I hoped will allow me to wake up once a second or so, take few audio samples and go to sleep again. Single op-amp's 200-or-so microamp of quiescent current is already way to much for my use case. Hmm... what if I powered on the opamp only for the duration of the sampling (allowing for the settle time, of course)? But then again, I heard that feeding a signal into powered-off op-amp makes it behave unpredictably (clamping diodes and such) and is generally not the greatest idea?LOL, just realized my description seems like I'm trying to build some kind of spy device but that's not the case

author: ataradov
author_rank: Super Contributor
timestamp: February 07, 2024, 09:59:32 pm
content: If you don't actually need to sample the sound with playback quality, but to detect the presence of a signal, then you are fine. High source impedance may create higher conversion non-linearity, but it does not matter for detection.

author: Zbig
author_rank: Frequent Contributor
timestamp: February 07, 2024, 10:02:58 pm
content: Quote from: ataradov on February 07, 2024, 09:59:32 pmExcellent, thank you!

author: Kleinstein
author_rank: Super Contributor
timestamp: February 08, 2024, 08:55:06 am
content: The normal line audio signal level is too high to directly connect to the ADC of the µC. So one would definitely need some sort of protection. Here the difficulty is to get protection and still not effect the signal much with a nonlinear load.The typical line out signals are not high impedance: more like some 100 ohm at the output and high impedance imputs.For just detecting the presense of an AC signal one could also use some kind of rectifier (capacitors and 1-2 diodes) and only let the µC look at the rectified signal, that is changing slower.

author: magic
author_rank: Super Contributor
timestamp: February 08, 2024, 11:08:14 am
content: Y splitters have no effect on audio signals, the ADC has two effects:1.Pprotection diodes clamp the signal between GND and Vcc. You may want to use a voltage divider to reduce amplitude and then AC couple to Vcc/2.2. The act of sampling draws pulses of current from the source, hence the relatively low input impedance of unbuffered delta-sigma ADCs. This is not a problem as long as the ADC is sleeping and not sampling. A few occasional samples are unlikely to be noticeable - we are talking single-digit pF capacitance being charged each time.

author: Zbig
author_rank: Frequent Contributor
timestamp: February 08, 2024, 11:33:23 am
content: Quote from: Kleinstein on February 08, 2024, 08:55:06 amHmm... is it, though? According tohttps://en.wikipedia.org/wiki/Line_level, line level in consumer stuff should not exceed 2*sqrt(2) peak-to-peak, i.e. under 3 volts PP? Shouldn't a Zener diode provide enough protection for this edge case when things go full Nigel Tufnel?

author: Zbig
author_rank: Frequent Contributor
timestamp: February 08, 2024, 11:42:47 am
content: Quote from: magic on February 08, 2024, 11:08:14 amThat's exactly what I wanted to hear. Dzięki!Quote from: magic on February 08, 2024, 11:08:14 amYup, that's what I was planning on: AC-coupling the signal into a voltage divider to shift it up half-waveQuote from: magic on February 08, 2024, 11:08:14 amI believe the ADC in this STM is SAR and not delta-sigma but I'm pretty sure most of what you've said still applies as it has to charge this sample-and-hold cap somehow, like@ataradovmentioned.Thanks!

author: magic
author_rank: Super Contributor
timestamp: February 08, 2024, 12:04:20 pm
content: The exact amplitude of "line level" depends on source.Many audio DACs produce 2V RMS, this is common in CD players, USB DACs and some PCI(e) soundcards.Integrated soundcards often output somewhat less than 5Vpp because they run on a single 5V supply with output AC coupling.Battery powered portable devices may output less than that.Cheap USB dongles may be ~3.3Vpp.Vintage analog gear (radios, vinyl, tapes) - all over the place.

author: Zbig
author_rank: Frequent Contributor
timestamp: February 08, 2024, 08:18:49 pm
content: I have thrown something together in Falstad:http://tinyurl.com/2dobdh9p. How does this look to you guys? The last resistor on the right is supposed to symbolize ADC input.Also:

author: Zbig
author_rank: Frequent Contributor
timestamp: February 25, 2024, 03:00:07 pm
content: Quote from: Zbig on February 08, 2024, 08:18:49 pmI can now answer myself that these two Zener diodes that were supposed to clamp the ADC input voltage to 3V are a no-go as their parasitic capacitance messes up the input signal. Have to come up with something different to protect the ADC against excessive input voltage swing.