it's right way convert stereo to mono?

For general discussion related FlowStone
Post Reply
Logado
Posts: 62
Joined: Tue Jan 06, 2015 5:42 pm

it's right way convert stereo to mono?

Post by Logado »

I do not fully understand Mid / Side, this code works, but I'm not sure that is the right way.
Ideally I would decrease the level of component Side

dsp code:

Code: Select all

streamin inleft;
streamin inright;
streamin wide; // 1-0
streamout outleft;
streamout outright;
streamout outcenter;
outleft = inleft*wide;
outright = inright*wide;
outcenter = (inleft-outleft)+(inright-outright);

then
Image
KG_is_back
Posts: 1196
Joined: Tue Oct 22, 2013 5:43 pm
Location: Slovakia

Re: it's right way convert stereo to mono?

Post by KG_is_back »

The way you can think of stereo wave is, that they record 2-dimensional movement of air at listeners head (or at stereo microphone, when recording). you can display it using stereoscope:
Image

mid coresponds to movement of air back and forth (along y-axis) and side coresponds to movement left and right (x-axis).
Left and right channels corespond to movement along 45degree angles.

to convert between LR and MS representations you may use following formulas:

Code: Select all

mid=(left+right)*0.5;
side=(left-right)*0.5;

left=mid+side;
right=mid-side;

the "0.5" coefficient is there to maintain proper gain-staging during conversion (the most correct way is to multiply by sqrt(0.5) during every conversion).
Mono file has no "side" element. What you are looking for is a stereo widening tool, which controls relative amplitude of mid and side elements. The most correct way would be to use this:

Code: Select all

streamin L;
streamin R;
streamin width; // 0=mono 0.5=original 1=side only
streamout Lout;
streamout Rout;
float mid;
float side;
mid=L+R;
side=L-R;
Lout=(1-width)*mid+width*side;
Rout=(1-width)*mid-width*side;
Logado
Posts: 62
Joined: Tue Jan 06, 2015 5:42 pm

Re: it's right way convert stereo to mono?

Post by Logado »

wow, thanks for the detailed answer KG
Post Reply