inverting opamp question

Started by JP19, March 23, 2022, 04:24:47 PM

Previous topic - Next topic

JP19




Hi, Can someone please school me on this?  I know how to calculate the gain of a simple inverting opamp arrangement, but how do I figure out the gain in a situation like this where 2 signals are being mixed?

Pic taken from pedalpcb arachnid.

Thanks

antonis

#1
Consider Vref as AC ground and also "hidden" C6 & C11 legs going to ground (especially if they come out of op-amp output..)

Equivalent resistance should be set as denominator into gain formula..
(4k28 for Blend pot set midway..)


P.S.
That particular configuration exhibits DC gain flaw.. :icon_wink:

"I'm getting older while being taught all the time" Solon the Athenian..
"I don't mind  being taught all the time but I do mind a lot getting old" Antonis the Thessalonian..

Rob Strand

#2
When you get complex circuits you can often simplify things and decompose the circuit into things you know.


1) Simplify the circuit.

You start with some mental gymnastics bending the circuit into something simple

First realize the two input paths have the same gain when the Mix pot is centered.  Also, you only need to analyse the gain of one side.

As far as each arm is concerned the 10k Mix pot looks like a 5k resistor to ground on each side, which connects between the two 15k resistors.

The virtual ground at the point where R20 and R21 join, and the ground between at the wiper of the Mix control, makes the to input paths completely independent of each other.   That means you only need to analyse one path and you can ditch the rest of the circuit.

What you are left with is *one input* feeding a T shaped resistor network consisting of R4 15k, half of the mix pot to ground 5k (I'll call that Rg), then R20 15k to the opamp input.

2) Decompose the circuit into things you know.
We know about voltage dividers and we know that the gain of an inverting stage is -Rf/Rin.
We can't apply those directly at the moment.

There's more than one way to decompose circuits.  One way is no more correct than another.  It comes does to what you personally are more comfortable with.

The following analysis uses simple ideas and does not require Thevenin equivalent circuits.

2.1) Suppose were try to find the voltage Vx at the point in the T where R4, R20 and Rg join.
The right side of R20 is a virtual ground so it looks grounded.

Recognize that R4 (15k) and Rg (5k) form a voltage divider to ground but R20 loads down the divider.  In fact to find Vx
we need to treat both R20 and Rg in parallel.  So we have a voltage divider with,
   Input resistor  = R4 = 15k, and
   Output resistor = R20 in parallel with Rg = 15k // 5k = 3.75k

The voltage divider division ratio is,

Vx / Vin   =   3.75k / (3.75k + 15k) = 0.2

Now we can treat the inverting opamp as a simple inverting opamp stage with input Vx,

Vo / Vx  = -  Rvolume / R20                ; inverting opamp gain = -Rf / Rin

When the volume pot is at full gain Rvolume = 100k, so,

Vo / Vx  = - 100k / 15k = 6.67

Finally we combine the dividing effect of the Mix pot and the gain of the inverting stage with loss in the voltage divider.

Vo / Vin  = - (Vx / Vin) * (Vo / Vx)
            = - 0.2 * 6.67
            = - 1.334

So you can see we get the answer using very simple electronics analysis ideas but you need to bend the circuit around up front.   That's not hard but it needs to be done in a few steps.   The most important step would be to recognize the voltage divider is loaded by R20 (newbies might leave that off and get a close but incorrect answer).
Send:     . .- .-. - .... / - --- / --. --- .-. -
According to the water analogy of electricity, transistor leakage is caused by holes.

antonis

How did we come into different result by implementing the same analysis, Rob..?? :icon_eek:
(either my mobile phone calculator is out of order or my finger press wrong keys..)
"I'm getting older while being taught all the time" Solon the Athenian..
"I don't mind  being taught all the time but I do mind a lot getting old" Antonis the Thessalonian..

Rob Strand

#4
QuoteHow did we come into different result by implementing the same analysis, Rob..?? :icon_eek:
(either my mobile phone calculator is out of order or my finger press wrong keys..)
I'm not immune to mistakes either.  In my post there's only one step which does a resistance calculation and it looks OK to me.   Maybe just run the numbers again.

(The keys on my calculator are *very* hard to press and I find I have to do things twice to make sure something hasn't stuffed up.   I should get a new one ;D.)
Send:     . .- .-. - .... / - --- / --. --- .-. -
According to the water analogy of electricity, transistor leakage is caused by holes.

PRR

Quote from: JP19 on March 23, 2022, 04:24:47 PM... how do I figure out the gain in a situation like this where 2 signals are being mixed?

What is "gain"? From one input? From two identical inputs? From two different inputs?

Sanity suggests setting one input to zero (perhaps grounding it) and then working-out the gain for the other input.
  • SUPPORTER

JP19

Thanks everyone! There's a bit to digest there but it all makes sense broken down into smaller bits.  :icon_biggrin:

iainpunk

friendly reminder: all holes are positive and have negative weight, despite not being there.

cheers

Rob Strand

#8
If you want another way to do it that needs a little more knowledge.

2.2) Using:  Y to Delta Transformation

This method does part 2 in one step.  You still need do the mental gymnastics of "part 1".

https://www.allaboutcircuits.com/textbook/direct-current/chpt-10/delta-y-and-y-conversions/

The idea is the T network of resistors (R4, Rg, R20) can be transformed into a three resistors connected in
the shape of a delta.   These transformations are *exact* you can't tell what the connection is by measuring
the three terminals.   (Note: in the literature the terms T and Y get used in different contexts but they are essentially the same.)





If you imagine the T (RA=15k, RB=5k, RC=15k) being replaced by a delta you get RAC from the input signal to the opamp - input.  That is simply the Rin on the inverting opamp circuit.   The tricky thing to recognize in this method is RAB appears across the input signal, it loads the input but has no effect on the gain.  Perhaps the trickiest part is RBC can be completely ignored as it appears across the opamp inputs.   What that means is we only need to calculate RAC,

RAC = (RA RB + RA RC + RB RC) / RB = (15k * 5k + 15k * 15k + 5k * 15k) / 5k = 75 k ohm

Rac is like Rin on the inverting opamp configuration so,

gain = - Rf / Rin  = - Rpot / RAC  = -100k / 75k = 1.333

Exactly the same answer as before.

Sometimes methods using delta-Y and Y to delta transformations are very handy.
For newbies I'd say you should try to stick with method 2.1 as the ideas are much simpler.
Send:     . .- .-. - .... / - --- / --. --- .-. -
According to the water analogy of electricity, transistor leakage is caused by holes.

antonis

I suspect JP19 should regretted his query by now.. :icon_redface:
"I'm getting older while being taught all the time" Solon the Athenian..
"I don't mind  being taught all the time but I do mind a lot getting old" Antonis the Thessalonian..

ElectricDruid

I like Rob's simple way best. Summarised as:

R4 and half the mix pot make a voltage divider. The lower half of this is parallelled by R20, so its resistance is *less* than the obvious 5K - in fact it's 3.75K (5K || 15K = 3.75K). So the voltage at the junction of the two 15K resistors is only 3.75/(15+3.75) = 1/5th of the input voltage.

The second 15K resistor and the 100K volume pot are a standard inverting amp, so the gain there is 100/15=x6.67.

Combining the loss in the divider with the following make-up gain in the amp gives an overall gain of (technically) a-bit-over-one! (6.67/5=x1.34)

Vivek

Thanks to all for this mathematical discussion

I'm in the midst of designing some FV-1 stuff, and might need stereo external dry/wet blend. This could be good starting point since many FV-1 boards have similar mixing architecture

antonis

For argument sake, one could face it like 2 parallel branches,each one consisting of 15k(R20 or R21) in series with 15k(R4 or R19)//5k(MIX/2)..
Equivalent resistance shoud be Rin (for signals in absolute phase) which (falsely) should be 9k375..

P.S.
Of course, Rob is right about inverting input virtual ground, hence R20 ( R21) voltage dividing effect but, IMHO, it's abit hard to realize the global perception from an elementary analysis point of view..
"I'm getting older while being taught all the time" Solon the Athenian..
"I don't mind  being taught all the time but I do mind a lot getting old" Antonis the Thessalonian..

Vivek

LTSPICE reconfirms max Gain of 1.33 with Wet/dry mix 10k pot  at mid point, Gain 100K pot at max

Gain of 1.90 with Wet/Dry mix fully to one side, Gain 100K pot at max

(Assuming input voltage source has zero output impedance)


Rob Strand

#14
QuoteLTSPICE reconfirms max Gain of 1.33 with Wet/dry mix 10k pot  at mid point, Gain 100K pot at max

Gain of 1.90 with Wet/Dry mix fully to one side, Gain 100K pot at max

(Assuming input voltage source has zero output impedance)
Yes, the gain increases when you move the Mix control off-center.   The basic calculation doesn't change for either method.  You just need to set the resistance of the "leg of the T" to match  (Rg in first set of calcs) the Mix pot setting.

The bigger question is what's the meaning of that.    There was a discussion on this some years ago.  There are cases where you want the perceived level to remain the same at all Mix control settings.   That only makes sense if the level going into each input is the same in the first place.  [Not sure how hard it will be to find the thread.]

Maybe this thread?  I actually I thought I put up some spice sims (maybe the image links point to the old image service).  The Peavey link with the pics no longer works and isn't on archive.
https://www.diystompboxes.com/smfforum/index.php?topic=118967.0

In that thread,
"For circuit D you can get a rough approximation to constant power when the 4x input resistors are 1.5 times the pot values (IIRC you need a feedback resistors 7.5 times the pot value for unit gain at the centre position).   This is a very common circuit."
Notice for the circuit in the current thread the resistors are 15k and the Mix pot is 10k which follows the constant power case 15k/1.5 = 10k.

Constant power mixing make sense when you have two signals which are the same level but the signals aren't correlated.  If you put the same signal into each input then they *are* correlated and you would hear the extra gain as you moved the Mix control.  On the other hand if the two signals are uncorrelated noise sources then the perceived level would be (roughly) equal.

Send:     . .- .-. - .... / - --- / --. --- .-. -
According to the water analogy of electricity, transistor leakage is caused by holes.

Vivek

I thought

If same volume signals on both inputs

1.33 + 1.33 = 2.66 output with mix pot at centre

1.9 + 0.0 = 1.9 output when pot on one extreme

Rob Strand

#16
QuoteI thought

If same volume signals on both inputs

1.33 + 1.33 = 2.66 output with mix pot at centre

1.9 + 0.0 = 1.9 output when pot on one extreme
That's when the input signals are corellated.
When the two inputs are uncorellated (like independent noise sources) the case where the two signals adds is,

Vout centered = sqrt(1.33^2 + 1.33^2) = sqrt(2) * 1.33 = 1.88

and you can see that's close to the case where the pot is at one extreme.

The underlying message is not all mixers are alike and there is a 'more correct' mixer depending on what signals are being mixed.   In practice the signals will be between the correlated and non-correlated cases. This is why the mixer on a Phaser/Chorus/Flanger needs some tweaking if you really want the levels to be the same.

See for example,
http://www.sengpielaudio.com/AddingAmplitudesAndLevels.pdf
Send:     . .- .-. - .... / - --- / --. --- .-. -
According to the water analogy of electricity, transistor leakage is caused by holes.

Vivek

Rob, the Arachnid normally runs chorus, delay, phaser, flanger, reverb programs

And this circuit snippet blends the wet with dry

Is there a better way to mix, to have perceived similar volume while adjusting the blend pot ?

Rob Strand

#18
QuoteRob, the Arachnid normally runs chorus, delay, phaser, flanger, reverb programs

And this circuit snippet blends the wet with dry

Is there a better way to mix, to have perceived similar volume while adjusting the blend pot ?
It's while since I've gone through the fine details but here's the general idea.

The thing to keep in mind is there is no perfect solution.  Imagine a 1s delayed signal being added back to the original signal.   Your brain can separate out the delayed signal.   So you would want it to have gain of 1 for dry and gain of 1 for centred (on *each* input) and gain of 1 for effect only.   That's going to be quite different to the chorus case.

For a chorus, imagine setting the signal to clean only and the gain is 1.   When you set it signal to the delayed path only you get a Vibrato effect and you also want gain 1.   When you mix the two signals equally is the tricky case.  What I find in practice is equal level is when the gain (on *each* input) is somewhere in 0.8 to 0.9 region perhaps err'ing towards 0.9.    So that means for example we want about 1dB to 2dB lower gain in the center position compare to the extremes.    Just to be clear, the overall gain can be scaled up and down what we want is 1dB drop in gain at the center position compared to the extreme.

For the circuit in this thread the gain at one extreme is 1.9 but the gain in the center is 1.33, which is 3dB.   The general behaviour is correct but the effect is too strong.  If we make the ratio of the 15k's smaller compare to the 10k
mix pot it should weaken the effect.    For example R = 27k (from 15k) and Rmix = 47k (from 10k) then the center gain is 1.16 and the extreme gain is 1.44.  Now the center is -1.88dB lower than the extreme.

That's still not the end of the story!   IIRC, what happens when you make the mix pot too high is there is a larger "dead zone" in the center of the mix pot.    It's a while since I've looked at this deeply but I seem to remember trying to "fix" things any more than about 2dB creates this dead zone.
(If you want try a spice sim with different mix pot positions.)


FWIW, I think my calculation is off.  I might have used Rmix and not Rmix/2 in the calculations.  Need to check later.
The ideas I mentioned still hold.
Looks ok.
Send:     . .- .-. - .... / - --- / --. --- .-. -
According to the water analogy of electricity, transistor leakage is caused by holes.

Vivek

Rob, would a different circuit architecture lead to better blend results ?

Like maybe ganged pots ?

MN ?

(I have always appreciated your mathematical posts !

Thanks! )