6
\$\begingroup\$

I'm working on a project that requires me to mix two audio signals from two sources (both on the same PCB).

Source one is an audio output coming from the the VS1053B MP3 Audio CODEC IC, and source two is the output of a DAC (MCP4921). Both these audio signals will be going into a class-D amplifier (TPA3110 from TI).

I've been doing some research, and it seems to me that in order to do this, I can either user two resistors to combine the audio signals, or I can use a summing amplifier.

What I don't understand are the pros/cons of one over the other. I would like to use two resistors since it's easier, but if this method is strongly inferior, then I may use a summing amplifier. What are the pros/cons of each method?

Using resistors: enter image description here

Using a summing amplifier: enter image description here

\$\endgroup\$
1
  • 3
    \$\begingroup\$ One small point of caution: The summing op-amp you show here will not work - the supply is wrong. The input is 0 to 3.3 V, but since it is an inverting summing op-amp the output will be -3.3 to 0 V. This means that it needs a negative supply. \$\endgroup\$
    – Frodyne
    Feb 12 at 9:40

5 Answers 5

7
\$\begingroup\$

What I don't understand is the pros/cons of one over the other.

If you use an inverting op-amp summing mixer then, because of the virtual earth, if you remove one channel input, it won't affect the amplitude of the mixer output from the other channel. With a resistive adder and no op-amp, you can't remove a channel without amplitude being affected. If this isn't a problem then use a simple resistor summing network.

\$\endgroup\$
1
  • 1
    \$\begingroup\$ Not only can one not remove an input without affecting the others, but changing the amplitude of any input will change the amplitude of the other inputs as well. Worse, if two channels are turned up, and one of them has a frequency-dependent impedance (e.g. because of a coupling cap), the other channel will see the mixer as presenting a frequency-dependent impedance as well. \$\endgroup\$
    – supercat
    Feb 12 at 15:56
4
\$\begingroup\$

The two resistor approach gives you the average of the two signals. $$ V_{out} = \frac {V_1 + V_2} 2 $$

You can see this clearly if you imagine that at some instant \$ V_1 = 1 \ \text V\$ and \$ V_2 = 0 \ \text V\$. Then R1 and R2 act as a 2:1 divider.

You'll only get half the output voltage. It does have the advantage that with both signals peaking at the same time the output will be limited and shouldn't cause clipping when fed into the following amplification stage.

As Andy points out, unplugging one input will remove the ground reference for that input and the divider effect will be eliminated and the signal level of the remaining channel will be doubled. This could be prevented (to some extent) by using a self-shorting (to ground) jack socket for the inputs.

\$\endgroup\$
2
\$\begingroup\$

Introduction

Your question is specific and you got good specific answers that will help you solve the problem. But I suggest you take another step further to realize the "philosophy" of these famous circuits. Then you will not only know how to use them, but also really understand them.

To do this, I suggest revealing the ideas behind these circuits by doing a number of experiments. Only two of them (framed in black) are your practiсal circuits; the others (framed in pale gray) are more abstract and only help to understand the ideas.

Are passive and active circuits related?

I can either use two resistors to combine the audio signals, or I can use a summing amplifier.

Both circuits solve the same problem - summing voltages, but while the first is passive, the second is active. At first glance, they are different. But if you look carefully at the second circuit diagram, you will see that it contains the first one (the R1-R2 network); just another op-amp and resistor are added. This leads us to think that somehow the passive circuit has become active, or that the active circuit is an improved passive circuit. If we find out what this "magic" way is, we will be able to convert any passive circuit into an active one!

Passive summer

The simplest way to sum voltages is according to Kirchhoff's voltage law by connecting the sources in series (without any resistors). The problem is that the output voltage is "floating" (not relative to ground). That is why the alternative way by summing currents according to Kirchhoff's current law has been imposed.

Full circuit

To implement it, we can convert the input voltages (Vin1 and Vin2) by resistors (R1 and R2) into input currents (Iin1 and Iin2), and sum the latter. The output voltage Vout appears at the midpoint between the two resistors. As you can see, it is a 0.5 weighted sum of the two input voltages (you can calculate it by applying the superposition principle).

Note that the same current Iin1 = Iin2 flows through both sources in the direction from Vin1 (the higher voltage) to Vin2 (the lower voltage). It looks like one current is input and the other is output, which is a bit confusing. So, the input sources must be bilateral (pass current in both directions).

schematic

simulate this circuit – Schematic created using CircuitLab

Vin2 disconnected

As mentioned in other answers, if we remove one of the sources (e.g. V2), the weight factor of its other input changes (from 0.5 to 1), and this is a problem. There is no current flowing.

schematic

simulate this circuit

Loaded

Another problem appears if we connect a load to the output (I have simulated it in the schematic below by decreasing the voltmeter's resistance RL to 1 kΩ). It decreases the equivalent resistance (R1||R2||RL), the input weight factors ("gains") and the output voltage. Now there is a true output current IL through the load but there is no Iin2 input current in this specific case (since VL = Vin2).

schematic

simulate this circuit

The main problem

The networks Vin1- R1, Vin2-R2 and why not RL can be thought as imperfect current sources that "like" to be short connected (zero output voltage). Only then can they individually set their currents (Iin1 = Vin1/R1 and Iin2 = Vin2/R2).

So the main problem of the passive resistor summer is that its output voltage is non-zero.

Short connected

Can't we just shorten its output? In the schematic below, the middle point is connected to the real ground (RG) through an "ideal" ammeter; the "unwanted" voltage is gone and the input currents are exactly Vin/R.

schematic

simulate this circuit

How to destroy the "undesired" voltage

The problem, however, is that we need this voltage since it is the circuit output voltage. So we have to destroy it but have a "copy" of it.

For this purpose, we can add another input of the summer to which we can apply (through another resistor) a voltage equal to the output but with the opposite polarity. As a result, the output voltage will be zero, and we can use the new input voltage as output.

Negative-feedback summer

This is usually done using the so-called "negative feedback". Since the name does not tell us much, let's first do it the way they would have done it back in the 19th century.

"Man-controlled summer"

Following the recipe above, we connect a variable "input" voltage source Vout through a resistor R3 to the common point and also a grounded null indicator NI (sensitive voltmeter).

schematic

simulate this circuit

Next, we adjust Vout so that NI shows zero voltage (the so-called virtual ground). When we are done, Vout shows the exact sum of Vin1 and Vin2.

Note that Vout is negative when the input voltages are positive. This is because Vout must be added to them when travelling the input loops (- +, - +).

With behavioral voltage source

Unloaded: The summer above is perfect but we have to do this routine work. However, human beings are lazy by nature and look for someone to do this work :-) We are no exception and so we decide to outsource it to a behavioral voltage source VA from the CircuitLab library. Simply put, this is an abstract voltage amplifier (a prototype of the future real op-amp) with a gain of 100,000.

schematic

simulate this circuit

Now the "conceptual op-amp" adjusts Vout so that NI shows zero voltage.

Loaded: If we connect a load RL to the VA output, nothing changes since VA provides a current for the load.

schematic

simulate this circuit

Op-amp inverting summer

Practical circuits are implemented using an op-amp. It does exactly the same as the conceptual circuits above do, only faster.

Full circuit: I have left the zero indicator just for us; the op-amp does not need it.

schematic

simulate this circuit

Vin2 disconnected: the result is the same as in the Schematic 1.2 above.

schematic

simulate this circuit

No feedback summer

Although the principle of negative feedback is dominant, it is possible to achieve the same goal (Vout = 0 V) without it. Here are some more extravagant circuit solutions to get our imaginations going.

Negative-resistor summer

If we look more closely at the R3-Vout network, we will notice that the two elements are as if "mirrored" - R3 subtracts a voltage drop VR3 while Vout adds voltage VR3. This means that Vout acts as a negative R3 resistor.

I was pleasantly surprised to see that CircuitLab supports negative resistances. So we can simulate this arrangement by connecting a -1 kΩ negative resistor -R3 in series to the positive resistor R3; the result is zero resistance ("piece of wire") between the midpoint and ground.

schematic

simulate this circuit

But how do we implement a negative resistor?

With behavioral voltage follower

We can do it by a behavioral voltage source that copies the voltage drop VR3 and inserts it in series to VR3.

schematic

simulate this circuit

With op-amp voltage follower

The practical circuit can be implemented by an amplifier with a fixed gain of 1 (voltage follower). Because there are not such a device in the CircuitLab library, I have reduced the gain of a conventional op-amp.

schematic

simulate this circuit

\$\endgroup\$
1
\$\begingroup\$

A resistive mixer used directly on the input has a few downsides.

  • The mixing ratio depends on the impedance of the sources. Essentially the impedance of each source adds to the resistors in the mixer.
  • Assuming the two sources are identical and low impedance, the "gain" is 0.5. This may or may not be desirable.
  • It does not provide good isolation between the inputs. This can be a problem if one signal source is fed to multiple mixers. It can also be a problem if one source generates a signal that is too strong for another source to tolerate.
  • Adjusting the resistance for one source affects the contribution of all sources to the mixed result. In particular if you disconnect one source from a 2 input equal mixer you will double the level of the other source.

For these reasons, I would not use a resistive mixer directly on the input of a piece of equipment I was designing.

A summing amplifier would avoid all of these problems if the op-amp were ideal, but the op-amp is not ideal. It will have limitations which will lead to the virtual ground not being a perfect ground and in turn to the isolation between inputs not being perfect. Having said that, provided the op-amp doesn't saturate the isolation would likely be better than a resitive mixer.

Another option is to use a resistive mixer, but buffer the signals first. This provides the best isolation between inputs and is what I would probably do if designing a device with externally accessible inputs.

But that is not what you are doing, you are mixing signals from internal sources, you can read their electrical characteristics and determine if there is likely to be a problem.

\$\endgroup\$
0
\$\begingroup\$

If you can, buffer both outputs with a unity gain opamp. No influence removing one input, deterministic bandwidth.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.