# Converting Stereo to Mono taking into account Phase modulation

Started by December 16, 2008
```Frnak McKenney <frnak@far.from.the.madding.crowd.com> wrote:
> On Wed, 17 Dec 2008 19:40:19 +0000 (UTC), <gah@ugcs.caltech.edu> wrote:
>> Frnak McKenney <frnak@far.from.the.madding.crowd.com> wrote:
(snip)
>>>  output = max(L,R)
(snip_
>> Consider L=sin(wt)  R=cos(wt), and look at max(L,R).

>> The fundamental is at 2*w, and with the sharp corners
>> it will have harmonics going up from there.  To me that
>> will sound very different from sin or cos.

> Thanks to Richard's comments I can see why using max(L,R) on a
> signal where L=reverse(R) could have some displeasing effects.
> Are you assuming this for the above? Or are you saying that
> two only-mildly-related channels would have problems if you
> combined them with max(L,R)?

IF the two are equal then max(L,R) = L = R.

A possible difference is a phase shift between them, which
I represented as sin(wt) and cos(wt).  So that is 90 degrees,
not 180 degrees.  It would be even worse for 180 degree shift.

I suppose one could ask for the relative delay between the
two channels that would maximize the RMS of the sum, and,
for some definition of best consider it the best sum.

That is, assume that a differential delay between the two
channels has appeared somewhere along the way and try to
determine that delay.  If you find the shift that minimizes
the RMS of R-delay(L) then compute R+delay(L) that might be
a good choice.   Max doesn't seem a good choice to me.

-- glen
```
```Frnak McKenney wrote:
..
>> No, the only proper way to sum channels (which is all that a stereo to
>> mono conversion is) is to, well, sum them (and rescale).  The problem is
>> that it is a well-known hack to impart a sort-of-stereo quality to a
>> mono source  by duplicating it and inverting one channel. It is one of a
>> number of processes that are by definition "mono-incompatible". If one
>> obtains such a source, scope for mono conversion is clearly somewhat
>> limited, and the best solution will likely be to accept it is really
>> mono and just use one channel.
>
> Ah. Back in per-history, when black vinyl was the media-du-jour for
> recordings, I recall some of my (large-print STEREO) LPs having a very-
> small-print note saying that they had been created from (small print
> mono) originals. Now I know how it was done. <grin!>  Thanks for the
> information.
>

There are more sophisticated techniques (some expressly designed to
retain mono compatibility), and I would be surprised if channel
inversion was all that they did (I did call it a "hack" - sometimes a
small amount of delay might be added to one channel as well and the
implications for stylus motion might have to be considered too). One
standard method can be stated very simply - selective frequency
band-splitting, so that different bands will in effect be re-balanced
across the channels.  There is even the original pvoc approach dating
back to whenever pvoc was first published (60s I suppose), where you
resynthesise odd-numbered bins to one channel, and even-numbered ones to
the  other.  Band-wise, relatively little needs to be done to give an
~impression~ of stereo, and most of it will be applied to the upper
frequency range. So the flutes and violins may be quite stereophonic,
but the basses probably remain pretty mono. The standard orchestral
layout does make this relatively easy, with high strings and wind to the
left, low strings and wind to the right!

This process is these days subsumed under the broader category of
"upmixing", where most of the interest today is in upmixing (genuine)
stereo to 5.1 surround, with most of the effort going into "ambience
extraction", which is exactly what it says - some of the reverb
detected in the stereo signal is siphoned off into the rear  channels.

And as you say, we will not really know what is going on (or if any of
the above is actually relevant at all) until the OP posts more details.

Richard Dobson

```
```Frnak McKenney wrote:

...

> Thanks to Richard's comments I can see why using max(L,R) on a
> signal where L=reverse(R) could have some displeasing effects.
> Are you assuming this for the above? Or are you saying that
> two only-mildly-related channels would have problems if you
> combined them with max(L,R)?

How would max(L,R) be implemented? Surely not instantaneously! But if
not that, then what?

...

Jerry
--
Engineering is the art of making what you want from things you can get.
&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;
```
```
Jerry Avins wrote:

> Frnak McKenney wrote:
>
>   ...
>
>> Thanks to Richard's comments I can see why using max(L,R) on a
>> signal where L=reverse(R) could have some displeasing effects.
>> Are you assuming this for the above? Or are you saying that
>> two only-mildly-related channels would have problems if you
>> combined them with max(L,R)?
>
>
> How would max(L,R) be implemented? Surely not instantaneously! But if
> not that, then what?

Active matrix mixing:

1. Split L and R into subbands.
2. Weight L vs R and (L + R) vs (L-R) in the each subband.
3. Average the result of the weighting per time X.
4. Calculate the output for each subband as AxL + BxR. The coefficients
A and B are set as the result of weighting; also A^2 + B^2 = 1.

DSP and Mixed Signal Design Consultant
http://www.abvolt.com

```
```On Fri, 19 Dec 2008 12:04:02 -0500, Jerry Avins <jya@ieee.org> wrote:
> Frnak McKenney wrote:
>
>    ...
>
>> Thanks to Richard's comments I can see why using max(L,R) on a
>> signal where L=reverse(R) could have some displeasing effects.
>> Are you assuming this for the above? Or are you saying that
>> two only-mildly-related channels would have problems if you
>> combined them with max(L,R)?
>
> How would max(L,R) be implemented? Surely not instantaneously! But if
> not that, then what?

Jerry,

I'm the person who introduced that little expression into the
conversation.

The OP's goal, as I understood it, was to take a two-channel
stereophonic recording and "convert" it to monophonic.  The problem
as I understood it was that the OP had tried a simple (L+R)
approach, but that in some spots the resulting recording went
"silent".  Presumably this was because during that interval the
signal from the two channels cancelled, that is, that the sum L+R
was zero (or some vary small amplitude) over that interval.

My notation (for which I apologize) was an attempt to say that, if
the two signals weren't near zero during that interval, there ought
to be some "better" way of combining them -- one yielding a more
pleasant result -- than a simple sum-of-amplitudes.

Now, after reading Richard's, Glen's, and Vladimir's replies, it
seems fairly clear that the answer to the OP's query is:

It Depends.

Since we don't have access to the OP <grin!>, I'll make up a
scenario:  Imagine that I had a stack-o-stereo-wax (maybe even a few
CDs <grin!>) that I wanted to play over an AM radio channel.  Some
of it is "true" stereo, recorded with (say) widely-varying
microphone placements; some is mono recordings "converted" to
stereo.  Is anyone aware of a (DSP-ish or simpler) way of producing
"adequate-sounding" mono from these disks?

Or does the process clearly involve too many undefineds and "matters
of taste" to be approachable in any general way?

Frank
--
"In a survey taken several years ago, all incoming freshman at MIT
were asked if they expected to graduate in the top half of their
class.  Ninety-seven percent responded that they did."
--
Frank McKenney, McKenney Associates
Richmond, Virginia / (804) 320-4887
Munged E-mail: frank uscore mckenney ayut mined spring dawt cahm (y'all)
```
```Frnak McKenney wrote:

> Imagine that I had a stack-o-stereo-wax (maybe even a few CDs
> <grin!>) that I wanted to play over an AM radio channel.  Some of
> it is "true" stereo, recorded with (say) widely-varying microphone
> placements; some is mono recordings "converted" to stereo.  Is
> anyone aware of a (DSP-ish or simpler) way of producing "adequate-
> sounding" mono from these disks?

Anything one can do will have failure modes if mixing & mastering
wasn't carefully done. That involves not putting in indispensable
antiphase components in the first place, aka ensuring mono
compatibility. Should near-antiphase ever happen to result from the
miking, you redo the take or use studio tricks to construct a mix
that is (artificially) roomy yet reduces gracefully.

Martin

--
Education is the ability to listen to almost
anything without losing your temper.
--Robert Frost (but he didn't know modern hit radio)
```
```On Dec 20, 11:35&#2013266080;am, Martin Eisenberg <martin.eisenb...@udo.edu>
wrote:
> Frnak McKenney wrote:
> > Imagine that I had a stack-o-stereo-wax (maybe even a few CDs
> > <grin!>) that I wanted to play over an AM radio channel. &#2013266080;Some of
> > it is "true" stereo, recorded with (say) widely-varying microphone
> > placements; some is mono recordings "converted" to stereo. &#2013266080;Is
> > anyone aware of a (DSP-ish or simpler) way of producing "adequate-
> > sounding" mono from these disks?
>
> Anything one can do will have failure modes if mixing & mastering
> wasn't carefully done. That involves not putting in indispensable
> antiphase components in the first place, aka ensuring mono
> compatibility. Should near-antiphase ever happen to result from the
> miking, you redo the take or use studio tricks to construct a mix
> that is (artificially) roomy yet reduces gracefully.
>
> Martin
>
> --
> Education is the ability to listen to almost
> anything without losing your temper.
> --Robert Frost (but he didn't know modern hit radio)

Some 30-year-old history;

the way mono-to-stereo was often done in pre-DSP days was to apply the
mono signal to a series connection of allpass filters. You then form;

left = mono + alppas(mono)
right = mono - allpass(mono)

Therefore, where one channel peaks, the other dips, so the overall
tonal coloration was unaffected.

The "art" was to pick the frequencies and Q's of the allpass filters.
My former employer (Dave Blackmer of dbx fame) was convinced you
needed at least 12th-order, judiciously spread across the audio band.

```
```Robert Adams <robert.adams@analog.com> wrote:

> the way mono-to-stereo was often done in pre-DSP days was to apply the
> mono signal to a series connection of allpass filters. You then form;

> left = mono + alppas(mono)
> right = mono - allpass(mono)

> Therefore, where one channel peaks, the other dips, so the overall
> tonal coloration was unaffected.

> The "art" was to pick the frequencies and Q's of the allpass filters.
> My former employer (Dave Blackmer of dbx fame) was convinced you
> needed at least 12th-order, judiciously spread across the audio band.

In addition, in the quad days various ways were derived to
generate four channels from a stereo source.

-- glen
```
```glen herrmannsfeldt wrote:
>
>> the way mono-to-stereo was often done in pre-DSP days was to apply the
>> mono signal to a series connection of allpass filters. You then form;
>
>> left = mono + alppas(mono)
>> right = mono - allpass(mono)
>
>> Therefore, where one channel peaks, the other dips, so the overall
>> tonal coloration was unaffected.
>
>> The "art" was to pick the frequencies and Q's of the allpass filters.
>> My former employer (Dave Blackmer of dbx fame) was convinced you
>> needed at least 12th-order, judiciously spread across the audio band.
>
> In addition, in the quad days various ways were derived to
> generate four channels from a stereo source.

And none of it makes a particle of difference when listening from
another room through the door.

Jerry
--
Engineering is the art of making what you want from things you can get.
&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;
```
```In article <46676447-fefc-4a6a-9a37-
says...

>Some 30-year-old history;
>
>
>the way mono-to-stereo was often done in pre-DSP days was to apply the
>mono signal to a series connection of allpass filters. You then form;
>
>left = mono + alppas(mono)
>right = mono - allpass(mono)
>
>Therefore, where one channel peaks, the other dips, so the overall
>tonal coloration was unaffected.
>
>The "art" was to pick the frequencies and Q's of the allpass filters.
>My former employer (Dave Blackmer of dbx fame) was convinced you
>needed at least 12th-order, judiciously spread across the audio band.
>

I published an article about this in the April 1970 issue of J. Audio
Engineering Society. Probably the most interesting thing about it was a
proof that the sum of the power spectra of the two pseudostereo channels
is equal to the power spectrum of the input. This proof was generalized
to being true if the original mono signal is passed through any allpass
filter before the output matrix. In other words:

left = mono*allpass1 + mono*allpass2
right = mono*allpass1 - mono*allpass2

which reduces to the case Bob described above when allpass1 = 1.

For pseudostereo this is important because it creates a pseudostereo
process that does not produce tonal coloration compared to the original
mono. There are also interesting applications to power-complementary
filterbanks.

Bob Orban

```