File Format for UHJ

The ".uhj" Format

Pithy saying is loading (requires JavaScript) ...

Pithy Sayings


Many transmission media (LP, FM radio, CD) are two-channel and, unfortunately, it is impossible to obtain reasonable surround sound using only two of the B-Format signals. To overcome this, two-channel UHJ matrix encoding was developed. Not only can two-channel UHJ be decoded back into horizontal surround sound, but it is also mono and stereo compatible.

An official file format for downloadable two-channel UHJ files has been defined to allow easy exchange of audio files. The file format is in the public domain for anybody to use.

The AMBU chunk structure

The format includes a soundfile information chunk that is added to two-channel WAVE-EX and WAVE soundfiles to indicate the soundfile is UHJ encoded. WAVE-EX is the preferred format. As unrecognized chunks are always skipped, use of this chunk maintains stereo compatibility.

The AMBU chunk has the following structure:

typedef struct
{
    char          ID[4];     /* 'AMBU' */
    unsignedInt32 dataSize;  /* the size of the chunk */
    unsignedInt32 version;   /* version of the AMBU chunk */
}   AMBUchunk;
<AMBUchunk.ID>
The four-character array 'AMBU', for chunk identification.
<AMBUchunk.dataSize>
The size of the data section of the chunk. This is 4 bytes (and does not include the 8 bytes used by <AMBUchunk.ID> and <AMBUchunk.dataSize>).
<AMBUchunk.version>
Indicates the version of the AMBU chunk. This allows anything after <AMBUchunk.version> to be redefined for future needs. This document describes version 1.

File extension

The file extension is ".uhj". This is to allow the operating system to route UHJ files to an Ambisonic decoder. Note that when creating files, software must use this file extension. However, when reading files, software should peek inside any WAVE or WAVE-EX file, irrespective of its extension, to see if it contains the AMBU chunk. (This is an example of the robustness principle, "Be liberal in what you read, and conservative in what you write".)

Other details

Many people already offer plug-ins and other Ambisonic software. Such people are encouraged to support the above format (in addition to other formats).

Mono and Stereo Compatibility

When two-channel UHJ is played in stereo, the front- and side-stage material is reproduced with sharply defined images. The rear-stage material is reproduced, but given a less focused, more "recessed" quality. This helps to provide an audible distinction between front and rear sounds when played in stereo.

When two-channel UHJ is played in mono, sounds from all directions, including due back, are reproduced in the single speaker at a level within 5 dB of one another.

Encoding from B-Format

Two-channel UHJ is produced from first-order horizontal B-Format using the following equations (where j is a +90 degree phase shift):

W' = W*sqrt(2)
S = 0.9396926*W' + 0.1855740*X
D = j(-0.3420201*W' + 0.5098604*X) + 0.6554516*Y
Left = (S + D)/2.0
Right = (S - D)/2.0

UHJ with more than two channels

UHJ is a hierarchy of stereo compatible standards for 2, 2.5, 3 and 4 transmission channels, termed BHJ, SHJ, THJ and PHJ, respectively. The extra channels are used to augment the two base channels to give improved horizontal surround sound and, for four-channel UHJ, full-sphere surround sound.

Unfortunately, files containing more than two channels do not play on stereo systems. Further, on multi-channel systems, the audio device renders the extra channels to output ports not in use. This can happen even when the extra channels are masked off. Therefore, such files can not be made stereo compatible. As the only advantage of UHJ over B-Format is stereo compatibility, it is suggested that three- and four-channel UHJ material be converted to B-Format in the ".amb" file format.

2.5 channel UHJ (where the .5 is a third channel band limited to 5 kHz) cannot be converted to B-Format. However, as no material is known to exist in this format that does not also exist in B-Format, this is not a problem.


Ambisonic file formats


Webmaster: / martin.leeseAT_SINGstanfordalumni.org