Skip to content. Skip to navigation
About- Blog- for contributors- Forum- Wiki- Podcasts- Google Maps- Members- Contact us
hello

The next generation
surround sound experience,
by the enthusiasts, for the
home theatre.
Personal tools
> Home Members mleese File Format for UHJ
Document Actions

File Format for UHJ

by Martin Leese last modified 2007-08-31 15:11
Contributors: Richard Dobson
Copyright: © 2005 by Martin J Leese, distribution is unlimited.

The official file format for downloadable two-channel UHJ files.

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. Here are the details:

  • 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. (Generic WAVE and WAVE-EX are defined at http://www.ambisonicbootlegs.net/Members/mleese/file-formats/.)

    The additional AMBU chunk has the following structure:

    typedef struct
    {
    char chunkID[4]; /* 'AMBU' */
    unsignedInt32 chunkDataSize; /* the size of the chunk */
    unsignedInt32 version; /* version of the AMBU chunk */
    } AMBUchunk;
    • <chunkID> is the four-character array 'AMBU', for chunk identification. (This was formerly 'UHJ '.)
    • <chunkDataSize> is the size of the data section of the chunk. This is 4 bytes for version 1 (and does not include the 8 bytes used by chunkID and chunkDataSize).
    • <version> indicates the version of the AMBU chunk. This allows anything after <version> to be redefined for future needs. This document describes version 1.
  • nChannels, the number of channels, can only be two. The UHJ specification allows for more than two channels, but it is not possible to make such multi-channel WAVE-EX files stereo-compatible. Recommendations for handling such material are discussed below.
  • dwChannelMask is set to
    SPEAKER_FRONT_LEFT | SPEAKER_FRONT_RIGHT; // Stereo = 0x00000003
    and the channel order is Left, Right as is normal for stereo files.
  • 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 UHJ chunk. (This is an example of the robustness principle, "Be liberal in what you read, and conservative in what you write".)
  • No shelf filters. (Shelf filters were never a part of UHJ.)

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):

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½, 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, WAVE-EX 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 WAVE-EX 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½-channel UHJ (where the "½" 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.

Martin Leese
http://members.tripod.com/martin_leese/

Related content