Conversion between UHJ and B-format

 

This page is OBSOLETE !!! The new version of this page, making us of the free X-volver plugin, is here

 

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!

NEW !!! - Daniel Courville's plugins for MAC are now linked....

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 Bruce Wiggins, by Gerzonic and by Dave Malham.

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:

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 the three channels W, X and Y from the 2-channels 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. So the signals have to be packed, for example em,ploying the latest version of Audacity.

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 freeware Convolver - SIR or ConvolverVST
  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... And, of course, the same must be said for Plogue Bidule! Well, in this case I waited some weeks, but at the end I registered this, too. It is cheap, and registering it provides proper motivation to the author for continuing the development....

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:

W A R N I N G !!! The decoder shown here (Emigrator) has a severe bug when employed with an ITU 5.1 loudspeaker array, as discussed on this page! It is warmly recommended to use Bruce Wiggins WAD decoder when working with an ITU 5.1 array...

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 - The preferred WAD decoder already provides his outputs in the correct order.

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


Daniel Courville's plugins

Final note: for MAC users, Daniel Courville created AU and VST plugins which allow for UHJ decoding employing a multichannel host, such as Logic or Plogue Bidule. The plugins have been created employing SonicBirth, which is required to be installed for having the plugins working...

You can download Daniel's AU plugins here.

You can download Daniel's VST plugins here.


Angelo Farina, April 2001 / June 2007