https://wiki.xiph.org/api.php?action=feedcontributions&user=Etienne&feedformat=atomXiphWiki - User contributions [en]2024-03-28T16:10:52ZUser contributionsMediaWiki 1.40.1https://wiki.xiph.org/index.php?title=Ambisonics&diff=6531Ambisonics2007-04-11T04:59:58Z<p>Etienne: /* Resources on Ambisonics */</p>
<hr />
<div>'''Ambisonics''' is a surround sound system first developed in the 1970s. <br />
Its main difference from other surround techniques is that it separates <br />
transmission channels from speaker feeds, the speaker feeds being derived <br />
using a decoder situated in the living room. Decoders can be implemented <br />
in either hardware or software. Typically more speakers are used than <br />
transmission channels, and the more speakers used then the more stable the <br />
resulting soundfield. Speakers can be arranged in a number of configurations, <br />
regular polygons being the most popular.<br />
<br />
Ambisonic files can come in a number of different formats. The main one is <br />
called B-Format, the other formats being derived from this. UHJ format is <br />
mono- and stereo-compatible. G-Format is a set of speaker feeds, so can be <br />
enjoyed in surround sound without the need for a decoder in the living room.<br />
<br />
== Ambisonics and 5.1 ==<br />
Ambisonics and conventional 5.1 surround sound are very different. 5.1 is a <br />
set speaker feeds, the signal only being fully defined for sounds coming <br />
from a speaker. Phantom images between speakers can be created, but the <br />
technique to do so is left unspecified. Many 5.1 releases use pair-wise <br />
mixing to create phantom images. This is understandable as almost all <br />
stereo recordings are mixed using pair-wise mixing.<br />
<br />
Pair-wise mixing is also called "pan-potting", "amplitude mixing" and <br />
"intensity stereophony". It mixes signals into the feeds for a pair of <br />
speakers to create the illusion that a sound is coming from a point <br />
somewhere between the speakers. During mixing, the apparent location of <br />
each sound is determined only by the relative amplitude of that sound in <br />
the two speakers.<br />
<br />
Unfortunately, pair-wise mixing works poorly when the speakers are to the <br />
rear of the listener and not-at-all when they are to one side. You can <br />
demonstrate this for yourself by performing <br />
[http://members.tripod.com/martin_leese/Ambisonic/exper.html a very simple experiment].<br />
Pair-wise mixing did not work in the quadraphonic era and it will not work <br />
now. Such an absolute statement can be made because the way that humans <br />
localise sound has not changed.<br />
<br />
Ambisonics is fundamentally different from 5.1. What is encoded in <br />
Ambisonics is not speaker feeds, but ''direction''. When mixing in <br />
Ambisonics, the positions of the speakers are unknown <br />
''and are of no interest''. Further, when Ambisonics is decoded to speaker <br />
feeds, all of the speakers cooperate to localise a sound in its correct <br />
position. The speakers all contribute to the creation of a single coherent <br />
soundfield.<br />
<br />
=== Ambisonics to 5.1 ===<br />
Converting Ambisonics to 5.1 is straightforward, and is discussed below <br />
(see [[#G-Format|G-Format]]).<br />
<br />
=== 5.1 to Ambisonics ===<br />
Converting 5.1 to Ambisonics is more difficult. It is easy to make the <br />
five speaker feeds phantom images, called "virtual speakers". (The ".1" <br />
channel can be folded into W.) The problem with this is that even if the <br />
Ambisonic rendering is perfect, the result will only be as good as the <br />
original 5.1 played through ''real'' speakers. It will not be an <br />
improvement. Nobody has yet come up with a way for Ambisonics to improve <br />
5.1; 5.1 is simply too broken.<br />
<br />
== B-Format ==<br />
B-Format is a single coherent soundfield composed of a set of related <br />
channels. The number of channels used depends on whether the soundfiled <br />
is horizontal-only or full-sphere, and on the order. These B-Format <br />
channels are transmission channels, not speaker feeds. Listening to <br />
B-Format requires a decoder in your living room. Some numbers of <br />
channels are tabulated below.<br />
<br />
=== Channel correlation ===<br />
The correlation between B-Format channels depends on the content. <br />
Four-channel B-Format (which [[OggPCM]] supports) consists of an <br />
omni-directional component, called W, and three figure-of-eight <br />
components pointing forward, left and up, called X, Y, Z. <br />
([http://members.tripod.com/martin_leese/Ambisonic/Harmonic.html Pictures are available].) <br />
Three-channel, horizontal-only B-Format simply omits the Z channel. This <br />
means that anything in X also appears in W. Same for Y and Z. (W is <br />
omni-directional; everything appears in W.) Also, if content comes from <br />
Front-Left then it appears equally in X and Y. Same for content from <br />
Front-Right, Back-Left, Back-Right; only the relative polarities change. <br />
So there can be a lot of correlation between B-Format channels, but it is <br />
content dependent.<br />
<br />
One problem with B-Format is that it is big on phase. The phase <br />
relationships between the different B-Format channels are important if <br />
the resulting soundfield is to correctly "gel". This may be a problem when <br />
B-Format channels are compressed using lossy compression.<br />
<br />
==== Coupling recommendations ====<br />
<small>Shamefully mangled by [[User:Gmaxwell|Gmaxwell]] from [http://lists.xiph.org/pipermail/vorbis-dev/2007-February/018655.html Richard Lee's Feb 4th vorbis-dev post]</small><br />
<blockquote>The Ambisonic B-format WXYZ channels should be should be lossless coupled together over most of the frequency range. This will give the most gain as W "usually" has everything that XYZ has. A perfect B-format signal has scaled versions of XYZ in W.<br/><br />
<br />
We allow "4 phase coupling" at higher frequencies. A perfect B-format set of WXYZ should only have real relation to each other. <br/><br />
<br />
<br />
This falls down at LF and close sources and sometimes when you are recording organ pedal notes. But lossless coupling at LF is cheap. This also falls down for diffuse field. It is possible that the pseudo random differences in response of a real Soundfield in different directions above 10khz may preserve enough of the "random" nature of reverb to be acceptable without needing full random phase.<br/><br />
<br />
'''The deviations from perfection can take 2 forms''':<br />
<br />
#Minimum Phase deviations of XYZ from W. These start happening above about 6kHz with present Soundfields.<br />
#Random Phase deviations of XYZ from W. These occur at High Frequencies when a real Soundfield Mike no longer has flat frequency response in all directions. Above 10kHz with present Soundfields.<br />
<br />
B-format from Ambisonically panned material (as opposed to natural Soundfield recordings) will be perfectly in phase so this recommendation will not result in loss.<br />
<br />
<br />
This needs investigating. Presently no Ambisonic effects units use "phase" at High Frequencies but this should not be ruled out.<br />
<br />
*Allowing "4 phase" above 18kHz, like default Dolby Digital at 448kb/s, is likely to be undetectable on present Soundfield recordings.<br />
<br />
*Allowing "4 phase" down to 10kHz might force the random phase deviations of a real Soundfield mike to be real and MAY result in better results. This needs investigating.<br />
<br />
*"Point phase" coupling should be avoided<br />
</blockquote><br />
<br />
There is a file specification in use for downloadable B-Format files <br />
called the <br />
[http://www.ambisonia.com/Members/mleese/file-format-for-b-format/ ".amb" specification].<br />
<br />
=== Limitations of the ".amb" specification ===<br />
The [http://www.ambisonia.com/Members/mleese/file-format-for-b-format/ ".amb" specification] <br />
for downloadable B-Format files is based on the WAVE-EX format. There are <br />
currently over 85 pieces available in this format <br />
[http://www.ambisonia.com for free download]. Most of these are <br />
first-order full-sphere soundfields. (The same website also has details of <br />
[http://www.ambisonia.com/Members/etienne/ambisonic-software/ ad hoc software decoders].) <br />
Some of the limitations of the specification are: <br />
<br />
#It is limited to 4 GByte files (2 GBytes if somebody screwed up).<br />
#It is limited to third-order soundfields and below. While third-order looks like a lot (16 channels), there already exists a prototype mic that can record up to fourth-order (25 channels).<br />
#No compression (particularly lossless).<br />
<br />
The reason that the ".amb" file specification is limited to third-order <br />
and below is because it uses the number of channels to uniquely define the <br />
soundfield order. Unfortunately this simple and elegant scheme does not <br />
work above third-order as ambiguities creep in. (One ambiguity is <br />
illustrated in the table below.)<br />
<br />
A more general file format will have to use something else, such as <br />
''Malham notation'', or storing both the horizontal-order and <br />
height-order. There is a one-to-one correspondence between Malham notation <br />
and the pair of orders, and either can generate the number of channels.<br />
<br />
==== Malham notation ====<br />
Malham notation specifies the order of a B-Format soundfield using a <br />
string of characters, each character being either '''f''' (for full-sphere) <br />
or '''h''' (for horizontal). The first character in the string specifies <br />
the type of the first-order components, the second character the type of <br />
the second-order components, etc.<br />
<br />
{| class="wikitable" style="text-align:center"<br />
|<br />
|-<br />
!<span style="font-size:80%">Horizontal<br>order</span><br />
!<span style="font-size:80%">Height<br>order</span><br />
!<span style="font-size:80%">Soundfield_type</span><br />
!<span style="font-size:80%">Malham<br>notation</span><br />
!<span style="font-size:80%">Number<br>of_channels</span><br />
!<span style="font-size:80%">Channels</span><br />
|-<br />
| 1|| 0||horizontal||'''h'''|| 3||WXY<br />
|-<br />
| 1|| 1||full-sphere||'''f'''|| 4||WXYZ<br />
|-<br />
| 2|| 0||horizontal||'''hh'''|| 5||WXYRS<br />
|-<br />
| 2|| 1||mixed-order||'''fh'''|| 6||WXYZRS<br />
|-<br />
| 2|| 2||full-sphere||'''ff'''|| 9||WXYZRSTUV<br />
|-<br />
| 3|| 0||horizontal||'''hhh'''|| 7||WXYRSPQ<br />
|-<br />
| 3|| 1||mixed-order||'''fhh'''|| 8||WXYZRSPQ<br />
|-<br />
| 3|| 2||mixed-order||'''ffh'''|| 11||WXYZRSTUVPQ<br />
|-<br />
| 3|| 3||full-sphere||'''fff'''|| 16||WXYZRSTUVKLMNOPQ<br />
|-<br />
| 4|| 0||horizontal||'''hhhh'''|| 9||extra channels unlabled<br />
|}<br />
<br />
=== Default channel conversions from B-Format ===<br />
Converting a B-Format file to a mono file is straightforward. Use Mono = <br />
W*sqrt(2).<br />
<br />
Converting a B-Format file to a stereo file is more difficult. The "proper" <br />
way to do this is to convert the W,X,Y channels to two-channel UHJ. <br />
Unfortunately this requires the use of wide-band 90-degree phase shifters. <br />
In the digital domain these are usually implemented as convolution filters.<br />
<br />
Assuming 90-degree phase shifters are unavailable then the problem is one of <br />
choice. Starting from B-Format, it is possible to synthesize ''any'' mic <br />
response pointing in ''any'' direction. Hence, it is possible to synthesize <br />
''all'' coincident stereo mic techniques. Two popular stereo techniques are <br />
''Blumlein Mid-Side'' and ''Blumlien Crossed Pairs''.<br />
<br />
==== Blumlein Mid-Side ====<br />
<pre><br />
Mid = (W*sqrt(2)) + X /*This is a cardioid response pointing forward*/<br />
Left = Mid + Y<br />
Right = Mid - Y<br />
</pre><br />
<br />
==== Blumlein Crossed Pairs ====<br />
<pre><br />
Left = (X + Y)/sqrt(2) /* (Left, Right) are just the (Y, X) */<br />
Right = (X - Y)/sqrt(2) /* responses rotated by -45 degrees */<br />
</pre><br />
<br />
Which conversion to stereo is better depends on the material and how it was <br />
recorded. A good suggestion is to not specify a ''particular'' default <br />
channel conversion; instead, simply specify that there must be one. If one <br />
has to be specified then Blumlein Crossed Pairs is the simpler.<br />
<br />
== UHJ format ==<br />
B-Format is the main format for Ambisonic files. However, B-Format is <br />
not mono- or stereo-compatible. This is why the UHJ hierarchical system <br />
was developed. Depending on the number of channels available, the UHJ <br />
system can carry more or less information, but at all times it is fully <br />
mono- and stereo-compatible. Up to four channels (Left, Right, T, Q) may <br />
be used. The T-channel can also be band-limited but, as this <br />
"2&frac12;-channel UHJ" was only ever used for FM radio transmission, it <br />
will not be discussed further.<br />
<br />
To listen to UHJ files in surround requires a decoder in your living room. <br />
Also, UHJ is restricted to first-order soundfields, either horizontal (two- <br />
and three-channel UHJ) or full-sphere (four-channel UHJ).<br />
<br />
Converting B-Format channels to UHJ channels, and vice versa, requires the <br />
use of wide-band 90-degree phase shifters. In the digital domain these <br />
are usually implemented as convolution filters. Conversion between <br />
four-channel B-Format (W, X, Y, Z) and four-channel UHJ (Left, Right, T, <br />
Q) can be accomplished without loss of information. The same with <br />
three-channel to three-channel (W, X, Y) <=> (Left, Right, T). It is <br />
possible to recover three-channel B-Format (W, X, Y) from two-channel UHJ <br />
(Left, Right), but not without loss. It is also important for the Ambisonic <br />
decoder to be aware that the B-Format channels were recovered from <br />
two-channel UHJ.<br />
<br />
Several hundred <br />
[http://members.cox.net/surround/uhjdisc/ambindex.htm two-channel UHJ LPs and CDs] <br />
have been released. Three- and four-channel UHJ recordings have never been <br />
commercially released.<br />
<br />
=== UHJ encoding and decoding equations ===<br />
<br />
==== Encoding ====<br />
<pre><br />
S = 0.9396926*W + 0.1855740*X<br />
D = j(-0.3420201*W + 0.5098604*X) + 0.6554516*Y<br />
<br />
Left = (S + D)/2.0<br />
Right = (S - D)/2.0<br />
T = j(-0.1432*W + 0.6512*X) - 0.7071*Y<br />
Q = 0.9772*Z<br />
<br />
where j is a +90 degree phase shift<br />
</pre><br />
<br />
==== Decoding ====<br />
For two-channel UHJ:<br />
<pre><br />
S = (Left + Right)/2.0<br />
D = (Left - Right)/2.0<br />
<br />
W = 0.982*S + j*0.164*D<br />
X = 0.419*S - j*0.828*D<br />
Y = 0.763*D + j*0.385*S<br />
<br />
where j is a +90 degree phase shift<br />
</pre><br />
<br />
For three- and four-channel UHJ:<br />
<pre><br />
S = (Left + Right)/2.0<br />
D = (Left - Right)/2.0<br />
<br />
W = 0.982*S + j*0.197(0.828*D + 0.768*T)<br />
X = 0.419*S - j(0.828*D + 0.768*T)<br />
Y = 0.796*D - 0.676*T + j*0.187*S<br />
Z = 1.023*Q<br />
<br />
where j is a +90 degree phase shift<br />
</pre><br />
<br />
There is a file specification for downloadable two-channel UHJ files <br />
called the <br />
[http://www.ambisonicbootlegs.net/Members/mleese/file-format-for-uhj/ ".uhj" specification], but it is not currently in use.<br />
<br />
=== Limitations of the ".uhj" specification ===<br />
The [http://www.ambisonicbootlegs.net/Members/mleese/file-format-for-uhj/ ".uhj" specification] <br />
for downloadable two-channel UHJ files is based on the WAVE or WAVE-EX <br />
format. A UHJ chunk is added to the file to indicate it is UHJ. As <br />
unrecognized chunks are always skipped, use of this chunk maintains stereo <br />
compatibility. Some of the limitations of the specification are: <br />
<br />
#It is limited to 4 GByte files (2 GBytes if somebody screwed up).<br />
#It is limited to two-channel UHJ files. Three- and four-channel UHJ are not accommodated.<br />
#No compression.<br />
<br />
The ".uhj" spcecification is only defined for two-channel UHJ to maintain <br />
stereo compatibility. While it would be possible to add the UHJ chunk to <br />
three- and four-channel WAVE-EX files, the recommendations from Microsoft <br />
for playing such files is that the audio device should render the extra <br />
channels to output ports not in use. This can happen even when the extra <br />
channels are masked off. (Put simply, in WAVE-EX files the channel mask <br />
does ''not'' mask channels.) Because of this, three- and four-channel <br />
WAVE-EX files can not be made stereo compatible.<br />
<br />
In the Xiph world, it should be possible to use default channel conversions <br />
to ensure that three- and four-channel UHJ files remain stereo compatible.<br />
<br />
=== Default channel conversions from UHJ ===<br />
Converting a UHJ file to a mono file is straightforward. Use Mono = <br />
(Left + Right)/2.<br />
<br />
Converting a UHJ file to a stereo file is even easier. Use Left = Left, Right = Right, and discard T and Q if present.<br />
<br />
== G-Format ==<br />
A G-Format file contains an Ambisonic soundfield pre-decoded to a set of <br />
speaker feeds. This allows listeners who do not own an Ambisonic decoder <br />
to enjoy Ambisonics. When producing the G-Format file, the sound engineer <br />
creates a set of speaker feeds for a particular number and arrangement of <br />
speakers. This is typically four speakers arranged in a square or five <br />
speakers arranged in a regular pentagon. However, other speaker arrangements <br />
are possible.<br />
<br />
A problem with playing G-Format recordings (and Ambisonics in general) is <br />
that the speakers used need to be phase matched. This is because, in <br />
Ambisonics, all speakers cooperate to localise sounds in any particular <br />
direction; there are no "surround speakers" as such. The easiest way to <br />
accomplish this is to use identical speakers. Unfortunately, many home <br />
theatre systems include a centre-front speaker which is different from the <br />
other speakers. It is noticeable that the G-Format recordings commercially <br />
released on DVD-A by [http://www.wyastone.co.uk/nrl/dvd.html Nimbus Records] <br />
are for four speakers in a square, the centre-front speaker being unused.<br />
<br />
G-Format files can also contain conversion coefficients to recover the <br />
original B-Format channels. The recovered B-Format channels can then be <br />
fed to a decoder in the listener's living room, and so accommodate a <br />
speaker arrangement different from the one used when the G-Format file <br />
was produced. Each B-Format channel is recovered using a weighted <br />
combination of the speaker feeds in the G-Format file.<br />
<br />
More details will follow later. A file format for downloadable G-Format <br />
files is being developed. As soon as it has been critiqued by the <br />
Ambisonic community, it will be described here (assuming it survives).<br />
<br />
=== Default channel conversions from G-Format ===<br />
Converting a G-Format file to a mono or stereo file is straightforward. <br />
First, recover the B-Format channels using the conversion coefficients <br />
contained in the file. Second, follow the advice given above for <br />
[[#Default channel conversions from B-Format|Default channel conversions from B-Format]].<br />
<br />
== Resources on Ambisonics ==<br />
*There is a set of [http://en.wikipedia.org/wiki/Ambisonics Wikipedia articles on Ambisonics].<br />
*Of particular relevance is the [http://www.ambisonia.com/Members/mleese/file-format-for-b-format/ ".amb" specification] in use for downloadable B-Format files. However the ".amb" spec has some limitations which it would be useful to overcome.<br />
*There is also the [http://www.ambisonia.com/Members/mleese/file-format-for-uhj/ ".uhj" specification] for downloadable two-channel UHJ files, but it is not currently in use. The ".uhj" spec also has some limitations which it would be useful to overcome.<br />
*[http://members.tripod.com/martin_leese/Ambisonic/ This website] has many pages on Ambisonics (including at the bottom links to other Ambisonic websites).<br />
*[http://www.ambisonic.net/ Ambisonic.Net website] includes a detailed series of descriptive and practical articles on current and past Ambisonic techniques with links to tools, other sites and additional material.<br />
*[http://www.ambisonia.com/Members/ricardo Richard Lee's page on Ambisonics], a few articles and samples.</div>Etiennehttps://wiki.xiph.org/index.php?title=Ambisonics&diff=6530Ambisonics2007-04-11T04:58:24Z<p>Etienne: /* Coupling recommendations */</p>
<hr />
<div>'''Ambisonics''' is a surround sound system first developed in the 1970s. <br />
Its main difference from other surround techniques is that it separates <br />
transmission channels from speaker feeds, the speaker feeds being derived <br />
using a decoder situated in the living room. Decoders can be implemented <br />
in either hardware or software. Typically more speakers are used than <br />
transmission channels, and the more speakers used then the more stable the <br />
resulting soundfield. Speakers can be arranged in a number of configurations, <br />
regular polygons being the most popular.<br />
<br />
Ambisonic files can come in a number of different formats. The main one is <br />
called B-Format, the other formats being derived from this. UHJ format is <br />
mono- and stereo-compatible. G-Format is a set of speaker feeds, so can be <br />
enjoyed in surround sound without the need for a decoder in the living room.<br />
<br />
== Ambisonics and 5.1 ==<br />
Ambisonics and conventional 5.1 surround sound are very different. 5.1 is a <br />
set speaker feeds, the signal only being fully defined for sounds coming <br />
from a speaker. Phantom images between speakers can be created, but the <br />
technique to do so is left unspecified. Many 5.1 releases use pair-wise <br />
mixing to create phantom images. This is understandable as almost all <br />
stereo recordings are mixed using pair-wise mixing.<br />
<br />
Pair-wise mixing is also called "pan-potting", "amplitude mixing" and <br />
"intensity stereophony". It mixes signals into the feeds for a pair of <br />
speakers to create the illusion that a sound is coming from a point <br />
somewhere between the speakers. During mixing, the apparent location of <br />
each sound is determined only by the relative amplitude of that sound in <br />
the two speakers.<br />
<br />
Unfortunately, pair-wise mixing works poorly when the speakers are to the <br />
rear of the listener and not-at-all when they are to one side. You can <br />
demonstrate this for yourself by performing <br />
[http://members.tripod.com/martin_leese/Ambisonic/exper.html a very simple experiment].<br />
Pair-wise mixing did not work in the quadraphonic era and it will not work <br />
now. Such an absolute statement can be made because the way that humans <br />
localise sound has not changed.<br />
<br />
Ambisonics is fundamentally different from 5.1. What is encoded in <br />
Ambisonics is not speaker feeds, but ''direction''. When mixing in <br />
Ambisonics, the positions of the speakers are unknown <br />
''and are of no interest''. Further, when Ambisonics is decoded to speaker <br />
feeds, all of the speakers cooperate to localise a sound in its correct <br />
position. The speakers all contribute to the creation of a single coherent <br />
soundfield.<br />
<br />
=== Ambisonics to 5.1 ===<br />
Converting Ambisonics to 5.1 is straightforward, and is discussed below <br />
(see [[#G-Format|G-Format]]).<br />
<br />
=== 5.1 to Ambisonics ===<br />
Converting 5.1 to Ambisonics is more difficult. It is easy to make the <br />
five speaker feeds phantom images, called "virtual speakers". (The ".1" <br />
channel can be folded into W.) The problem with this is that even if the <br />
Ambisonic rendering is perfect, the result will only be as good as the <br />
original 5.1 played through ''real'' speakers. It will not be an <br />
improvement. Nobody has yet come up with a way for Ambisonics to improve <br />
5.1; 5.1 is simply too broken.<br />
<br />
== B-Format ==<br />
B-Format is a single coherent soundfield composed of a set of related <br />
channels. The number of channels used depends on whether the soundfiled <br />
is horizontal-only or full-sphere, and on the order. These B-Format <br />
channels are transmission channels, not speaker feeds. Listening to <br />
B-Format requires a decoder in your living room. Some numbers of <br />
channels are tabulated below.<br />
<br />
=== Channel correlation ===<br />
The correlation between B-Format channels depends on the content. <br />
Four-channel B-Format (which [[OggPCM]] supports) consists of an <br />
omni-directional component, called W, and three figure-of-eight <br />
components pointing forward, left and up, called X, Y, Z. <br />
([http://members.tripod.com/martin_leese/Ambisonic/Harmonic.html Pictures are available].) <br />
Three-channel, horizontal-only B-Format simply omits the Z channel. This <br />
means that anything in X also appears in W. Same for Y and Z. (W is <br />
omni-directional; everything appears in W.) Also, if content comes from <br />
Front-Left then it appears equally in X and Y. Same for content from <br />
Front-Right, Back-Left, Back-Right; only the relative polarities change. <br />
So there can be a lot of correlation between B-Format channels, but it is <br />
content dependent.<br />
<br />
One problem with B-Format is that it is big on phase. The phase <br />
relationships between the different B-Format channels are important if <br />
the resulting soundfield is to correctly "gel". This may be a problem when <br />
B-Format channels are compressed using lossy compression.<br />
<br />
==== Coupling recommendations ====<br />
<small>Shamefully mangled by [[User:Gmaxwell|Gmaxwell]] from [http://lists.xiph.org/pipermail/vorbis-dev/2007-February/018655.html Richard Lee's Feb 4th vorbis-dev post]</small><br />
<blockquote>The Ambisonic B-format WXYZ channels should be should be lossless coupled together over most of the frequency range. This will give the most gain as W "usually" has everything that XYZ has. A perfect B-format signal has scaled versions of XYZ in W.<br/><br />
<br />
We allow "4 phase coupling" at higher frequencies. A perfect B-format set of WXYZ should only have real relation to each other. <br/><br />
<br />
<br />
This falls down at LF and close sources and sometimes when you are recording organ pedal notes. But lossless coupling at LF is cheap. This also falls down for diffuse field. It is possible that the pseudo random differences in response of a real Soundfield in different directions above 10khz may preserve enough of the "random" nature of reverb to be acceptable without needing full random phase.<br/><br />
<br />
'''The deviations from perfection can take 2 forms''':<br />
<br />
#Minimum Phase deviations of XYZ from W. These start happening above about 6kHz with present Soundfields.<br />
#Random Phase deviations of XYZ from W. These occur at High Frequencies when a real Soundfield Mike no longer has flat frequency response in all directions. Above 10kHz with present Soundfields.<br />
<br />
B-format from Ambisonically panned material (as opposed to natural Soundfield recordings) will be perfectly in phase so this recommendation will not result in loss.<br />
<br />
<br />
This needs investigating. Presently no Ambisonic effects units use "phase" at High Frequencies but this should not be ruled out.<br />
<br />
*Allowing "4 phase" above 18kHz, like default Dolby Digital at 448kb/s, is likely to be undetectable on present Soundfield recordings.<br />
<br />
*Allowing "4 phase" down to 10kHz might force the random phase deviations of a real Soundfield mike to be real and MAY result in better results. This needs investigating.<br />
<br />
*"Point phase" coupling should be avoided<br />
</blockquote><br />
<br />
There is a file specification in use for downloadable B-Format files <br />
called the <br />
[http://www.ambisonia.com/Members/mleese/file-format-for-b-format/ ".amb" specification].<br />
<br />
=== Limitations of the ".amb" specification ===<br />
The [http://www.ambisonia.com/Members/mleese/file-format-for-b-format/ ".amb" specification] <br />
for downloadable B-Format files is based on the WAVE-EX format. There are <br />
currently over 85 pieces available in this format <br />
[http://www.ambisonia.com for free download]. Most of these are <br />
first-order full-sphere soundfields. (The same website also has details of <br />
[http://www.ambisonia.com/Members/etienne/ambisonic-software/ ad hoc software decoders].) <br />
Some of the limitations of the specification are: <br />
<br />
#It is limited to 4 GByte files (2 GBytes if somebody screwed up).<br />
#It is limited to third-order soundfields and below. While third-order looks like a lot (16 channels), there already exists a prototype mic that can record up to fourth-order (25 channels).<br />
#No compression (particularly lossless).<br />
<br />
The reason that the ".amb" file specification is limited to third-order <br />
and below is because it uses the number of channels to uniquely define the <br />
soundfield order. Unfortunately this simple and elegant scheme does not <br />
work above third-order as ambiguities creep in. (One ambiguity is <br />
illustrated in the table below.)<br />
<br />
A more general file format will have to use something else, such as <br />
''Malham notation'', or storing both the horizontal-order and <br />
height-order. There is a one-to-one correspondence between Malham notation <br />
and the pair of orders, and either can generate the number of channels.<br />
<br />
==== Malham notation ====<br />
Malham notation specifies the order of a B-Format soundfield using a <br />
string of characters, each character being either '''f''' (for full-sphere) <br />
or '''h''' (for horizontal). The first character in the string specifies <br />
the type of the first-order components, the second character the type of <br />
the second-order components, etc.<br />
<br />
{| class="wikitable" style="text-align:center"<br />
|<br />
|-<br />
!<span style="font-size:80%">Horizontal<br>order</span><br />
!<span style="font-size:80%">Height<br>order</span><br />
!<span style="font-size:80%">Soundfield_type</span><br />
!<span style="font-size:80%">Malham<br>notation</span><br />
!<span style="font-size:80%">Number<br>of_channels</span><br />
!<span style="font-size:80%">Channels</span><br />
|-<br />
| 1|| 0||horizontal||'''h'''|| 3||WXY<br />
|-<br />
| 1|| 1||full-sphere||'''f'''|| 4||WXYZ<br />
|-<br />
| 2|| 0||horizontal||'''hh'''|| 5||WXYRS<br />
|-<br />
| 2|| 1||mixed-order||'''fh'''|| 6||WXYZRS<br />
|-<br />
| 2|| 2||full-sphere||'''ff'''|| 9||WXYZRSTUV<br />
|-<br />
| 3|| 0||horizontal||'''hhh'''|| 7||WXYRSPQ<br />
|-<br />
| 3|| 1||mixed-order||'''fhh'''|| 8||WXYZRSPQ<br />
|-<br />
| 3|| 2||mixed-order||'''ffh'''|| 11||WXYZRSTUVPQ<br />
|-<br />
| 3|| 3||full-sphere||'''fff'''|| 16||WXYZRSTUVKLMNOPQ<br />
|-<br />
| 4|| 0||horizontal||'''hhhh'''|| 9||extra channels unlabled<br />
|}<br />
<br />
=== Default channel conversions from B-Format ===<br />
Converting a B-Format file to a mono file is straightforward. Use Mono = <br />
W*sqrt(2).<br />
<br />
Converting a B-Format file to a stereo file is more difficult. The "proper" <br />
way to do this is to convert the W,X,Y channels to two-channel UHJ. <br />
Unfortunately this requires the use of wide-band 90-degree phase shifters. <br />
In the digital domain these are usually implemented as convolution filters.<br />
<br />
Assuming 90-degree phase shifters are unavailable then the problem is one of <br />
choice. Starting from B-Format, it is possible to synthesize ''any'' mic <br />
response pointing in ''any'' direction. Hence, it is possible to synthesize <br />
''all'' coincident stereo mic techniques. Two popular stereo techniques are <br />
''Blumlein Mid-Side'' and ''Blumlien Crossed Pairs''.<br />
<br />
==== Blumlein Mid-Side ====<br />
<pre><br />
Mid = (W*sqrt(2)) + X /*This is a cardioid response pointing forward*/<br />
Left = Mid + Y<br />
Right = Mid - Y<br />
</pre><br />
<br />
==== Blumlein Crossed Pairs ====<br />
<pre><br />
Left = (X + Y)/sqrt(2) /* (Left, Right) are just the (Y, X) */<br />
Right = (X - Y)/sqrt(2) /* responses rotated by -45 degrees */<br />
</pre><br />
<br />
Which conversion to stereo is better depends on the material and how it was <br />
recorded. A good suggestion is to not specify a ''particular'' default <br />
channel conversion; instead, simply specify that there must be one. If one <br />
has to be specified then Blumlein Crossed Pairs is the simpler.<br />
<br />
== UHJ format ==<br />
B-Format is the main format for Ambisonic files. However, B-Format is <br />
not mono- or stereo-compatible. This is why the UHJ hierarchical system <br />
was developed. Depending on the number of channels available, the UHJ <br />
system can carry more or less information, but at all times it is fully <br />
mono- and stereo-compatible. Up to four channels (Left, Right, T, Q) may <br />
be used. The T-channel can also be band-limited but, as this <br />
"2&frac12;-channel UHJ" was only ever used for FM radio transmission, it <br />
will not be discussed further.<br />
<br />
To listen to UHJ files in surround requires a decoder in your living room. <br />
Also, UHJ is restricted to first-order soundfields, either horizontal (two- <br />
and three-channel UHJ) or full-sphere (four-channel UHJ).<br />
<br />
Converting B-Format channels to UHJ channels, and vice versa, requires the <br />
use of wide-band 90-degree phase shifters. In the digital domain these <br />
are usually implemented as convolution filters. Conversion between <br />
four-channel B-Format (W, X, Y, Z) and four-channel UHJ (Left, Right, T, <br />
Q) can be accomplished without loss of information. The same with <br />
three-channel to three-channel (W, X, Y) <=> (Left, Right, T). It is <br />
possible to recover three-channel B-Format (W, X, Y) from two-channel UHJ <br />
(Left, Right), but not without loss. It is also important for the Ambisonic <br />
decoder to be aware that the B-Format channels were recovered from <br />
two-channel UHJ.<br />
<br />
Several hundred <br />
[http://members.cox.net/surround/uhjdisc/ambindex.htm two-channel UHJ LPs and CDs] <br />
have been released. Three- and four-channel UHJ recordings have never been <br />
commercially released.<br />
<br />
=== UHJ encoding and decoding equations ===<br />
<br />
==== Encoding ====<br />
<pre><br />
S = 0.9396926*W + 0.1855740*X<br />
D = j(-0.3420201*W + 0.5098604*X) + 0.6554516*Y<br />
<br />
Left = (S + D)/2.0<br />
Right = (S - D)/2.0<br />
T = j(-0.1432*W + 0.6512*X) - 0.7071*Y<br />
Q = 0.9772*Z<br />
<br />
where j is a +90 degree phase shift<br />
</pre><br />
<br />
==== Decoding ====<br />
For two-channel UHJ:<br />
<pre><br />
S = (Left + Right)/2.0<br />
D = (Left - Right)/2.0<br />
<br />
W = 0.982*S + j*0.164*D<br />
X = 0.419*S - j*0.828*D<br />
Y = 0.763*D + j*0.385*S<br />
<br />
where j is a +90 degree phase shift<br />
</pre><br />
<br />
For three- and four-channel UHJ:<br />
<pre><br />
S = (Left + Right)/2.0<br />
D = (Left - Right)/2.0<br />
<br />
W = 0.982*S + j*0.197(0.828*D + 0.768*T)<br />
X = 0.419*S - j(0.828*D + 0.768*T)<br />
Y = 0.796*D - 0.676*T + j*0.187*S<br />
Z = 1.023*Q<br />
<br />
where j is a +90 degree phase shift<br />
</pre><br />
<br />
There is a file specification for downloadable two-channel UHJ files <br />
called the <br />
[http://www.ambisonicbootlegs.net/Members/mleese/file-format-for-uhj/ ".uhj" specification], but it is not currently in use.<br />
<br />
=== Limitations of the ".uhj" specification ===<br />
The [http://www.ambisonicbootlegs.net/Members/mleese/file-format-for-uhj/ ".uhj" specification] <br />
for downloadable two-channel UHJ files is based on the WAVE or WAVE-EX <br />
format. A UHJ chunk is added to the file to indicate it is UHJ. As <br />
unrecognized chunks are always skipped, use of this chunk maintains stereo <br />
compatibility. Some of the limitations of the specification are: <br />
<br />
#It is limited to 4 GByte files (2 GBytes if somebody screwed up).<br />
#It is limited to two-channel UHJ files. Three- and four-channel UHJ are not accommodated.<br />
#No compression.<br />
<br />
The ".uhj" spcecification is only defined for two-channel UHJ to maintain <br />
stereo compatibility. While it would be possible to add the UHJ chunk to <br />
three- and four-channel WAVE-EX files, the recommendations from Microsoft <br />
for playing such files is that the audio device should render the extra <br />
channels to output ports not in use. This can happen even when the extra <br />
channels are masked off. (Put simply, in WAVE-EX files the channel mask <br />
does ''not'' mask channels.) Because of this, three- and four-channel <br />
WAVE-EX files can not be made stereo compatible.<br />
<br />
In the Xiph world, it should be possible to use default channel conversions <br />
to ensure that three- and four-channel UHJ files remain stereo compatible.<br />
<br />
=== Default channel conversions from UHJ ===<br />
Converting a UHJ file to a mono file is straightforward. Use Mono = <br />
(Left + Right)/2.<br />
<br />
Converting a UHJ file to a stereo file is even easier. Use Left = Left, Right = Right, and discard T and Q if present.<br />
<br />
== G-Format ==<br />
A G-Format file contains an Ambisonic soundfield pre-decoded to a set of <br />
speaker feeds. This allows listeners who do not own an Ambisonic decoder <br />
to enjoy Ambisonics. When producing the G-Format file, the sound engineer <br />
creates a set of speaker feeds for a particular number and arrangement of <br />
speakers. This is typically four speakers arranged in a square or five <br />
speakers arranged in a regular pentagon. However, other speaker arrangements <br />
are possible.<br />
<br />
A problem with playing G-Format recordings (and Ambisonics in general) is <br />
that the speakers used need to be phase matched. This is because, in <br />
Ambisonics, all speakers cooperate to localise sounds in any particular <br />
direction; there are no "surround speakers" as such. The easiest way to <br />
accomplish this is to use identical speakers. Unfortunately, many home <br />
theatre systems include a centre-front speaker which is different from the <br />
other speakers. It is noticeable that the G-Format recordings commercially <br />
released on DVD-A by [http://www.wyastone.co.uk/nrl/dvd.html Nimbus Records] <br />
are for four speakers in a square, the centre-front speaker being unused.<br />
<br />
G-Format files can also contain conversion coefficients to recover the <br />
original B-Format channels. The recovered B-Format channels can then be <br />
fed to a decoder in the listener's living room, and so accommodate a <br />
speaker arrangement different from the one used when the G-Format file <br />
was produced. Each B-Format channel is recovered using a weighted <br />
combination of the speaker feeds in the G-Format file.<br />
<br />
More details will follow later. A file format for downloadable G-Format <br />
files is being developed. As soon as it has been critiqued by the <br />
Ambisonic community, it will be described here (assuming it survives).<br />
<br />
=== Default channel conversions from G-Format ===<br />
Converting a G-Format file to a mono or stereo file is straightforward. <br />
First, recover the B-Format channels using the conversion coefficients <br />
contained in the file. Second, follow the advice given above for <br />
[[#Default channel conversions from B-Format|Default channel conversions from B-Format]].<br />
<br />
== Resources on Ambisonics ==<br />
*There is a set of [http://en.wikipedia.org/wiki/Ambisonics Wikipedia articles on Ambisonics].<br />
*Of particular relevance is the [http://www.ambisonicbootlegs.net/Members/mleese/file-format-for-b-format/ ".amb" specification] in use for downloadable B-Format files. However the ".amb" spec has some limitations which it would be useful to overcome.<br />
*There is also the [http://www.ambisonicbootlegs.net/Members/mleese/file-format-for-uhj/ ".uhj" specification] for downloadable two-channel UHJ files, but it is not currently in use. The ".uhj" spec also has some limitations which it would be useful to overcome.<br />
*[http://members.tripod.com/martin_leese/Ambisonic/ This website] has many pages on Ambisonics (including at the bottom links to other Ambisonic websites).<br />
*[http://www.ambisonic.net/ Ambisonic.Net website] includes a detailed series of descriptive and practical articles on current and past Ambisonic techniques with links to tools, other sites and additional material.<br />
*[http://www.ambisonicbootlegs.net/Members/ricardo Richard Lee's page on Ambisonics], a few articles and samples.</div>Etiennehttps://wiki.xiph.org/index.php?title=Ambisonics&diff=6529Ambisonics2007-04-11T04:57:44Z<p>Etienne: /* Limitations of the ".amb" specification */</p>
<hr />
<div>'''Ambisonics''' is a surround sound system first developed in the 1970s. <br />
Its main difference from other surround techniques is that it separates <br />
transmission channels from speaker feeds, the speaker feeds being derived <br />
using a decoder situated in the living room. Decoders can be implemented <br />
in either hardware or software. Typically more speakers are used than <br />
transmission channels, and the more speakers used then the more stable the <br />
resulting soundfield. Speakers can be arranged in a number of configurations, <br />
regular polygons being the most popular.<br />
<br />
Ambisonic files can come in a number of different formats. The main one is <br />
called B-Format, the other formats being derived from this. UHJ format is <br />
mono- and stereo-compatible. G-Format is a set of speaker feeds, so can be <br />
enjoyed in surround sound without the need for a decoder in the living room.<br />
<br />
== Ambisonics and 5.1 ==<br />
Ambisonics and conventional 5.1 surround sound are very different. 5.1 is a <br />
set speaker feeds, the signal only being fully defined for sounds coming <br />
from a speaker. Phantom images between speakers can be created, but the <br />
technique to do so is left unspecified. Many 5.1 releases use pair-wise <br />
mixing to create phantom images. This is understandable as almost all <br />
stereo recordings are mixed using pair-wise mixing.<br />
<br />
Pair-wise mixing is also called "pan-potting", "amplitude mixing" and <br />
"intensity stereophony". It mixes signals into the feeds for a pair of <br />
speakers to create the illusion that a sound is coming from a point <br />
somewhere between the speakers. During mixing, the apparent location of <br />
each sound is determined only by the relative amplitude of that sound in <br />
the two speakers.<br />
<br />
Unfortunately, pair-wise mixing works poorly when the speakers are to the <br />
rear of the listener and not-at-all when they are to one side. You can <br />
demonstrate this for yourself by performing <br />
[http://members.tripod.com/martin_leese/Ambisonic/exper.html a very simple experiment].<br />
Pair-wise mixing did not work in the quadraphonic era and it will not work <br />
now. Such an absolute statement can be made because the way that humans <br />
localise sound has not changed.<br />
<br />
Ambisonics is fundamentally different from 5.1. What is encoded in <br />
Ambisonics is not speaker feeds, but ''direction''. When mixing in <br />
Ambisonics, the positions of the speakers are unknown <br />
''and are of no interest''. Further, when Ambisonics is decoded to speaker <br />
feeds, all of the speakers cooperate to localise a sound in its correct <br />
position. The speakers all contribute to the creation of a single coherent <br />
soundfield.<br />
<br />
=== Ambisonics to 5.1 ===<br />
Converting Ambisonics to 5.1 is straightforward, and is discussed below <br />
(see [[#G-Format|G-Format]]).<br />
<br />
=== 5.1 to Ambisonics ===<br />
Converting 5.1 to Ambisonics is more difficult. It is easy to make the <br />
five speaker feeds phantom images, called "virtual speakers". (The ".1" <br />
channel can be folded into W.) The problem with this is that even if the <br />
Ambisonic rendering is perfect, the result will only be as good as the <br />
original 5.1 played through ''real'' speakers. It will not be an <br />
improvement. Nobody has yet come up with a way for Ambisonics to improve <br />
5.1; 5.1 is simply too broken.<br />
<br />
== B-Format ==<br />
B-Format is a single coherent soundfield composed of a set of related <br />
channels. The number of channels used depends on whether the soundfiled <br />
is horizontal-only or full-sphere, and on the order. These B-Format <br />
channels are transmission channels, not speaker feeds. Listening to <br />
B-Format requires a decoder in your living room. Some numbers of <br />
channels are tabulated below.<br />
<br />
=== Channel correlation ===<br />
The correlation between B-Format channels depends on the content. <br />
Four-channel B-Format (which [[OggPCM]] supports) consists of an <br />
omni-directional component, called W, and three figure-of-eight <br />
components pointing forward, left and up, called X, Y, Z. <br />
([http://members.tripod.com/martin_leese/Ambisonic/Harmonic.html Pictures are available].) <br />
Three-channel, horizontal-only B-Format simply omits the Z channel. This <br />
means that anything in X also appears in W. Same for Y and Z. (W is <br />
omni-directional; everything appears in W.) Also, if content comes from <br />
Front-Left then it appears equally in X and Y. Same for content from <br />
Front-Right, Back-Left, Back-Right; only the relative polarities change. <br />
So there can be a lot of correlation between B-Format channels, but it is <br />
content dependent.<br />
<br />
One problem with B-Format is that it is big on phase. The phase <br />
relationships between the different B-Format channels are important if <br />
the resulting soundfield is to correctly "gel". This may be a problem when <br />
B-Format channels are compressed using lossy compression.<br />
<br />
==== Coupling recommendations ====<br />
<small>Shamefully mangled by [[User:Gmaxwell|Gmaxwell]] from [http://lists.xiph.org/pipermail/vorbis-dev/2007-February/018655.html Richard Lee's Feb 4th vorbis-dev post]</small><br />
<blockquote>The Ambisonic B-format WXYZ channels should be should be lossless coupled together over most of the frequency range. This will give the most gain as W "usually" has everything that XYZ has. A perfect B-format signal has scaled versions of XYZ in W.<br/><br />
<br />
We allow "4 phase coupling" at higher frequencies. A perfect B-format set of WXYZ should only have real relation to each other. <br/><br />
<br />
<br />
This falls down at LF and close sources and sometimes when you are recording organ pedal notes. But lossless coupling at LF is cheap. This also falls down for diffuse field. It is possible that the pseudo random differences in response of a real Soundfield in different directions above 10khz may preserve enough of the "random" nature of reverb to be acceptable without needing full random phase.<br/><br />
<br />
'''The deviations from perfection can take 2 forms''':<br />
<br />
#Minimum Phase deviations of XYZ from W. These start happening above about 6kHz with present Soundfields.<br />
#Random Phase deviations of XYZ from W. These occur at High Frequencies when a real Soundfield Mike no longer has flat frequency response in all directions. Above 10kHz with present Soundfields.<br />
<br />
B-format from Ambisonically panned material (as opposed to natural Soundfield recordings) will be perfectly in phase so this recommendation will not result in loss.<br />
<br />
<br />
This needs investigating. Presently no Ambisonic effects units use "phase" at High Frequencies but this should not be ruled out.<br />
<br />
*Allowing "4 phase" above 18kHz, like default Dolby Digital at 448kb/s, is likely to be undetectable on present Soundfield recordings.<br />
<br />
*Allowing "4 phase" down to 10kHz might force the random phase deviations of a real Soundfield mike to be real and MAY result in better results. This needs investigating.<br />
<br />
*"Point phase" coupling should be avoided<br />
</blockquote><br />
<br />
There is a file specification in use for downloadable B-Format files <br />
called the <br />
[http://www.ambisonicbootlegs.net/Members/mleese/file-format-for-b-format/ ".amb" specification].<br />
<br />
=== Limitations of the ".amb" specification ===<br />
The [http://www.ambisonia.com/Members/mleese/file-format-for-b-format/ ".amb" specification] <br />
for downloadable B-Format files is based on the WAVE-EX format. There are <br />
currently over 85 pieces available in this format <br />
[http://www.ambisonia.com for free download]. Most of these are <br />
first-order full-sphere soundfields. (The same website also has details of <br />
[http://www.ambisonia.com/Members/etienne/ambisonic-software/ ad hoc software decoders].) <br />
Some of the limitations of the specification are: <br />
<br />
#It is limited to 4 GByte files (2 GBytes if somebody screwed up).<br />
#It is limited to third-order soundfields and below. While third-order looks like a lot (16 channels), there already exists a prototype mic that can record up to fourth-order (25 channels).<br />
#No compression (particularly lossless).<br />
<br />
The reason that the ".amb" file specification is limited to third-order <br />
and below is because it uses the number of channels to uniquely define the <br />
soundfield order. Unfortunately this simple and elegant scheme does not <br />
work above third-order as ambiguities creep in. (One ambiguity is <br />
illustrated in the table below.)<br />
<br />
A more general file format will have to use something else, such as <br />
''Malham notation'', or storing both the horizontal-order and <br />
height-order. There is a one-to-one correspondence between Malham notation <br />
and the pair of orders, and either can generate the number of channels.<br />
<br />
==== Malham notation ====<br />
Malham notation specifies the order of a B-Format soundfield using a <br />
string of characters, each character being either '''f''' (for full-sphere) <br />
or '''h''' (for horizontal). The first character in the string specifies <br />
the type of the first-order components, the second character the type of <br />
the second-order components, etc.<br />
<br />
{| class="wikitable" style="text-align:center"<br />
|<br />
|-<br />
!<span style="font-size:80%">Horizontal<br>order</span><br />
!<span style="font-size:80%">Height<br>order</span><br />
!<span style="font-size:80%">Soundfield_type</span><br />
!<span style="font-size:80%">Malham<br>notation</span><br />
!<span style="font-size:80%">Number<br>of_channels</span><br />
!<span style="font-size:80%">Channels</span><br />
|-<br />
| 1|| 0||horizontal||'''h'''|| 3||WXY<br />
|-<br />
| 1|| 1||full-sphere||'''f'''|| 4||WXYZ<br />
|-<br />
| 2|| 0||horizontal||'''hh'''|| 5||WXYRS<br />
|-<br />
| 2|| 1||mixed-order||'''fh'''|| 6||WXYZRS<br />
|-<br />
| 2|| 2||full-sphere||'''ff'''|| 9||WXYZRSTUV<br />
|-<br />
| 3|| 0||horizontal||'''hhh'''|| 7||WXYRSPQ<br />
|-<br />
| 3|| 1||mixed-order||'''fhh'''|| 8||WXYZRSPQ<br />
|-<br />
| 3|| 2||mixed-order||'''ffh'''|| 11||WXYZRSTUVPQ<br />
|-<br />
| 3|| 3||full-sphere||'''fff'''|| 16||WXYZRSTUVKLMNOPQ<br />
|-<br />
| 4|| 0||horizontal||'''hhhh'''|| 9||extra channels unlabled<br />
|}<br />
<br />
=== Default channel conversions from B-Format ===<br />
Converting a B-Format file to a mono file is straightforward. Use Mono = <br />
W*sqrt(2).<br />
<br />
Converting a B-Format file to a stereo file is more difficult. The "proper" <br />
way to do this is to convert the W,X,Y channels to two-channel UHJ. <br />
Unfortunately this requires the use of wide-band 90-degree phase shifters. <br />
In the digital domain these are usually implemented as convolution filters.<br />
<br />
Assuming 90-degree phase shifters are unavailable then the problem is one of <br />
choice. Starting from B-Format, it is possible to synthesize ''any'' mic <br />
response pointing in ''any'' direction. Hence, it is possible to synthesize <br />
''all'' coincident stereo mic techniques. Two popular stereo techniques are <br />
''Blumlein Mid-Side'' and ''Blumlien Crossed Pairs''.<br />
<br />
==== Blumlein Mid-Side ====<br />
<pre><br />
Mid = (W*sqrt(2)) + X /*This is a cardioid response pointing forward*/<br />
Left = Mid + Y<br />
Right = Mid - Y<br />
</pre><br />
<br />
==== Blumlein Crossed Pairs ====<br />
<pre><br />
Left = (X + Y)/sqrt(2) /* (Left, Right) are just the (Y, X) */<br />
Right = (X - Y)/sqrt(2) /* responses rotated by -45 degrees */<br />
</pre><br />
<br />
Which conversion to stereo is better depends on the material and how it was <br />
recorded. A good suggestion is to not specify a ''particular'' default <br />
channel conversion; instead, simply specify that there must be one. If one <br />
has to be specified then Blumlein Crossed Pairs is the simpler.<br />
<br />
== UHJ format ==<br />
B-Format is the main format for Ambisonic files. However, B-Format is <br />
not mono- or stereo-compatible. This is why the UHJ hierarchical system <br />
was developed. Depending on the number of channels available, the UHJ <br />
system can carry more or less information, but at all times it is fully <br />
mono- and stereo-compatible. Up to four channels (Left, Right, T, Q) may <br />
be used. The T-channel can also be band-limited but, as this <br />
"2&frac12;-channel UHJ" was only ever used for FM radio transmission, it <br />
will not be discussed further.<br />
<br />
To listen to UHJ files in surround requires a decoder in your living room. <br />
Also, UHJ is restricted to first-order soundfields, either horizontal (two- <br />
and three-channel UHJ) or full-sphere (four-channel UHJ).<br />
<br />
Converting B-Format channels to UHJ channels, and vice versa, requires the <br />
use of wide-band 90-degree phase shifters. In the digital domain these <br />
are usually implemented as convolution filters. Conversion between <br />
four-channel B-Format (W, X, Y, Z) and four-channel UHJ (Left, Right, T, <br />
Q) can be accomplished without loss of information. The same with <br />
three-channel to three-channel (W, X, Y) <=> (Left, Right, T). It is <br />
possible to recover three-channel B-Format (W, X, Y) from two-channel UHJ <br />
(Left, Right), but not without loss. It is also important for the Ambisonic <br />
decoder to be aware that the B-Format channels were recovered from <br />
two-channel UHJ.<br />
<br />
Several hundred <br />
[http://members.cox.net/surround/uhjdisc/ambindex.htm two-channel UHJ LPs and CDs] <br />
have been released. Three- and four-channel UHJ recordings have never been <br />
commercially released.<br />
<br />
=== UHJ encoding and decoding equations ===<br />
<br />
==== Encoding ====<br />
<pre><br />
S = 0.9396926*W + 0.1855740*X<br />
D = j(-0.3420201*W + 0.5098604*X) + 0.6554516*Y<br />
<br />
Left = (S + D)/2.0<br />
Right = (S - D)/2.0<br />
T = j(-0.1432*W + 0.6512*X) - 0.7071*Y<br />
Q = 0.9772*Z<br />
<br />
where j is a +90 degree phase shift<br />
</pre><br />
<br />
==== Decoding ====<br />
For two-channel UHJ:<br />
<pre><br />
S = (Left + Right)/2.0<br />
D = (Left - Right)/2.0<br />
<br />
W = 0.982*S + j*0.164*D<br />
X = 0.419*S - j*0.828*D<br />
Y = 0.763*D + j*0.385*S<br />
<br />
where j is a +90 degree phase shift<br />
</pre><br />
<br />
For three- and four-channel UHJ:<br />
<pre><br />
S = (Left + Right)/2.0<br />
D = (Left - Right)/2.0<br />
<br />
W = 0.982*S + j*0.197(0.828*D + 0.768*T)<br />
X = 0.419*S - j(0.828*D + 0.768*T)<br />
Y = 0.796*D - 0.676*T + j*0.187*S<br />
Z = 1.023*Q<br />
<br />
where j is a +90 degree phase shift<br />
</pre><br />
<br />
There is a file specification for downloadable two-channel UHJ files <br />
called the <br />
[http://www.ambisonicbootlegs.net/Members/mleese/file-format-for-uhj/ ".uhj" specification], but it is not currently in use.<br />
<br />
=== Limitations of the ".uhj" specification ===<br />
The [http://www.ambisonicbootlegs.net/Members/mleese/file-format-for-uhj/ ".uhj" specification] <br />
for downloadable two-channel UHJ files is based on the WAVE or WAVE-EX <br />
format. A UHJ chunk is added to the file to indicate it is UHJ. As <br />
unrecognized chunks are always skipped, use of this chunk maintains stereo <br />
compatibility. Some of the limitations of the specification are: <br />
<br />
#It is limited to 4 GByte files (2 GBytes if somebody screwed up).<br />
#It is limited to two-channel UHJ files. Three- and four-channel UHJ are not accommodated.<br />
#No compression.<br />
<br />
The ".uhj" spcecification is only defined for two-channel UHJ to maintain <br />
stereo compatibility. While it would be possible to add the UHJ chunk to <br />
three- and four-channel WAVE-EX files, the recommendations from Microsoft <br />
for playing such files is that the audio device should render the extra <br />
channels to output ports not in use. This can happen even when the extra <br />
channels are masked off. (Put simply, in WAVE-EX files the channel mask <br />
does ''not'' mask channels.) Because of this, three- and four-channel <br />
WAVE-EX files can not be made stereo compatible.<br />
<br />
In the Xiph world, it should be possible to use default channel conversions <br />
to ensure that three- and four-channel UHJ files remain stereo compatible.<br />
<br />
=== Default channel conversions from UHJ ===<br />
Converting a UHJ file to a mono file is straightforward. Use Mono = <br />
(Left + Right)/2.<br />
<br />
Converting a UHJ file to a stereo file is even easier. Use Left = Left, Right = Right, and discard T and Q if present.<br />
<br />
== G-Format ==<br />
A G-Format file contains an Ambisonic soundfield pre-decoded to a set of <br />
speaker feeds. This allows listeners who do not own an Ambisonic decoder <br />
to enjoy Ambisonics. When producing the G-Format file, the sound engineer <br />
creates a set of speaker feeds for a particular number and arrangement of <br />
speakers. This is typically four speakers arranged in a square or five <br />
speakers arranged in a regular pentagon. However, other speaker arrangements <br />
are possible.<br />
<br />
A problem with playing G-Format recordings (and Ambisonics in general) is <br />
that the speakers used need to be phase matched. This is because, in <br />
Ambisonics, all speakers cooperate to localise sounds in any particular <br />
direction; there are no "surround speakers" as such. The easiest way to <br />
accomplish this is to use identical speakers. Unfortunately, many home <br />
theatre systems include a centre-front speaker which is different from the <br />
other speakers. It is noticeable that the G-Format recordings commercially <br />
released on DVD-A by [http://www.wyastone.co.uk/nrl/dvd.html Nimbus Records] <br />
are for four speakers in a square, the centre-front speaker being unused.<br />
<br />
G-Format files can also contain conversion coefficients to recover the <br />
original B-Format channels. The recovered B-Format channels can then be <br />
fed to a decoder in the listener's living room, and so accommodate a <br />
speaker arrangement different from the one used when the G-Format file <br />
was produced. Each B-Format channel is recovered using a weighted <br />
combination of the speaker feeds in the G-Format file.<br />
<br />
More details will follow later. A file format for downloadable G-Format <br />
files is being developed. As soon as it has been critiqued by the <br />
Ambisonic community, it will be described here (assuming it survives).<br />
<br />
=== Default channel conversions from G-Format ===<br />
Converting a G-Format file to a mono or stereo file is straightforward. <br />
First, recover the B-Format channels using the conversion coefficients <br />
contained in the file. Second, follow the advice given above for <br />
[[#Default channel conversions from B-Format|Default channel conversions from B-Format]].<br />
<br />
== Resources on Ambisonics ==<br />
*There is a set of [http://en.wikipedia.org/wiki/Ambisonics Wikipedia articles on Ambisonics].<br />
*Of particular relevance is the [http://www.ambisonicbootlegs.net/Members/mleese/file-format-for-b-format/ ".amb" specification] in use for downloadable B-Format files. However the ".amb" spec has some limitations which it would be useful to overcome.<br />
*There is also the [http://www.ambisonicbootlegs.net/Members/mleese/file-format-for-uhj/ ".uhj" specification] for downloadable two-channel UHJ files, but it is not currently in use. The ".uhj" spec also has some limitations which it would be useful to overcome.<br />
*[http://members.tripod.com/martin_leese/Ambisonic/ This website] has many pages on Ambisonics (including at the bottom links to other Ambisonic websites).<br />
*[http://www.ambisonic.net/ Ambisonic.Net website] includes a detailed series of descriptive and practical articles on current and past Ambisonic techniques with links to tools, other sites and additional material.<br />
*[http://www.ambisonicbootlegs.net/Members/ricardo Richard Lee's page on Ambisonics], a few articles and samples.</div>Etienne