If you have a problem or need to report a bug please email : support@dsprobotics.com
There are 3 sections to this support area:
DOWNLOADS: access to product manuals, support files and drivers
HELP & INFORMATION: tutorials and example files for learning or finding pre-made modules for your projects
USER FORUMS: meet with other users and exchange ideas, you can also get help and assistance here
NEW REGISTRATIONS - please contact us if you wish to register on the forum
Users are reminded of the forum rules they sign up to which prohibits any activity that violates any laws including posting material covered by copyright
it's right way convert stereo to mono?
3 posts
• Page 1 of 1
it's right way convert stereo to mono?
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:
then
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
- Logado
- Posts: 62
- Joined: Tue Jan 06, 2015 5:42 pm
Re: it's right way convert stereo to mono?
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:
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:
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:
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;
- KG_is_back
- Posts: 1196
- Joined: Tue Oct 22, 2013 5:43 pm
- Location: Slovakia
Re: it's right way convert stereo to mono?
wow, thanks for the detailed answer KG
- Logado
- Posts: 62
- Joined: Tue Jan 06, 2015 5:42 pm
3 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 110 guests