Eliminating the mid signal, keeping the sides and retain stereo


#1

Hi, the title says what I am trying to achieve.

I found this article when trying to understand the decoding/encoding part. This would give me the mid and side as a single channel respectively.
https://www.soundonsound.com/sound-advice/q-how-does-mid-sides-recording-actually-work

However, I believe I have to find the common signal to both sides and subtract it, so it seems to be a slightly different process. I tried literally subtracting the sides from each other in code but the result was mono.

I am unsure about whether the audio signal given comes signed or unsigned and how to handle the integer math stuff, so I am wondering if there is anyone who could solve it for me or explain :smiley:

Or maybe even an object that can do this already exists?

Thanks


#2

Mid/SIde encoding typically has one signal for "mid" and another for "side". The "side"signal is combined with the "mid" signal in-phase to produce one stereo side (say Left) and out-of-phase to produce the other (Right in my example).

Hope this helps,
John


#3

But how can I eliminate the mid signal and retain the sides in stereo?
Sure, I get the mid and side as single channels but I need the sides as individual channels minus the mid.


#4

Mid/side and stereo are different things - two different encodings of the same signal. Having the side signal "in stereo" is meaningless - the 2 halves of the stereo are mid +/- side. Typically you move between these two formats to process in mid/side, then convert back to stereo to listen. It also allows you to record with a figure-of-eight and cardiod mic and get the effect of co-incident cardiod mics whose relative angle can be adjusted after the fact (by changing the proportion of mid & side signal in each side of the stereo signal)

Regards,
John


#5

So apparently this is not possible to separate audio into left, right and center after all then? How disappointing :frowning:
Found this forum-thread relevant.

https://forum.reasontalk.com/viewtopic.php?t=7370781


#6

Sounds like you mean a "center cut" function. (Which is different from mid/side.)
You may wish to have a look at dsp_centercut and try to port the code (or find someone who does).


#7

@Jens_Groh That looks to be immensely help, highly appreciated.

Not sure I can tackle it and how much effort/time it would take but from a first look it seems quite self-contained so I am generally optimistic about it, I just might not find the time soon.

It is definitely worth trying the winamp-plugin to hear the effect for sure.

Yes, I obviously had a misconception about the workings of m/s but I made progress by understanding that at least :smiley:

Edit: To me the biggest challenge is the conversion between floating point and integer math, I find it mind boggling albeit striking.


#8

@ivofx Mid/Side vs Stereo is definitely hard to wrap your mind around - much easier to grasp if you come to it from using the microphone technique associated with it than as a mix process, IMHO.

As for floating point to integer: a floating point number has an integer bit and a fractional bit - to convert to integer, you need to round (up or down) or truncate the fractional bit. Which approach is appropriate will depend on the application and there is typically a default approach defined by the language you use if you just convert the types without explicitly rounding (etc.) from floating point to integer - usually this is truncation.

To go the other way, you usually just re-format the integer and give it a fractional bit that is set to zero (this happens auto-magically in the conversion in all computer languages I am aware of.)

If you are truncating an audio signal (say to change it's bit depth, but not as a bit-crusher type effect), you may also hear about "dither", which is a way of avoiding some of the limitations of truncation by adding very low level noise. This is a much more complicated topic, but happily can mostly be ignored unless you need audiophile quality operations.

Hope this helps,
John


#9

So, it seems to me as though you're wanting to take a LR signal, convert to Mid-Side, and then convert back to LR using only the Side.
You can also think of Mid-Side in this context as Sum and Difference or In Phase and Out of Phase. I've used this to improve stereo Time-Scale Modification.
I would do it in the following way, for each pair of samples.

For a complete transform there and back:
Mid = L+R
Side = L-R
L = (Mid+side)/2
R = (Mid-side)/2

In your case,
Mid = 0
Side = L-R
L = (Mid+side)/2 = (0+L-R)/2 = (L-R)/2
R = (Mid-side)/2 = (0-(L-R))/2 = (-L+R)/2 = (R-L)/2

I hope that helps.