EEVblog Electronics Community Forum

Electronics => Projects, Designs, and Technical Stuff => Topic started by: supershirobon on November 27, 2018, 07:46:37 pm

Title: Active audio mixer design & Op-Amp considerations
Post by: supershirobon on November 27, 2018, 07:46:37 pm
Hello all,

I'm designing an active audio mixer circuit so I can combine the outputs from my mp3 player and phone so I can stream news in my car while playing music in the background. These aren't for driving headphones, but powered speakers which take line input.

The idea is to mix the left channels of both streams and the right channels of both steams to create a stereo output.
Basically Output Left = (Left 1 + Left 2), and Output Right = (Right 1 + Right 2).

I'm going to power it with 5V from a USB cable so I'm using a single supply design. The 5V from USB is a requirement I can't change.
Basically it's just 2 separate summing amplifiers for the left and right of each input, with three 2-gang potentiometers for the 2 input channels, and master volume for the output.

Attached is the circuit for just the left channel, but it will be duplicated for the right channel as well.
R2 and R7 are 50K Logarithmic pots so I can change the volume of each stream, R13 is a 100K Logarithmic pot for master volume, C3 is an optional capacitor which forms a low pass filter with 1dB BW around 20kHz when the pot R13 is maximum at 100K, with larger bandwidth at lower values of R13, and will be connected to a switch to disconnect/connect it if desired.

I've designed the circuit to work with a max 5Vpp input signal, using R2 and R7 values of at least 33K the opamp is guaranteed to never saturate, but that's in the worst case. The headphone output on my phone is max 1.4Vpp and mp3 player is max 2Vpp.


I've ran several tests in simulation, and everything seems alright. I get the desired output across the whole 20-20kHz range, and don't see any blatant problems.



One possible concern is the slew rate of the opamp, it's only 0.4V/us, but in my calculation it can still handle a 22kHz 2Vpp output with room to spare, so I don't necessarily think it should be a problem.

If it is a problem, what are recommendations for an op-amp that works well for audio purposes with a single supply at 5V and can get pretty close to the rails (at least 0.5V or so from the rails)? Preferably one from Analog Devices/Linear, but not necessary.


I would just appreciate another set of eyes to look over it, and maybe to point out something that I'm missing or forgot to consider, or any possible changes to make. Thanks!
Title: Re: Active audio mixer design & Op-Amp considerations
Post by: Audioguru on November 27, 2018, 07:59:03 pm
The supply Vp needs a capacitor to ground to prevent the opamp from oscillating, and the junction of R8 and R9 also needs a capacitor to ground to prevent the opamp from outputting noise on the USB supply.

I use audio opamps that work well with a supply voltage higher than 5V since line levels are very near 5Vp-p.
Title: Re: Active audio mixer design & Op-Amp considerations
Post by: DaJMasta on November 27, 2018, 09:26:44 pm
I'm.... very confused by your circuit.  Were is the output?  If it's just before the 10k resistor, your signal is going to be 10x attenuated from the output of the opamp with very little drive capability.

Additionally, because of the attenuation configuration of the amplifier and the very low drive capability, the circuit is effectively the same as two resistors combining the inputs and a filter cap before the output, so why not do that?  If you want higher drive capability maybe a resistive divder on each input into a summing amp in unity gain configuration and a cap for a low pass filter as needed?  Then your output resistor is just enough to keep within the current supply capability of the opamp.

Also worth mentioning that the LT1006 says that running from a 5V supply, you can only use about 0V to 3.5V for signal, as it's not a rail-to-rail opamp.  That means the half way biasing of both inputs puts it at 2.5V as the virtual ground, which gives you only a 1V swing in either direction as your dynamic range.  If you center it around 1.75V or so with your dividers (and, if you're still using the opamp, on the noninverting input bias divider), then you get the full 3.5V dynamic range instead of the 2V dynamic range in the current configuration.  A resistive divider on the input could take a 5V input signal and make it level appropriate, but you could also look for a rail-to-rail opamp or a larger voltage supply to deal with the large input signal.
Title: Re: Active audio mixer design & Op-Amp considerations
Post by: supershirobon on November 28, 2018, 12:31:11 am
The supply Vp needs a capacitor to ground to prevent the opamp from oscillating, and the junction of R8 and R9 also needs a capacitor to ground to prevent the opamp from outputting noise on the USB supply.

I use audio opamps that work well with a supply voltage higher than 5V since line levels are very near 5Vp-p.

Thanks for the reply.

I'm a little confused about the line level being very near 5Vpp. At least according to

https://en.wikipedia.org/wiki/Line_level

For consumer level audio is says max Vpp is 0.894V and 3.472Vpp for professional level. I figured all my equipment is consumer level so I was aiming for around those levels.
Title: Re: Active audio mixer design & Op-Amp considerations
Post by: supershirobon on November 28, 2018, 01:19:31 am
I'm.... very confused by your circuit.  Were is the output?  If it's just before the 10k resistor, your signal is going to be 10x attenuated from the output of the opamp with very little drive capability.

Additionally, because of the attenuation configuration of the amplifier and the very low drive capability, the circuit is effectively the same as two resistors combining the inputs and a filter cap before the output, so why not do that?  If you want higher drive capability maybe a resistive divder on each input into a summing amp in unity gain configuration and a cap for a low pass filter as needed?  Then your output resistor is just enough to keep within the current supply capability of the opamp.

Also worth mentioning that the LT1006 says that running from a 5V supply, you can only use about 0V to 3.5V for signal, as it's not a rail-to-rail opamp.  That means the half way biasing of both inputs puts it at 2.5V as the virtual ground, which gives you only a 1V swing in either direction as your dynamic range.  If you center it around 1.75V or so with your dividers (and, if you're still using the opamp, on the noninverting input bias divider), then you get the full 3.5V dynamic range instead of the 2V dynamic range in the current configuration.  A resistive divider on the input could take a 5V input signal and make it level appropriate, but you could also look for a rail-to-rail opamp or a larger voltage supply to deal with the large input signal.


Hi, thanks for responding.

When you mention drive capability, are you talking about current the opamp can source/the short circuit current? If that's the case then I don't think it should be a problem. I am not driving headphones or speakers directly, but a line input, which supposedly has an input impedance of 10K, so even in the worst case it should never have to source more than a few hundred microamps, which it can.

The output is before the 10K resistor since Line In has an input impedance of 10K typically, according to wikipedia.

I know the output is going to be attenuated. The R13 is a 100K pot so it forms a voltage divider with the 10K input impedance of the Line In, so you can scale the output, which should act as changing the volume. Also R2 and R7 on the inputs are 50K pots used to change the volume of each channel. I realized I should change the 1K resistors to 10K since in case when the pots are at their minimum resistance I don't want the circuit to try amplifying each input by 10x.

Wikipedia says the Max Vpp for consumer level Line Level audio is 0.894 volts. If the mp3 player and phone are at max volume, with 2Vpp and 1.4Vpp respectively on their headphone outputs (which are the inputs to the summing amplifer), and both pots R2 and R7 are at 33K arbitrarily, and the R13 pot is at 0, then the output will be around 1.1Vpp, which should saturate the line level and cause clipping. Using the R13 pot, at its max resistance of 100K the Peak to Peak amplitude of the output will then be 10x less, around 110mVpp. Using the pot you can adjust it to any level between 110mVpp and 1.1Vpp to change the volume, or keep it at a fixed value and raise the volume externally on the speaker set.

I appreciate the comments regarding the LT1006. I'm definitely going to find a new opamp.
Title: Re: Active audio mixer design & Op-Amp considerations
Post by: DaJMasta on November 28, 2018, 03:15:54 am
Ok, but that doesn't really explain my confusion: why this circuit over two variable resistors in series with the inputs, joined, and a capacitor to form a low pass filter on to the output (maybe series resistors for each channel, maybe a load resistor on the output)?  Why use an active circuit at all when it can be done with passives?

You're taking a higher voltage, probably higher current input signal and outputting a much smaller signal, so unless you have some additional active filter stage or a requirement for high output current (which is entirely negated by the 100k resistor), why bother?  Best I can tell, with a little divider adjustment for better set bias voltage and some decoupling caps and it will function, but why?  Are the inputs very low current sources?
Title: Re: Active audio mixer design & Op-Amp considerations
Post by: supershirobon on November 28, 2018, 06:13:16 am
Ok, but that doesn't really explain my confusion: why this circuit over two variable resistors in series with the inputs, joined, and a capacitor to form a low pass filter on to the output (maybe series resistors for each channel, maybe a load resistor on the output)?  Why use an active circuit at all when it can be done with passives?

You're taking a higher voltage, probably higher current input signal and outputting a much smaller signal, so unless you have some additional active filter stage or a requirement for high output current (which is entirely negated by the 100k resistor), why bother?  Best I can tell, with a little divider adjustment for better set bias voltage and some decoupling caps and it will function, but why?  Are the inputs very low current sources?

Hi,

I see what you mean now. I considered a passive mixer, but aren't there disadvantages to those quality wise? Most notably crosstalk between the channels? A passive mixer will create a voltage divider across both inputs, so in addition to driving the line-in, they will also drive eachother.

Assuming 120 \$\Omega\$ output impedance of the headphone drivers, two 1K resistors for mixing and the simple case of 1V for one input and the other input off, you can calculate that the node for the second output will be driven to around 50mV, which only yields ~26dB isolation between the channels.

Having a virtual ground summing amplifier alleviates the issue of the two inputs driving each other since the output of the mixing is essentially constant as guaranteed by virtual ground. In my simulation at 1Vpk 440Hz, there is ~400nVpk on Vtest, which yields ~128dB isolation. Across the whole audio spectrum the simulation yields >95dB isolation. I've attached a photo.

Granted, such an increase in isolation may not have much of a practical purpose  :-//

Title: Re: Active audio mixer design & Op-Amp considerations
Post by: Zero999 on November 28, 2018, 11:05:20 am
I agree that passive mixing should work in this case, as attenuation is the desired outcome.

I would have thought the headphone drivers would have a lower impedance than 120R: where did you get that figure from?

Are the outputs driving anything else? If not, then cross-coupling isn't an issue.
Title: Re: Active audio mixer design & Op-Amp considerations
Post by: David Hess on November 28, 2018, 02:47:10 pm
The increased isolation from using an active mixer is usually irrelevant.  What might matter is the lower input impedance of a passive mixer but this is not a problem with low impedance outputs intended to drive headphones or a speaker.  A pair of resistors for each channel between 120 and 470 ohms will work fine.
Title: Re: Active audio mixer design & Op-Amp considerations
Post by: Bassman59 on November 28, 2018, 04:21:48 pm
If it is a problem, what are recommendations for an op-amp that works well for audio purposes with a single supply at 5V and can get pretty close to the rails (at least 0.5V or so from the rails)? Preferably one from Analog Devices/Linear, but not necessary.

I know you asked for an ADI/Linear part, but I used the TI OPA2365 (http://www.ti.com/product/OPA2365) in a bus-powered USB audio design and it worked well. TI has a simulation models that works with LTSpice, if that's your concern.
Title: Re: Active audio mixer design & Op-Amp considerations
Post by: supershirobon on November 28, 2018, 08:04:01 pm

I would have thought the headphone drivers would have a lower impedance than 120R: where did you get that figure from?


IEC set a recommended headphone amplifier output impedance of 120 a while ago. Apparently these days most amplifiers have an output impedance less than 50 or so, but for the worst case I figured 120 is the highest, but probably still used somewhere, impedance.
Title: Re: Active audio mixer design & Op-Amp considerations
Post by: supershirobon on November 28, 2018, 08:05:32 pm
If it is a problem, what are recommendations for an op-amp that works well for audio purposes with a single supply at 5V and can get pretty close to the rails (at least 0.5V or so from the rails)? Preferably one from Analog Devices/Linear, but not necessary.

I know you asked for an ADI/Linear part, but I used the TI OPA2365 (http://www.ti.com/product/OPA2365) in a bus-powered USB audio design and it worked well. TI has a simulation models that works with LTSpice, if that's your concern.

That's great actually, thanks! I'll definitely look into it.
Title: Re: Active audio mixer design & Op-Amp considerations
Post by: supershirobon on November 28, 2018, 08:08:37 pm
The increased isolation from using an active mixer is usually irrelevant.  What might matter is the lower input impedance of a passive mixer but this is not a problem with low impedance outputs intended to drive headphones or a speaker.  A pair of resistors for each channel between 120 and 470 ohms will work fine.

Thanks for the reply. Also based off other people's responses I'll probably go with a passive design instead then if it doesn't make much of a difference.
Title: Re: Active audio mixer design & Op-Amp considerations
Post by: David Hess on November 28, 2018, 09:52:49 pm
IEC set a recommended headphone amplifier output impedance of 120 a while ago. Apparently these days most amplifiers have an output impedance less than 50 or so, but for the worst case I figured 120 is the highest, but probably still used somewhere, impedance.

Modern headphone amplifier designs tend to be from zero to 10 ohms maximum.  The only reason an output series resistance is included is to prevent oscillation with difficult loads like cable which can have 10s of picofarads per foot of capacitance.
Title: Re: Active audio mixer design & Op-Amp considerations
Post by: Audioguru on November 28, 2018, 11:00:46 pm
Wikipedia says the Max Vpp for consumer level Line Level audio is 0.894 volts.
No, they say 0.894V p-p is the nominal consumer line level. The nominal level is a timed average with loud peaks frequently exceeding the nominal level. The peak levels are determined by the crest factor that they do not say. I think a crest factor of 12dB (4 times) is common but it could be more. 4 x 0.894V= 3.58V p-p which is very close to the 5V power supply you are using if the opamp is not rail-to-rail. Clipping sounds baaaad! (But sounds good for acid rock).   
Title: Re: Active audio mixer design & Op-Amp considerations
Post by: supershirobon on December 01, 2018, 07:39:16 pm
Wikipedia says the Max Vpp for consumer level Line Level audio is 0.894 volts.
No, they say 0.894V p-p is the nominal consumer line level. The nominal level is a timed average with loud peaks frequently exceeding the nominal level. The peak levels are determined by the crest factor that they do not say. I think a crest factor of 12dB (4 times) is common but it could be more. 4 x 0.894V= 3.58V p-p which is very close to the 5V power supply you are using if the opamp is not rail-to-rail. Clipping sounds baaaad! (But sounds good for acid rock).

Ah, I see now. Thanks!