The truth behind stereo spreading.

DSP, Plugin and Host development discussion.
RELATED
PRODUCTS

Post

Hi to all, it's good to be on KVR again after all this time :)

Yesterday I stumbled upon this trick for Ableton Live.

To cut it short, in Live you've got this Utility plugin that gives you basic controls on a track, like Volume and Width.

Width works in a way that if you set it to 0%, the stereo channel becomes mono, if you set it 100% the stereo channel sounds unchanged and if you set it 200%, it makes you hear only the stereo part of the channel (ie removes the part of sound that sounds identical in both tracks).

That's useful when you remix songs, because low-frequency sounds are often mono (due to a partial deafness to low-freq stereophony in our auditive system, I think. That would explain why, while the speakers in your system are always > 2, the subwoofer is always one).

If you can exclude mono parts, you can remove, for example, drumkicks from the sound and keep the voice & instruments.

Question is: how does "width" knob work algorithmically? It just does a simple absolute-value subtraction between right and left channel or does it do something more?

Any help is appreciated, many thanks in advance.
Creator of Hya.io - https://hya.io

Post

Code: Select all

M = (L+R)/sqrt(2);   // obtain mid-signal from left and right
S = (L-R)/sqrt(2);   // obtain side-signal from left and right

// amplify mid and side signal seperately:
M *= 2*(1-width);
S *= 2*width;

L = (M+S)/sqrt(2);   // obtain left signal from mid and side
R = (M-S)/sqrt(2);   // obtain right signal from mid and side
the middle part is from the top off my head, so it may be wrong (i assume width to be between 0...1 - 1 would be 200% then). of course, the division by sqrt(2) should be made much smarter in actual code.

edit: ahh, and here: www.braindoc.de/vst/MidSideMixer.zip
My website: rs-met.com, My presences on: YouTube, GitHub, Facebook

Post

because low-frequency sounds are often mono (due to a partial deafness to low-freq stereophony in our auditive system, I think. That would explain why, while the speakers in your system are always > 2, the subwoofer is always one).
the real reason is that the brain cannot locate low frequency sounds because the wavelength is so long that the phase difference is too little between the ears to be felt. (as the max inter-aural time difference (ITD) is about 0.7 ms, the longer the period, the smaller the phase difference between ears)

Post

janesconference wrote:That's useful when you remix songs, because low-frequency sounds are often mono (due to a partial deafness to low-freq stereophony in our auditive system, I think. That would explain why, while the speakers in your system are always > 2, the subwoofer is always one).
The reason that bass frequencies almost always tend to be panned center, and the fact we only need a single subwoofer has nothing to do with our ears or brain. it's a physical phenomenon with sound waves.

Bass frequencies are not directional. it's as simple as that. no matter where the source (sub woofer or whatever), you can't measure - let alone hear - where the bass is coming from.

Post

Kingston wrote:
janesconference wrote:That's useful when you remix songs, because low-frequency sounds are often mono (due to a partial deafness to low-freq stereophony in our auditive system, I think. That would explain why, while the speakers in your system are always > 2, the subwoofer is always one).
The reason that bass frequencies almost always tend to be panned center, and the fact we only need a single subwoofer has nothing to do with our ears or brain. it's a physical phenomenon with sound waves.

Bass frequencies are not directional. it's as simple as that. no matter where the source (sub woofer or whatever), you can't measure - let alone hear - where the bass is coming from.
That's not really the truth, because it doesn't apply to many hard panned tracks. You can clearly hear the bass being panned across two stereo speakers, whereas the same song sounds very different on 5.1 and 7.1 systems, which only contain one speaker capable of reproducing bass content. And when I say very different, the bass - 100% of the time sounds less powerful, not to mention less directional, than in a 2 speaker setup. So when right in front of you, you can hear the bass and where it's coming from.
"The educated person is one who knows how to find out what he does not know" - George Simmel
"I am the way, the truth, and the life. No one comes to the Father except through Me." - Jesus Christ

Post

braindoc wrote:

Code: Select all

M = (L+R)/sqrt(2);   // obtain mid-signal from left and right
S = (L-R)/sqrt(2);   // obtain side-signal from left and right

// amplify mid and side signal seperately:
M *= 2*(1-width);
S *= 2*width;

L = (M+S)/sqrt(2);   // obtain left signal from mid and side
R = (M-S)/sqrt(2);   // obtain right signal from mid and side
Thank you, braindoc.

Ok, so let's say we are at 200%, so width is 1:

Code: Select all

M = (L+R) / sqrt (2) * 2 * 0 = 0 
S = (L-R) / sqrt (2) * 2 * 1 = 2 * (L-R) / sqrt (2)
If my calculations are right, we will have, in the end:

Code: Select all

L = (L - R)
R = (R - L)
It seems correct. Left part is stereo left channel minus right channel - which means "The part of signal that's unique to left channel", and viceversa.

Why does it work for all other values of width? Why the square root of 2?
Creator of Hya.io - https://hya.io

Post

knob ranch wrote:
because low-frequency sounds are often mono (due to a partial deafness to low-freq stereophony in our auditive system, I think. That would explain why, while the speakers in your system are always > 2, the subwoofer is always one).
the real reason is that the brain cannot locate low frequency sounds because the wavelength is so long that the phase difference is too little between the ears to be felt. (as the max inter-aural time difference (ITD) is about 0.7 ms, the longer the period, the smaller the phase difference between ears)
Exactly what I was trying to say, but said much better :D
Creator of Hya.io - https://hya.io

Post

janesconference wrote:Why does it work for all other values of width? Why the square root of 2?
look up about panning laws. Sqrt(2) maintains a 3dB panning law and ensures that the level in the centre isn't 'louder' than when that same sound is isolated in a channel. You can leave it out, but it will sound different.. all I can say is try it, and see what you prefer!

DSP
Image

Post

duncanparsons wrote:
janesconference wrote:Why does it work for all other values of width? Why the square root of 2?
look up about panning laws. Sqrt(2) maintains a 3dB panning law and ensures that the level in the centre isn't 'louder' than when that same sound is isolated in a channel. You can leave it out, but it will sound different.. all I can say is try it, and see what you prefer!

DSP
yes thats the reason, but i'd put it a in bit different guise in this case: the assumption is that left and right channel are uncorrelated, so when you sum them (to get the mid-signal), the resulting signal would be louder (by sqrt(2)) than each of the two channel signals alone. hence, the division by just that factor. same reasoning goes for the side signal. having slept over it, i think the 2 divisions by sqrt(2) (before and after the amplification) will cancel excatly with the multiplication by 2 in the middle part (verify this on paper, cause i didn't yet)
My website: rs-met.com, My presences on: YouTube, GitHub, Facebook

Post

braindoc wrote:

Code: Select all

M = (L+R)/sqrt(2);   // obtain mid-signal from left and right
S = (L-R)/sqrt(2);   // obtain side-signal from left and right

// amplify mid and side signal seperately:
M *= 2*(1-width);
S *= 2*width;

L = (M+S)/sqrt(2);   // obtain left signal from mid and side
R = (M-S)/sqrt(2);   // obtain right signal from mid and side
the middle part is from the top off my head, so it may be wrong (i assume width to be between 0...1 - 1 would be 200% then). of course, the division by sqrt(2) should be made much smarter in actual code.

edit: ahh, and here: www.braindoc.de/vst/MidSideMixer.zip
I was just puzzling this over myself

the sqrt(2) cancels itself out, becasue both M & S are divided by it, then

L = (M+S)/sqrt(2)

becomes

L = (L+R)*2*(1-width) + (L-R)*2*width

Post

janesconference wrote:
Why does it work for all other values of width?
focus on the multiplication with width for the side signal and with (1-width) for the mid signal (ignore the scaling factor 2 for the moment). if width is in between 0...1, both factors (width and (1-width)) will always exactly sum up to unity. if you have width = 0.5, you give equal weight to the mid and side signal, but if it is larger than 0.5, you give more weight to the side-signal (increasing the stereo-field). vice versa for values < 0.5. that is to say - you do a re-weighting of the mid and side signal.
My website: rs-met.com, My presences on: YouTube, GitHub, Facebook

Post

HunterKiller wrote:So when right in front of you, you can hear the bass and where it's coming from.
You're not taking into account the fact that bass (the instrument or the drum) has plenty of high frequency content, which are directional quite obviously. ;)

Below certain (low) frequency (which I'm too lazy to google up) you don't have directionality. you can test it easily with steep lowpass filters, but even in that case you have to take into account room resonances (ie. rattling furniture), which can in certain cases give a sense of direction.

Post

braindoc wrote:
janesconference wrote:
Why does it work for all other values of width?
focus on the multiplication with width for the side signal and with (1-width) for the mid signal (ignore the scaling factor 2 for the moment). if width is in between 0...1, both factors (width and (1-width)) will always exactly sum up to unity. if you have width = 0.5, you give equal weight to the mid and side signal, but if it is larger than 0.5, you give more weight to the side-signal (increasing the stereo-field). vice versa for values < 0.5. that is to say - you do a re-weighting of the mid and side signal.
Yeah, I figured it out playing with the formulas. For example if i set the width to 150% the L+R (M part) is weighted 1/4, while the L-R (S part) is weighted 3/4.

One more question: if I wanted to play only the "mono" part (ie the signal minus the S part), say at 200% width, I end up with L - (L - R) = -R on the left channel, and R - (R - L) = -L on the right channel, that seems to me the same signal, but stereo-switched and phase inverted. How can it be?

Maybe I should first "mono" the signal (0% width, R,L = (R + L) / 2) and then subract the S-part?

(in this case, left channel would give:

((R + L) / 2) - (L - R) = (3 * R - L) / 2

and viceversa for right channel.

am I doing something wrong?
Creator of Hya.io - https://hya.io

Post

janesconference wrote:One more question: if I wanted to play only the "mono" part (ie the signal minus the S part), say at 200% width
mmhh?! mono and 200% width are mutually exclusive in my book. mono is synonymous to 0% width.
My website: rs-met.com, My presences on: YouTube, GitHub, Facebook

Post

Kingston wrote:The reason that bass frequencies almost always tend to be panned center, and the fact we only need a single subwoofer has nothing to do with our ears or brain. it's a physical phenomenon with sound waves.

Bass frequencies are not directional. it's as simple as that. no matter where the source (sub woofer or whatever), you can't measure - let alone hear - where the bass is coming from.
Historically, bass frequencies were panned center because if there were marked bass differences in the L and R, there would be excessive vertical modulation of the stereo groove in an LP record, and many record players wouldn't track it. :hihi:

Otherwise I agree with what you've said, with the qualification that the reason bass has almost no directional information to us is because the most common listening environments (small rooms) aren't large enough to properly support multiple cycles of bass soundwaves. The exceptions are big concert halls, where the bass source direction is much more discernible
I have a cunning plan ...

Post Reply

Return to “DSP and Plugin Development”