Decoding FOA:
Filter:
atk-sc3/Guides (extension) | Libraries > Ambisonic Toolkit > Guides & Tutorials

Decoding FOA
ExtensionExtension

First Order Ambisonic (FOA) decoding examples
 

Monitoring

Perhaps one of the most celebrated aspects of the Ambisonic sound technique has been its design as a hierarchal reproduction system, able to target a number of varying loudspeaker arrays. Users may be familiar with SuperCollider's inbuilt regular polygon decoder, DecodeB2.

The ATK provides a much wider palate of optimised monitoring tools via FoaDecode. These include:

While the regular decoders will be suitable for many users, diametric decoding enables the greatest flexibility, and allows the user to design substantially varying semi-regular arrays suitable for a wide variety of playback situations.

The examples below are intended to briefly illustrate some of the first order decoding options made available in the Ambisonic Toolkit.

NOTE: All decoders presume loudspeakers are placed at equal radii from the origin of the array, and gain is normalised. Loudspeaker arrays with unequal radii may be realised if the resulting wavefront arrival times are compensated through the use of delay lines.
NOTE: See FoaDecode, FoaDecoderMatrix and FoaDecoderKernel for more details about decoding.

Testing notes

Encoded as an omnidirectional soundfield, PinkNoise is used as the example sound source. In a well aligned, dampend studio environment, this usually sounds "in the head". FoaPush is used to "push" the omnidirectional soundfield so that it becomes a planewave (infinite distance, in an anechoic environment) arriving from some direction.

The soundfield is controlled by MouseX and MouseY, where MouseX specifies the incident azimuth angle (pi to -pi; left to right of display) and MouseY the FoaPush angle (0 to pi/2; bottom to top of display). With the mouse at the bottom of the display, the soundfield remains omnidirectional. Placed at the top of the display, the soundfield becomes directional, and varying left/right position will vary the incident azimuth of the resulting planewave.

Before exploring the examples below, it is suggested you confirm your Server has enough output channels to support your chosen decoder. You can query the server:

An example Function, ~checkMyServerOutputs, can be found here. ~checkMyServerOutputs throws a warning if myServer.options.numOutputBusChannels < myDecoder.numOutputs. If you need to update your Server's number of output bus channels, review the example found here.

Stereo

Virtual microphone

The soundfield may be decoded to stereo using a pair of virtual microphones.

NOTE: A matrix type decoder, see FoaDecoderMatrix: *newStereo for further details.

Ambisonic UHJ

Ambisonic UHJ stereo1 is the native stereo format for Ambisonics. A B-format signal (2D, with some losses) can be recovered from a UHJ decoded signal through the use of FoaEncoderKernel: *newUHJ.

NOTE: A kernel type decoder, see FoaDecoderKernel: *newUHJ for further details.
WARNING: Kernel decoders require special care. Allow the kernel time to load before attempting to use. Additionally, the kernel buffer should be freed through the use of FoaDecoderKernel: -free after use.

Binaural

Synthetic

The Ambisonic Tookit provides a synthetic spherical head model HRTF decoder.2 Ten subjects with varying head sizes are available. Audition to find one that works best for you.

Additionally, HRTF decoders computed from measured HRIRs are also available: FoaDecoderKernel: *newListen & FoaDecoderKernel: *newCIPIC.

NOTE: A kernel type decoder, see FoaDecoderKernel: *newSpherical for further details.
WARNING: Kernel decoders require special care. Allow the kernel time to load before attempting to use. Additionally, the kernel buffer should be freed through the use of FoaDecoderKernel: -free after use.

CIPIC

Measured HRTF decoder, with measurements from the University of California Davis' CIPIC HRTF database.3 Forty-five subjects with varying head sizes are available. Audition to find one that works best for you.

NOTE: A kernel type decoder, see FoaDecoderKernel: *newCIPIC for further details.
WARNING: Kernel decoders require special care. Allow the kernel time to load before attempting to use. Additionally, the kernel buffer should be freed through the use of FoaDecoderKernel: -free after use.

2D surround

Quadraphonic

The Ambisonic Toolkit provides an optimised quadraphonic decoder with variable loudspeaker angle. The below example uses the default settings, which results in a square layout, 'single' band type ( 'energy' ) decoder. This sort of decoder is suitable for mid-scale playback, though, for best results for an audience, the use of a larger array (5+ loudspeakers) is advised. FoaDecoderMatrix: *newPanto or FoaDecoderMatrix: *newDiametric would be appropriate.

A psychoacoustically optimised (dual-band) near-field compensated decoder, suitable for studio monitoring, is demonstrated below.

NOTE: A matrix type decoder, see FoaDecoderMatrix: *newQuad for further details.

DecodeB2

By default, SuperCollider includes a pantophonic (2D) decoder, DecodeB2. This inbuilt decoder provides functionality similar to the Ambisonic Toolkit's FoaDecoderMatrix: *newPanto, with the exceptions of a variable k argument and the documentation features of FoaDecoderMatrix, e.g. FoaDecoderMatrix: -dirChannels.

The inbuilt decoder is a 'controlled' k decoder. (See this discussion on k.) The below code includes a function, funK, to add variable k functionality to DecodeB2. So, this example is realised as a 'single' band type ( 'energy' ) decoder, matching the FoaDecoderMatrix: *newQuad example above.

NOTE: See DecodeB2: *ar for further details.

Optimised quadraphonic

The decoder presented here is an example of a dual-band ( 'dual' ) psychoacoustically optmisied, near-field compensated decoder described by Gerzon.4 This sort of decoder is considered the ideal for first order Ambisonics, meeting all the criteria outlined by Gerzon to qualify as Ambisonic, 5 and is the choice for critical studio listening.

Additionally, this decode is rendered as a 'narrow quadraphonic' layout, with loudspeaker angles at [ 30.0, 150.0, -150.0, -30.0 ]. For studio based work, this can be convenient, as the front pair is at the correct angle for two channel stereo monitoring. The narrow layout gives increased localisation and stabilised images at front and back, at the expense of reduced stability at the sides.

Near-field compensation, filtering for the near-field effects of loudspeaker placement, is made through the use of FoaNFC.

NOTE: A matrix type decoder, see FoaDecoderMatrix: *newQuad and FoaNFC for further details.

ITU 5.0

The Ambisonic Toolkit includes Bruce Wiggins' optimised ITU 5.0 decoders.6

NOTE: A matrix type decoder, see FoaDecoderMatrix: *new5_0 for further details.

3D surround

Cube

A full 3D decoder, with eight loudspeakers arranged in upper and lower rings of four. This small eight channel array is not optimal for large scale playback. For public performance, a 10 or 12 channel arrangement (two rings of 5 or 6) is more suitable.

The loudspeaker layout specified by this decoder is more suited to a small-scale situation. See below for a minimal arrangement appropriate for full 3D studio monitoring.

NOTE: A matrix type decoder, see FoaDecoderMatrix: *newPeri for further details.

Optimised bi-rectangle

This bi-rectangular decoder has been described by Gerzon as optimal for small-scale, full 3D listening. The decoder presented is an example of a dual-band ( 'dual' ) psychoacoustically optmisied, near-field compensated decoder. Meeting all the criteria outlined by Gerzon to qualify as Ambisonic, this decoder is a good choice for full 3D critical studio listening.

The frontal loudspeaker pair is arranged at [ 30.0, -30.0 ] degrees. For studio based work, this can be convenient, as the front pair is at the correct angle for two channel stereo monitoring.

Near-field compensation, filtering for the near-field effects of loudspeaker placement, is made through the use of FoaNFC.

NOTE: A matrix type decoder, see FoaDecoderMatrix: *newDiametric and FoaNFC for further details.

[2] - See: R. O. Duda, "Modeling head related transfer functions," in Proceedings of the Twenty-Seventh Annual Asilomar Conference on Signals, Systems and Computers, Asilomar, CA, 1993.
[4] - M. A. Gerzon, "Multi-system ambisonic decoder," Wireless World, pp. 43-47, 69-73, July/Aug. 1977.
[5] - E. Benjamin, R. Lee, and A. Heller, "Is My Decoder Ambisonic?," in Proceedings of the 125th Audio Engineering Society Convention, San Francisco, 2008.
[6] - Irregular decoders in the Ambisonic Toolkit are kindly provided by Bruce Wiggins: http://www.brucewiggins.co.uk/. See also: B. Wiggins, I. Paterson-Stephens, V. Lowndes, and S. Berry, "The design and optimisation of surround sound decoders using heuristic methods," in Proceedings of UKSIM 2003: Conference on Computer Simulation, Cambridge, England, 2003.