Author Topic: Op-amp circuit for left-right to mid-side audio convertor  (Read 6671 times)

0 Members and 1 Guest are viewing this topic.

Offline obiwanjacobiTopic starter

  • Frequent Contributor
  • **
  • Posts: 988
  • Country: nl
  • What's this yippee-yayoh pin you talk about!?
    • Marctronix Blog
Op-amp circuit for left-right to mid-side audio convertor
« on: March 25, 2015, 09:35:04 am »
I want to try to build a op-amp circuit to split a left-right stereo audio line signal into a common component (mid: common between L+R) and a signal that contains the difference between L+R (side).

I think I could easily accomplish this with some op-amps. The side (difference) is easy I think because op-amps can do this naturally (inverting and non-inverting inputs). However I can't seem to figure out how to get the signal that is common to both L+R (mid). I first thought a summing/mixing circuit would do it, but that would simply mix in both differences of L+R...

Can someone point me in the right direction please?
I am not necessarily looking for a complete answer.

Thanx,
Marc
Arduino Template Library | Zalt Z80 Computer
Wrong code should not compile!
 

Offline techricky

  • Contributor
  • Posts: 14
Re: Op-amp circuit for left-right to mid-side audio convertor
« Reply #1 on: March 25, 2015, 09:54:05 am »
Mid in M-S audio is indeed just the sum of left and right signals
 

Offline obiwanjacobiTopic starter

  • Frequent Contributor
  • **
  • Posts: 988
  • Country: nl
  • What's this yippee-yayoh pin you talk about!?
    • Marctronix Blog
Re: Op-amp circuit for left-right to mid-side audio convertor
« Reply #2 on: March 25, 2015, 10:02:24 am »
it is...  ???

ah, and the differences cancel each other out... of course.  ;D

Thanx!
Arduino Template Library | Zalt Z80 Computer
Wrong code should not compile!
 

Offline Rerouter

  • Super Contributor
  • ***
  • Posts: 4694
  • Country: au
  • Question Everything... Except This Statement
Re: Op-amp circuit for left-right to mid-side audio convertor
« Reply #3 on: March 25, 2015, 10:40:18 am »
i had a good attempt at it, but couldn't think up anything, i was trying to subtract the difference from the original source, but somehow that failed and instead removed one channels influence for unknown reasons,
 

Offline obiwanjacobiTopic starter

  • Frequent Contributor
  • **
  • Posts: 988
  • Country: nl
  • What's this yippee-yayoh pin you talk about!?
    • Marctronix Blog
Re: Op-amp circuit for left-right to mid-side audio convertor
« Reply #4 on: March 25, 2015, 10:42:03 am »
This is what I got so far - very basic just to get the picture.



On the left are the L+R inputs of 100mV (100Hz/1000Hz). On the right are the outputs (the lines that go nowhere). The top one is the mid (non-inverting summing amp) and the bottom one is the side (differential amp)...

If this is correct it is easier than I thought...  8)
« Last Edit: March 25, 2015, 10:44:31 am by obiwanjacobi »
Arduino Template Library | Zalt Z80 Computer
Wrong code should not compile!
 

Offline Rerouter

  • Super Contributor
  • ***
  • Posts: 4694
  • Country: au
  • Question Everything... Except This Statement
Re: Op-amp circuit for left-right to mid-side audio convertor
« Reply #5 on: March 25, 2015, 11:07:38 am »
Just tried it in my simulator, and it looks like no, I'm summing in a triangle wave to both channels to act as the common bit to amplify out, and no matter my attempt, I'm not succeeding tonight,

as far as the difference circuit goes, a single op amp in a differential configuration works well,

 

Offline obiwanjacobiTopic starter

  • Frequent Contributor
  • **
  • Posts: 988
  • Country: nl
  • What's this yippee-yayoh pin you talk about!?
    • Marctronix Blog
Re: Op-amp circuit for left-right to mid-side audio convertor
« Reply #6 on: March 25, 2015, 11:13:40 am »
Odd? I can see the common signal (mid) fine with two sines of he same frequency. The diff (side) also seems to work as expected.
The only case that is not correct is when one L/R input is 0v. Then the summer simply passes the other channel's signal.
I would think that that is not common to both L+R...

So perhaps I need to subtract the side from the sum output to get the real common part between L+R...?

EDIT: attached my LTSpice file.
« Last Edit: March 25, 2015, 11:24:03 am by obiwanjacobi »
Arduino Template Library | Zalt Z80 Computer
Wrong code should not compile!
 

Offline rs20

  • Super Contributor
  • ***
  • Posts: 2318
  • Country: au
Re: Op-amp circuit for left-right to mid-side audio convertor
« Reply #7 on: March 25, 2015, 12:14:50 pm »
Odd? I can see the common signal (mid) fine with two sines of he same frequency. The diff (side) also seems to work as expected.
The only case that is not correct is when one L/R input is 0v. Then the summer simply passes the other channel's signal.
I would think that that is not common to both L+R...

So perhaps I need to subtract the side from the sum output to get the real common part between L+R...?

EDIT: attached my LTSpice file.

Only your expectations are wrong, the circuit is working fine. You're just getting confused by the word "common". If you feed a signal into L, and nothing into R, you should see the signal at half strength in both the mid and side outputs. Why? Because the mid and side outputs are defined as two signals with which you can reconstruct the original as follows:

L = mid + side
R = mid - side  (note, which one is negative is arbitrary, so don't be too fussed if L seems to be mixed up with R)

So, I just claimed that a half-strength signal in both mid and side will lead to a signal in the left channel, and zero in the right channel.

L = x/2 + x/2 = x   <--- signal reconstructed perfectly in left channel
R = x/2 - x/2 = 0    <--- absence of signal reconstructed perfectly in right channel

So, your circuit's output is correct, and is the only correct output. Put it another way: you seem to be suggesting that the common/mid output should be zero, and the side output should show the signal in the one channel. But then how on earth can you tell the difference between the left and right channel being zeroed?
« Last Edit: March 25, 2015, 12:19:38 pm by rs20 »
 

Offline obiwanjacobiTopic starter

  • Frequent Contributor
  • **
  • Posts: 988
  • Country: nl
  • What's this yippee-yayoh pin you talk about!?
    • Marctronix Blog
Re: Op-amp circuit for left-right to mid-side audio convertor
« Reply #8 on: March 25, 2015, 02:32:41 pm »
If you feed a signal into L, and nothing into R, you should see the signal at half strength in both the mid and side outputs.

Is that important? I did not tune the gain in any way (just used 10k everywhere). Because I used a non-inverting summing opamp the gain is always 1+the ratio between R's... Currently my gain is 2.
Arduino Template Library | Zalt Z80 Computer
Wrong code should not compile!
 

Offline rs20

  • Super Contributor
  • ***
  • Posts: 2318
  • Country: au
Re: Op-amp circuit for left-right to mid-side audio convertor
« Reply #9 on: March 25, 2015, 10:00:39 pm »
If you feed a signal into L, and nothing into R, you should see the signal at half strength in both the mid and side outputs.
Is that important? I did not tune the gain in any way (just used 10k everywhere). Because I used a non-inverting summing opamp the gain is always 1+the ratio between R's... Currently my gain is 2.
Firstly, your overall gain is 1: R1 and R2 find the average, not the sum, of the two inputs. So that's a gain of 0.5 at that point, then you've followed up with a gain of 2 stage, so overall gain is 1.

OK, so the gain is 1, when sorta ideally the gain "should be" 0.5. Is that important? I don't know, you tell me. I don't know what you're trying to achieve here. If you feed the exact same signal into both channels now, the "mid" output will be doubled, which isn't the common output you might expect, and might cause the output to clip if you're dealing with strong signals.

Incidentally, if you just delete R8, you get the overall gain of 0.5 -- if you want that.
 

Offline obiwanjacobiTopic starter

  • Frequent Contributor
  • **
  • Posts: 988
  • Country: nl
  • What's this yippee-yayoh pin you talk about!?
    • Marctronix Blog
Re: Op-amp circuit for left-right to mid-side audio convertor
« Reply #10 on: March 26, 2015, 08:04:41 am »
I seem to remember that I saw a 200mV output...?
I was planning on adding volume pots for Mid and Side anyway. Have to experiment with what is useful in practice.

I want to make a 'stompbox' for a guitar rig... but it should also be usable in a normal studio setting - typically for processing the side signal differently than the mid signal.

Thanx!
Arduino Template Library | Zalt Z80 Computer
Wrong code should not compile!
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf