Author Topic: Audio output circuit - comments? + specific question  (Read 1235 times)

0 Members and 1 Guest are viewing this topic.

Offline SaimounTopic starter

  • Frequent Contributor
  • **
  • Posts: 550
  • Country: dk
Audio output circuit - comments? + specific question
« on: February 13, 2021, 03:57:41 pm »
Hi :)

I would like if possible to get some feedback about this Audio output circuit?

The requirements:
1) The output of the circuit should handle both headphones (>32Ohm) and balanced line inputs (usually around 50kOhm)
2) The output should either be Left=Right (Mono signal for headphones) or Left&Right at 180 degres out of phase (balanced mono line output)
3) Have a gain of either +8dB or -22dB (S1 is digitally controlled)

The input of the circuit is the DAC output which is very sensitive to loads, hence the first buffer.

Thank you for any feedback, and of course please ask for any questions :))

Simon

PS: I do have a specific question though:
I am playing very short sounds (like quick samples of about half a second), and in order to reduce noise, I switch off S1 right before sending the audio and switch it on right after (so the gain jumps from -22dB to +8dB and back to -22dB).
I added the C2 cap because without it there was a tiny voltage offset with Half_VCCA, which was fine but meants that there was a click sound when switching the gain.

My question is: if I play a low frequency signal, say f.x. 100Hz, it is partially filtered by C2 and R9, and it seems the voltage is not quite back at Half_VCCA when I switch the gain, that creates again a little "click" sound. Should I just "wait" a bit before switching the gain back to -22dB, or do you have any other idea? Thank you!
« Last Edit: February 14, 2021, 10:42:22 am by simonlasnier »
 

Offline Terry Bites

  • Super Contributor
  • ***
  • Posts: 2397
  • Country: gb
  • Recovering Electrical Engineer
Re: Audio output circuit - comments? + specific question
« Reply #1 on: February 13, 2021, 10:46:30 pm »
Is your switch suited to single supply operation?
What is your supply voltage?
How much power do you need in your phones?
What kind of feeble DAC are you using?
What op-amps are you using?
You are asking lot of you're op-amps. I doubt they have the output current drive you need. It would be a good idea to make the attenuator passive to reduce charge injection charge into from S1 into the summing junction of U3.2. Set a fixed gain and switch in the reduction. You need to buffer your half way point else all kinds of unintended coupling will occur. eg attached.

Do you want to switch between DAC and Line in?
« Last Edit: February 14, 2021, 02:01:37 pm by Terry Bites »
 

Offline David Hess

  • Super Contributor
  • ***
  • Posts: 16622
  • Country: us
  • DavidH
Re: Audio output circuit - comments? + specific question
« Reply #2 on: February 14, 2021, 03:29:31 am »
The only potential problem I immediately see is the input buffer.  Are you sure that the DAC output is centered close to half of the supply voltage?  And if the DAC output is AC coupled, then the non-inverting input of the buffer has no path for its input bias current.

Both problems can be solved by AC coupling the input with a high value divider to supply the input bias current.
 

Offline SaimounTopic starter

  • Frequent Contributor
  • **
  • Posts: 550
  • Country: dk
Re: Audio output circuit - comments? + specific question
« Reply #3 on: February 14, 2021, 10:37:50 am »
Thank you both for your replies! It really helps, and it gets me thinking! :)

@Terry Bites:
* I am using an analog switch IC which can handle analog signals from 0 to VCC (for example Diodes 74LVC1G3157 but any similar would work I think?). I tested it and it works.
* VCCA=3.3V
* I get about 1V RMS max with 250 Ohm studio headphones, which is already very loud. Cheap 32 Ohm ear-buds get a much lower voltage, but are also a lot more sensitive (especially on the high freqs), so also really loud.
* The DAC is a TM8211 from Titan Micro Elec (chinese brand), it is super cheap and works as long as the input buffer is there.
* Opamp is a quad package GS8634-SR from Gainsil (also chinese brand). It is a low-noise opamp.

It would be a good idea to make the attenuator passive to reduce charge injection charge into from S1 into the summing junction of U3.2. Set a fixed gain and switch in the reduction.
Sorry I really do not understand that - why do you think S1 is such an issue, when it's on it just "connects" R4 in parallel (and adds a few Ohms), or did I miss something? I do not know what "charge injection from S1" means  :-//

Do you want to switch between DAC and Line in?
My bad, I was not clear - the input is always the DAC, it is the output I want to be able to switch between headphones and balanced line output (to send it to the line input of a mixer for example). This is done by the physical SPDT switch.
 

Offline SaimounTopic starter

  • Frequent Contributor
  • **
  • Posts: 550
  • Country: dk
Re: Audio output circuit - comments? + specific question
« Reply #4 on: February 14, 2021, 10:39:35 am »

@David Hess
The only potential problem I immediately see is the input buffer.  Are you sure that the DAC output is centered close to half of the supply voltage?  And if the DAC output is AC coupled, then the non-inverting input of the buffer has no path for its input bias current.

Both problems can be solved by AC coupling the input with a high value divider to supply the input bias current.
Good point - but the DAC output is very close to the Half_VCCA, like I said it could even work without C2, but then the gain change amplifies the few mV difference and makes a little click sound when switching gain.
But I think you're right I can move the AC coupling (i.e. C2) before the input buffer, add a slight load (like 1MOhm) for the input bias current, this should solve my issue with low frequency signals as it removes the high-pass filter made by C2 and R9! I'll try it :)
 

Offline Terry Bites

  • Super Contributor
  • ***
  • Posts: 2397
  • Country: gb
  • Recovering Electrical Engineer
Re: Audio output circuit - comments? + specific question
« Reply #5 on: February 14, 2021, 03:44:32 pm »
The DAC datasheets shows an RC power filter. If you have used it, check the series resistor is correct. If it is too high the output current may be too low. This may be why you are having to use a buffer. it also suggests using an active low-pass filter. Without this you won't get a clean signal, could it be the source of your noise even. You can design a filter with 8dB of gain if needed.  * Clipboard01.jpg (149.39 kB. 1759x809 - viewed 65 times.)   Why mute to -22db exactly instead of going all the way?

The pop is probably charge injection. Google it. When the 74LVC1G3157 changes state it typically injects a 5pC charge (page 13 of datasheet) into your circuit. Q=CV so say 5pC find its way on to your op-amp input capacitance which may be in the region of 5pF and a 1V pulse appears- in theory anyway.

So it is often better to isolate the switching from the opamp. There are "clickless" audio switches available- at a price.
Improved filter1174392-1
« Last Edit: February 15, 2021, 10:13:58 am by Terry Bites »
 
The following users thanked this post: Saimoun

Offline Jan Audio

  • Frequent Contributor
  • **
  • Posts: 820
  • Country: nl
Re: Audio output circuit - comments? + specific question
« Reply #6 on: February 14, 2021, 05:52:56 pm »
U3.2 and U3.4 i would add a small capacitor from negative input to output against ringing problems.
 

Offline SaimounTopic starter

  • Frequent Contributor
  • **
  • Posts: 550
  • Country: dk
Re: Audio output circuit - comments? + specific question
« Reply #7 on: February 14, 2021, 07:16:05 pm »
Thanks Terry this helps a lot.
I did not use the RC power filter, just filter caps.
And actually I have no idea why I had in my head that the DAC could not take any loads - sorry about that - I just tested it and it handles a 18k Ohm load without problems (I literally get 0% voltage reduction).

To answer your question about the -22dB it is for 2 purposes:
* I get a bit of white noise when the +8dB gain is on. It is not loud but you can hear it when no audio is playing. When I switch the gain to -22dB it is very quiet.
* Also I control the volume digitally by reducing the bittage, and I do not want to go lower than 12bits - so my idea was:
** 16 bits = +8dB
** 15 bits = +2dB
** etc. until 12 bits = -16dB
** then I can go back to 16bits and reduce the analog volume by -22dB
** then -28dB with 15bits
** etc. until -46dB with 12 bits

Do you think adding the active low-pass filter like you presented will reduce the white noise? Or is only to improve the audio?

And thanks, I'll check charge injection, I did not know about that :)


@Jan: Thank you - actually I did notice some ringing around 2.65MHz (of about 100mV) on the output. It only appears with one pair of headphones (and I tested many) which has a long "spiraly" cable, which I guess has a lot of capacitance. Am I right that adding these would help reduce the ringing?
If say I want to cut above 100kHz, how to I get the value?
Also - why only on U3.2 and U3.4 (and not U3.3 which is also output to the left channel)?
 

Offline Terry Bites

  • Super Contributor
  • ***
  • Posts: 2397
  • Country: gb
  • Recovering Electrical Engineer
Re: Audio output circuit - comments? + specific question
« Reply #8 on: February 15, 2021, 10:28:18 am »
 Bandwidth limiting will hopefully reduce over all noise. Make sure your power supplies are properly decoupled. Check your grounding and supply arrangement for current loops.
 I have sharpened up the filter response a bit (and I forgot a resistor!). The voltage divider in your original circuit does not generate a solid reference point.
So you do need to the decouple noise and buffer this halfway voltage so that it creates low impedance. A high impedance will be very sensitive to all kinds of stray signals and this too may appear as noise and possibly ringing because it provides an unintentional feedback path.   
 

Offline SaimounTopic starter

  • Frequent Contributor
  • **
  • Posts: 550
  • Country: dk
Re: Audio output circuit - comments? + specific question
« Reply #9 on: February 15, 2021, 11:20:00 am »
I guess the resistor your forgot was R12?

Interesting point about the noise coming from the half-way point, I did not think about that.

Also, is there something missing at the bottom (next to C9)?
And about C6, any particular reason for choosing 150n (instead of 100n f.x. which is used other places as decoupling)?

Thanks
Simon
 

Offline SaimounTopic starter

  • Frequent Contributor
  • **
  • Posts: 550
  • Country: dk
Re: Audio output circuit - comments? + specific question
« Reply #10 on: February 15, 2021, 12:05:06 pm »
So I tried to put the input of the circuit to ground (instead of the DAC output), and the white noise is completely gone - so I guess the noise is coming exclusively from the DAC.

I'll try to (low-pass) filter then on the first opamp with a similar circuit to yours Terry and let you know if it helps :)
 

Offline David Hess

  • Super Contributor
  • ***
  • Posts: 16622
  • Country: us
  • DavidH
Re: Audio output circuit - comments? + specific question
« Reply #11 on: February 15, 2021, 12:51:42 pm »
So I tried to put the input of the circuit to ground (instead of the DAC output), and the white noise is completely gone - so I guess the noise is coming exclusively from the DAC.

Is the DAC part of a separate circuit?  If so then the noise might be from a ground loop and not the DAC itself.  My solution in this case has been to replace the input buffer with an instrumentation amplifier to make a balanced input with one line going to the DAC and the other line going to the DAC's ground or common, so noise from the ground loop is subtracted.
 

Offline SaimounTopic starter

  • Frequent Contributor
  • **
  • Posts: 550
  • Country: dk
Re: Audio output circuit - comments? + specific question
« Reply #12 on: February 15, 2021, 03:32:05 pm »
I did not know ground loops could create white noise :o I though a ground loop noise would be more like low-frequency noise, typically catching the AC outlet frequency 60Hz.
The DAC is not separate from the rest, the original circuit was on a PCB with DAC and opamps next to each other.

But having a switchable -22dB gain works for me, then the noise is not hearable anymore.

I also tried adding a filter, attached. I went for a Multiple Feedback instead of a Sallen-Key and I removed the input buffer (it was not needed as mentionned before).
Unfortunately the filter makes no difference to the noise, which I think makes sense since the noise I care about is in the audible range and the filter was only filtering above that.
The good thing though is that removed the 2MHz oscillations completely, even without extra caps on the two other opamps. I tried to remove C8 and R3 (shorting it), i.e. having almost the same circuit as before but with a 470pF cap between invertnig input and output of the first opamp. This also works perfectly fine, and is not ringing.

And I checked the charge injection from S1 - but when no audio is playing no click/pop is hearable at all so I think the click is related to the coupling cap and the fact the level is not "back" yet when I switch back.

I have a few general questions about opamps which I will ask in another thread. Then I'll come up with a new design :)

Thank you all
 

Offline SaimounTopic starter

  • Frequent Contributor
  • **
  • Posts: 550
  • Country: dk
Re: Audio output circuit - comments? + specific question
« Reply #13 on: February 15, 2021, 04:20:58 pm »
Actually Terry, just wondering, if I want to switch to -22dB like you suggested on your first replies (i.e. with an opamp gain of 8dB always and a passive attenuator before then opamp), then I do need two extra opamps - one for the half-way point and a buffer for the output of the DAC, correct?
 

Offline Jan Audio

  • Frequent Contributor
  • **
  • Posts: 820
  • Country: nl
Re: Audio output circuit - comments? + specific question
« Reply #14 on: February 15, 2021, 05:18:23 pm »
@Jan: Thank you - actually I did notice some ringing around 2.65MHz (of about 100mV) on the output. It only appears with one pair of headphones (and I tested many) which has a long "spiraly" cable, which I guess has a lot of capacitance. Am I right that adding these would help reduce the ringing?
If say I want to cut above 100kHz, how to I get the value?
Also - why only on U3.2 and U3.4 (and not U3.3 which is also output to the left channel)?

The ringing is called instability of the opamp : https://www.eevblog.com/forum/projects/opamp-ringing/msg2459511/#msg2459511
The ringing can apear at random if no sound plays in the opamp, any value capacitor will work,
and indeed you can calculate for a 20KHz to remove some noise.

Only 3.2 and 3.4 because you have short circuit the other 2 and it would be a useless component, pure logic.

For the frequency i made this topic : https://www.eevblog.com/forum/projects/calculate-damping-frequency/msg3457702/#msg3457702
For a 22K feedback resistor and a 350pf capacitor i use this calculation :
FreqHertz = 1 / ( 2 * 3,1416 * 22.000 * 0,000000000350 ) (EU .,)
« Last Edit: February 15, 2021, 05:24:10 pm by Jan Audio »
 

Offline David Hess

  • Super Contributor
  • ***
  • Posts: 16622
  • Country: us
  • DavidH
Re: Audio output circuit - comments? + specific question
« Reply #15 on: February 15, 2021, 05:27:16 pm »
I did not know ground loops could create white noise :o I though a ground loop noise would be more like low-frequency noise, typically catching the AC outlet frequency 60Hz.

The ground loop itself does not create any noise.  It is the return current for a different circuit which does that.  In the case of a DAC, the return currents for the digital inputs and clock and any other associated logic could be getting into the audio input from the DAC through the ground loop.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf