Conversion between UHJ and B-format

This page explains how to use the Aurora plugins for converting between UHJ and B-format surround formats.

NEW - Also usage of Audiomulch/Bidule and SIR (Super Impulse reverb) are explained!

UHJ is a "standard" stereo waveform, which includes information capable of driving a complete horizontal surround system (for example, equipped with 5, 6 or even 8 loudspeakers). The derivation of the signals optimized to feed the loudspeakers passes through two steps:

1) Extraction of B-format signals (W, X and Y channels) form the original stereo waveform.

2) Decoding of the B-format signal for the particular array of loudspeakers employed, employing the traditional Ambisonics or other equivalent decoding technologies.

Only the first step is addressed here, for the second step I suggest the use of the software decoders developed by Richard Furse or Richard Dobson.

A B-format signal is, in general, a 4-channel signal (WXYZ). W is the sound pressure signal, as captured by a perfectly omnidirectional microphone. X, Y and Z are the "first order spherical harmonics" of the pressure field, which are obtained by weighting the pressure impinging on the microphone with the cosines of the angles between the direction-of-arrival and the corresponding cartesian axis.

The Cartesian reference is conforming to ISO standards (for example, ISO2631), as in the following picture:

It must be noted that B-format is defined with pressure signals on all 4 channels, instead the use of a Soundfield microphone (or of a Bruel & Kjaer 3D sound intensity probe) results in capturing pressure (W) and the three cartesian components of the particle velocity (Vx, Vy, Vz): only when the sound is being transported by plane, progressive waves the components of the particle velocity are proportional to cosine-weighted pressure, in the general case pressure and velocity exhibit severe phase and gain mismatch, and thus the recorded "B-format-like" signal is unsuitable for the UHJ encoding and subsequent decoding, or for direct Ambisonics implementation of the decoding. This is one of the reasons for which Soundfield is no more promoting their microphones for Ambisonics (they do not employ Ambisonics technology in their 5-channels surround processor), and Nimbus does not employ a Sounfield mike for their UHJ CDs.

So we consider first the case in which You have an UHJ signal (taken, for example, from a Nimbus CD), and You want to extract a B-format signal from it. Of course, the Z channel cannot be extracted, and will be set to zero (horizontal-only surround).

The UHJ (LR) to B-format (WXY) conversion si described by the following formulas:

W = 0.5*(0.982*L + 0.982*R + j*0.164*L - j*0.164*R)

X = 0.5*(0.419*L + 0.419*R - j*0.828*L + j*0.828*R)

Y = 0.5*(0.763*L - 0.763*R + j*0.385*L + j*0.385*R)

These equations were implemented in frequency domain, and transformed back to three stereo impulse responses in time domain, at a 48 kHz sampling rate. The sampling rate can be easily changed with CoolEdit. The three impulse responses are named respectively UHJ-W.WAV, UHJ-X.WAV and UHJ-Y.WAV and can be downloaded by clicking here.

For extracting WXY from the UHJ stereo signal, the processing paths are as follows:

In practice, three independent conversions are made for each of three B-format channels.

The above conversion can be made employing Cooledit and Aurora, following this tasklist:

  1. Start CoolEdit
  2. Load the UHJ-W filter, and copy it to the Windows clipboard
  3. Load the UHJ stereo signal
  4. Launch the "Convolve with Clipboard"  Aurora module, with the following settings:

  1. Please note that the Autorange is disabled, and the Gain is set to 0 dB; each input channel is convolved with each Imp.Res. channel.
  2. The result is a stereo file, which has to be mixed (summed) in a mono file. This can be done with the "Edit - Convert sample type" module of CoolEdit. These are the settings for such a conversion:

  1. The resulting mono file is the W channel of B-format. Repeate the above step with te other two conversion filters (UHJ-X and UHJ-Y) for obtaining also the X and Y signals.
  2. The resulting W, X and Y signals can be saved as three mono files. But current software B-format decoders require a single, 4-channels WAV file as input (typically reduced at 16-bits depth). So the signals have to be packed as follows.
  3. First of all, pack W along with X. Re-transform W in a stereo WAV file, with 16-bits depth, employing again the "Convert sample type" module:

  1. At this point, switch to the X signal, and copy it to the clipboard. Then go back to the W signal (now it is stereo, but contains signal only in its upper trace), click at the very bottom of the screen so that only the Right track is selected, and paste here the X signal from the clipboard.
  2. Save the resulting stereo WX signal with a name ending with WX.
  3. 12 Repeat the step n. 9 for the Y signal, which will become stereo, 16-bits, but will have a zero signal in its right channel (Z).
  4. Save directly this stereo signal with a name ending with YZ.
  5. Invoke the small DOS program MAKEBFOR.EXE, which will ask for the names of the WX and YZ files, and will save a single 4-channels WXYZ file suitable for decoding with Richard Furse's decoder.

The above procedure could appear somewhat complex, I had plans to write a single program which does everything in a single step, but I didn't have enough time...

I abandoned this plan, as nowadays the freeware/shareware software available on the Internet already allows for this: You need to get three objects:

  1. The VST host - Audiomulch (or Bidule)
  2. The Convolver - SIR
  3. The Ambisonics decoder - B_Decoder (or Emigrator).

Bidule, SIR and B_Decoder (or Emigrator) are freeware, however AudioMulch is shareware. I warmly recommend to register Audio Mulch, supporting its continuous developement. His author, Ross Bencina, is doing a very clever job, and he deserves as much support as possible. I registered my copy of Audio Mulch as soon as I tested it for a few minutes...

For doing UHJ decoding, You must create a processing network (a "patch") in Audio Mulch, as shown here:

Then You have to configure each of the three instances of SIR with the corresponding stereo impulse responses: UHJ_W.wav, UHJ_X.wav, UHJ_Y.wav - choose the 44.1 kHz or 48 kHz version, depending on the sampling rate of Your source (and remember to set AudioMulch for the same sampling rate).

Pay attention to set the Dry gain control of SIR to -infinite (OFF), so that the whole signal is passed through the impulse response - the gain of the Wet (processed) signal is safely set to -6 dB, for avoiding clipping. Note also the the Auto Gain feature of SIR was disabled, for ensuring proper gain matching among the three instances. These settings must be, of course, exactly the same in the three instances of SIR.

Then configure the Ambisonics decoder for Your loudspeaker rig (for example an horizontal-only octaedron), connect the loudspeakers in their proper order, and that's all! Run the contraption, and this will process audio in real time (either from a stereo WAV file or live from an input of the sound card), with a reasonable CPU load (20% on my notebook equipped with a P-IV at 1.7 GHz).

The following picture show the UHJ-decoding patch under Bidule, employing Gerzonic's decoder and decoding for an ITU 5.1 loudspeaker layout:

Note that in this case the output is routed to a 6-channels WAV file, and that the channel numbering must be reordered for conforming to 

the Microsoft “Wave Format Extensible” standard (which is also the SMPTE & ITU specification), which is defined as:

  1. Front Left

  2. Front Right

  3. Center

  4. LFE (unused in this case)

  5. Left Surround (Rear Left)

  6. Right Surround (Rear Right)

The above channel order is also the typical order utilized as the desired input for Dolby-AC3™/DTS™/MLP™/WMA™ encoders.

Remember that You can download the filtering impulse responses and the AudioMulch/Bidule patches from my web site, just click here.

You can also be interested in doing the inverse procedure, that is, converting a B-format signal into an UHJ stereo file. Look at the corresponding B-format to UHJ conversion page for this.

Angelo Farina, April 2001 / December 2003