Author Topic: Effects of Y-splitting line level audio on signal integrity  (Read 709 times)

0 Members and 1 Guest are viewing this topic.

Offline ZbigTopic starter

  • Frequent Contributor
  • **
  • Posts: 927
  • Country: pl
Effects of Y-splitting line level audio on signal integrity
« on: February 07, 2024, 09:06:48 pm »
Hi

I 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?
 

Offline ataradov

  • Super Contributor
  • ***
  • Posts: 11261
  • Country: us
    • Personal site
Re: Effects of Y-splitting line level audio on signal integrity
« Reply #1 on: February 07, 2024, 09:27:29 pm »
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.
« Last Edit: February 07, 2024, 09:31:33 pm by ataradov »
Alex
 
The following users thanked this post: Zbig

Offline ZbigTopic starter

  • Frequent Contributor
  • **
  • Posts: 927
  • Country: pl
Re: Effects of Y-splitting line level audio on signal integrity
« Reply #2 on: February 07, 2024, 09:47:57 pm »
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.

Regarding 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 ;D
 

Offline ataradov

  • Super Contributor
  • ***
  • Posts: 11261
  • Country: us
    • Personal site
Re: Effects of Y-splitting line level audio on signal integrity
« Reply #3 on: February 07, 2024, 09:59:32 pm »
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.
Alex
 
The following users thanked this post: Zbig

Offline ZbigTopic starter

  • Frequent Contributor
  • **
  • Posts: 927
  • Country: pl
Re: Effects of Y-splitting line level audio on signal integrity
« Reply #4 on: February 07, 2024, 10:02:58 pm »
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.

Excellent, thank you!
 

Offline Kleinstein

  • Super Contributor
  • ***
  • Posts: 14207
  • Country: de
Re: Effects of Y-splitting line level audio on signal integrity
« Reply #5 on: February 08, 2024, 08:55:06 am »
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.
 
The following users thanked this post: Zbig

Offline magic

  • Super Contributor
  • ***
  • Posts: 6779
  • Country: pl
Re: Effects of Y-splitting line level audio on signal integrity
« Reply #6 on: February 08, 2024, 11:08:14 am »
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.
 
The following users thanked this post: Zbig

Offline ZbigTopic starter

  • Frequent Contributor
  • **
  • Posts: 927
  • Country: pl
Re: Effects of Y-splitting line level audio on signal integrity
« Reply #7 on: February 08, 2024, 11:33:23 am »
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.

Hmm... is it, though? According to https://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? ;)

« Last Edit: February 08, 2024, 11:51:24 am by Zbig »
 

Offline ZbigTopic starter

  • Frequent Contributor
  • **
  • Posts: 927
  • Country: pl
Re: Effects of Y-splitting line level audio on signal integrity
« Reply #8 on: February 08, 2024, 11:42:47 am »
Y splitters have no effect on audio signals, the ADC has two effects:

That's exactly what I wanted to hear. Dzięki! ;)

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.

Yup, that's what I was planning on: AC-coupling the signal into a voltage divider to shift it up half-wave

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.

I 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 @ataradov mentioned.

Thanks!
 

Offline magic

  • Super Contributor
  • ***
  • Posts: 6779
  • Country: pl
Re: Effects of Y-splitting line level audio on signal integrity
« Reply #9 on: February 08, 2024, 12:04:20 pm »
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.
 
The following users thanked this post: Zbig

Offline ZbigTopic starter

  • Frequent Contributor
  • **
  • Posts: 927
  • Country: pl
Re: Effects of Y-splitting line level audio on signal integrity
« Reply #10 on: February 08, 2024, 08:18:49 pm »
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:

 >:D
« Last Edit: February 08, 2024, 08:37:45 pm by Zbig »
 

Offline ZbigTopic starter

  • Frequent Contributor
  • **
  • Posts: 927
  • Country: pl
Re: Effects of Y-splitting line level audio on signal integrity
« Reply #11 on: February 25, 2024, 03:00:07 pm »
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.

I 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.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf