Joint stereo: Difference between revisions

From Hydrogenaudio Knowledgebase
(→‎References: Bullets, beter presentation, disclaimer for MPC)
(Total rewrite + merge of mid-side stereo and intensity stereo)
Line 1: Line 1:
{{merge-from|Mid-side stereo}}
{{merge-from|Mid-side stereo}}


'''Joint stereo''' coding methods try to increase the coding efficiency when encoding stereo signals by exploiting commonalties between the left and right channel signal.
'''Joint stereo''' coding methods try to increase the coding efficiency when encoding stereo signals by exploiting commonalities between the left and right channel signal. In the context of [[MP3]] encoding, there are actually 2 totally different method of Joint Stereo: ''Mid-side Stereo'' and ''Intensity Stereo''.






==Mid-side and intensity stereo==
==Mid-side Stereo==
There are two usual joint stereo coding algorithms, namely mid-side (ms) stereo coding and intensity stereo coding. Mid-side stereo applies a matrix to the left and right channel signals, computing sum and difference of the two original signals.
'''Mid-side stereo''' coding calculates a "mid"-channel by addition of left and right channel, and a "side"-channel, i.e.:
 


<center><math>Left = L \qquad Right = R\,</math></center>
<center><math>Left = L \qquad Right = R\,</math></center>
Line 17: Line 16:
<center> <math>Left=Middle+Side \qquad Right=Middle-Side</math></center>
<center> <math>Left=Middle+Side \qquad Right=Middle-Side</math></center>


Whenever a signal is concentrated in the middle of the stereo image (i.e. more mono-like), mid-side stereo can achieve a significant saving in [[bitrate]], since one can use less bitrate to encode the side-channel. Even more important is the fact that by applying the inverse matrix in the decoder the quantization noise becomes correlated and falls in the middle of the stereo image where it is masked by the signal.
Unlike [[Joint stereo#intensity stereo|intensity stereo]] which destroys phase information, mid-side coding keeps the phase information pretty much intact. Correctly implemented mid-side stereo does very little or no damage to the stereo-image and increases compression efficiency either by reducing size or increasing overall quality.
==Intensity Stereo==


Whenever a signal is concentrated in the middle of the stereo image, mid-side stereo can achieve a significant saving in [[bitrate]]. Even more important is the fact that by applying the inverse matrix in the decoder the quantization noise becomes correlated and falls in the middle of the stereo image where it is masked by the signal.
'''Intensity stereo''' coding is a method that achieves a saving in bitrate by replacing the left and the right signal by a single representing signal plus directional information. This replacement is psychoacoustically justified in the higher [[frequency]] range since the human auditory system is insensitive to the signal phase at frequencies above approximately 2kHz.


[[Intensity stereo]] coding is a method that achieves a saving in bitrate by replacing the left and the right signal by a single representing signal plus directional information. This replacement is psychoacoustically justified in the higher [[frequency]] range since the human auditory system is insensitive to the signal phase at frequencies above approximately 2kHz.
Intensity stereo is by definition a [[lossy]] coding method thus it is primarily useful at low bitrates. For coding at higher bitrates only mid-side stereo should be used.


Intensity stereo is by definition a [[lossy]] coding method thus it is primarily useful at low bitrates. For coding at higher bitrates only ms stereo should be used.


==Additional information==
==Additional information==
Some more details, history and examples about joint stereo & mid/side coding:
Some more details about joint stereo & mid-side coding:
 
mid/side can be lossless like obviously in Lossless formats Flac, Wavpack, Monkey's Audio (ape) etc., but in lossy encoders the encoder tries to do the best to minimize all losses in perception. And here the encoder has not only to deal with stereo modes, but also with mids, highs etc. etc.
So, regarding lossy formats like MP3 (Lame, Fraunhofer, Xing), Musepack (MPC), Vorbis etc., the mid/side coding might be even mathematical lossless, might be perceptual lossless (=transparent), or not so lossless at all at low bitrates.
So, it depends in the lossy formats about the quality of mid/side (js) coding.
From obvious bad sounding bugs like in some old Fraunhofer mp3 ("Radium hack"), not so optimized perfomance like in mp3-Xing, up to the optimized js-modes in mp3-Lame, which offer frame-dependent stereo or mid/side coding to achieve maximum qualities. And advanced formats like mp3-lame, Musepack-MPC or Vorbis-ogg offer increasing js(mid/side//stereo)qualities in increasing general quality (q) levels, examples:
Mp3-Lame inside the presets eg. -V quality levels, with different -msfix values up to the "nssafejoint" mode in 320 kbit cbr.
Musepack-MPC inside the various q-levels/presets and the --ms x switch.
Vorbis in its presets, 1 example above q6 the "lossless stereo coupling".


So, regarding js/mid/side coding, there is no black & white, there are shades of grey, dependent on the target bitrate or quality level.
* Bugs and/or not-optimized encoders may implement mid-side coding incorrectly, making mid-side coding sounds worse than simple stereo, while in reality (see the formulas above) there should be no difference in quality between mid-side stereo and simple stereo.
(Even if you ignore faulty implementations like in old Fraunhofer/"Radium hack" or Xing). But it should be said, that the prejudice of js=bad originates with high probability by these old faulty implementations of ancient encoders.


* Modern/optimized encoders will use mid-side coding or simple stereo coding as necessary, depending on the correlation between the Left and Right channels.


==See also==
*[[Intensity stereo]]


==External Links==
* [http://harmsy.freeuk.com/mostync/ Joint stereo myths and realities] ''(very important read!)''


==References==
* [http://www.audiocoding.com/ Audiocoding] -- written by Menno Bakker
* [http://www.audiocoding.com/ Audiocoding] -- written by Menno Bakker


* [http://www.High-Quality.ch.vu/ High Quality Audio guides] -- written by user<br />'''Note: Despite this page's recommendation for encoding in MPC, please be aware that in recent listening tests, other encodings are also proven to be at least as good as MPC, if not better.
* [http://www.High-Quality.ch.vu/ High Quality Audio guides] -- written by user<br />'''Note: Despite this page's recommendation for encoding in MPC, please be aware that in recent listening tests, other encodings are also proven to be at least as good as MPC, if not better.


==Further reading==
* [http://en.wikipedia.org/wiki/Joint_stereo joint stereo at wikipedia]
 
 
 
==External links==
*[http://harmsy.freeuk.com/mostync/ joint stereo myths and realities]
*[http://en.wikipedia.org/wiki/Joint_stereo joint stereo at wikipedia]




[[Category:Technical]]
[[Category:Technical]]

Revision as of 16:51, 1 December 2006

It has been suggested that [[::Mid-side stereo|Mid-side stereo]] be merged into this article or section. (Discuss)

Joint stereo coding methods try to increase the coding efficiency when encoding stereo signals by exploiting commonalities between the left and right channel signal. In the context of MP3 encoding, there are actually 2 totally different method of Joint Stereo: Mid-side Stereo and Intensity Stereo.


Mid-side Stereo

Mid-side stereo coding calculates a "mid"-channel by addition of left and right channel, and a "side"-channel, i.e.:



Whenever a signal is concentrated in the middle of the stereo image (i.e. more mono-like), mid-side stereo can achieve a significant saving in bitrate, since one can use less bitrate to encode the side-channel. Even more important is the fact that by applying the inverse matrix in the decoder the quantization noise becomes correlated and falls in the middle of the stereo image where it is masked by the signal.

Unlike intensity stereo which destroys phase information, mid-side coding keeps the phase information pretty much intact. Correctly implemented mid-side stereo does very little or no damage to the stereo-image and increases compression efficiency either by reducing size or increasing overall quality.


Intensity Stereo

Intensity stereo coding is a method that achieves a saving in bitrate by replacing the left and the right signal by a single representing signal plus directional information. This replacement is psychoacoustically justified in the higher frequency range since the human auditory system is insensitive to the signal phase at frequencies above approximately 2kHz.

Intensity stereo is by definition a lossy coding method thus it is primarily useful at low bitrates. For coding at higher bitrates only mid-side stereo should be used.


Additional information

Some more details about joint stereo & mid-side coding:

  • Bugs and/or not-optimized encoders may implement mid-side coding incorrectly, making mid-side coding sounds worse than simple stereo, while in reality (see the formulas above) there should be no difference in quality between mid-side stereo and simple stereo.
  • Modern/optimized encoders will use mid-side coding or simple stereo coding as necessary, depending on the correlation between the Left and Right channels.


External Links

  • High Quality Audio guides -- written by user
    Note: Despite this page's recommendation for encoding in MPC, please be aware that in recent listening tests, other encodings are also proven to be at least as good as MPC, if not better.