DSP: left, center, right.

Roman Thilenius's icon

i am still looking for different methods for stereo to left/mid/right
encoding, i.e. i want to distinguish between "mono" and "left only"
in a stereo source and distribute the "mono" content of a stereo
source onto a third channel.

did anyone implement something like this and wants to share his method?

take care: dont recommend the use of addition and substraction, that wont work. :)

-110

Roald Baudoux's icon

Basically what you need is a measure of correlation. When correlation is poor, you would route L and R channels to their normal destinations. And when the correlation increase you would redirect more signal from both L and R to the third channel.

But how to estimate the correlation ? Maybe by comparing the energy (envelope follower) of the sum versus the energy of the difference ?

Just an idea, I don't have the time to try it now. Some DSP gurus might have better ones...

AlexHarker's icon

Stereo positioning is one cue that can be used to attempt blind source separation (using frequency domain techniques). You might google this. It's not by any means perfect but it does work to a decent extent.

Roman Thilenius's icon

yeah i was thinking like that, it is a maatter of phase/correlation.

but wouldnt i have to do it in several stages? at an rms of 50 milliseconds quite some
of the spectrum will remain unanalysed :)

Roald Baudoux's icon

You don't have to perform the RMS over 50 ms, you can go down to 1 sample if you like...

However I think a few ms of integration time doesn't matter as the ear's integration time is around 50 ms. And with frequency domain techniques there is also a kind of integration time linked to the window size and window step of the FFT.

You could also try a filterbank with each band coupled an envelope follower (like in the analysis stage of a vocoder).

Roman Thilenius's icon

yeah you are right, in best case it is just user controllable/dynamic.

i found a nice schemata, but i dont fully understand it, what does
"multiply and then integrate under the curve" mean?

maybe somebody could translate that from chinese to maxmsp for me.

-110

Roman Thilenius's icon

and of course i´d love to avoid fft, btw. i was dreaming to make it work with delay~

Floating Point's icon

As far as I understand it, integrate is just the area under the curve, so in dsp I'd imagine you'd accumulate the values of the samples over the rms period, and divide by the sample rate (maybe also multiply by a constant like 2pi, depending on application?)

I'd also imagine the accumulator would need to be a running accumulation where you'd add the latest sample value and subtract the earliest from a running total. Maybe there's an integrator external to make all this easier, but I don't think it would be to hard to patch.
T

Roman Thilenius's icon

yeah i´ve heard soemthing like that , too, that you can calculate the whole thing
as radians (at least as one of many options).

but i wasnt abel to patch it myself, a working example would be great.

i understand that not too mny people know how to do this, but i am a bit
surprised that noone ever asked for it?
a search at the forums for "correlation" returned nothing :D

-110

volker böhm's icon

basic correlation of bipolar signals is quite easy: multiply the signals and sum the results.
for the running sum or integrator you could use [average~] in bipolar mode.

i *think* something like the sketch below should get you closer.
(the clipping is a trick from an old neumann document, if i remember well - otherwise you'd have to somehow cope with the changing input levels. you might also be able to calculate the rms of both signals, multiply them and devide the correlation signal???).
vb

Max Patch
Copy patch and select New From Clipboard in Max.