Conversion between B-Format and UHJ


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 B-format and UHJ surround formats.

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

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 is possible to "pack" the horizontal B-format signals (WXY) in just two channels, suitable for stereo reproduction, and called UHJ. UHJ is a "standard" stereo waveform, which indeed includes information capable of driving a complete horizontal surround system (for example, equipped with 5, 6 or even 8 loudspeakers).  The best way to listen at UHJ-encoded material is always to re-extract from it the B-format and decode it throug an Ambisonics decoder or something similar. Listening directly at UHJ through a normal stereo system sounds usually too much reverberant, as You hear from front any sound which should come from behind You.

Here the problem of converting a three-channels B-format signal (WXY) to a two-channels UHJ (LR) is solved. The formulas are as follows:

L = 0.5 * (0.9397*W + 0.1856*X - j*0.342*W + j*0.5099*X + 0.655*Y)

R = 0.5 * (0.9397*W+ 0.1856*X + j*0.342*W - j*0.5099*X - 0.655*Y)

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 W-UHJ.WAV, X-UHJ.WAV and Y-UHJ.WAV and can be downloaded by clicking here.

For computing the UHJ stereo signal from the three B-format signals (WXY), the processing path is 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 W-UHJ filter, and copy it to the Windows clipboard
  3. Load the W signal, which is assumed here to be a mono file
  4. Convert it to stereo, employing the "Edit - Convert sample type" module of CoolEdit. These are the settings for such a conversion:

  1. 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) with the other two stereo files obtained repeating the above steps for the other two channels (X and Y) of the original B-format soundtrack.
  3. Once the three filtered stereo files are obtained, create a new empty stereo waveform (also at 48 Kz, 32 bit); then, for each of the three filtered files, do the following steps:
  4. Copy the stereo filtered file in the clipboard.
  5. Switch to the (initally empty) new waveform, and mix-paste the clipboard contents over the waveform, making use of the CoolEdit's "Edit - Mix Paste" command, as shown here:

  1. Once the above Mix-Paste procedure has been repeated for all the three components (W, X and Y), the newly created waveform contains the desired UHJ stereo signal, and can be saved.

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 B-format player - B-player.

Bidule, SIR and bPlayer 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 encoding, 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: W_UHJ.wav, X_UHJ.wav, Y_UHJ.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 0 dB, which avoids 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.

Run the patch, and this will process audio in real time (taking the input from a WXYZ WAV file by means of the B-player developed by Gerzonic, and sending the output directly to the sound card or to a standard stereo WAV file), with a reasonable CPU load (24% on my notebook equipped with a P-IV at 1.7 GHz).

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

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

Angelo Farina, April 2001 - June 2007