image thumbnail

Higher Order Ambisonics (HOA) library

version (35.4 KB) by Archontis Politis
Routines implementing higher-order ambisonics for spatial sound encoding, manipulation and decoding.


Updated 01 Sep 2020

From GitHub

View license on GitHub

This Matlab/Octave library was developed during my doctoral research in the [Communication Acoustics Research Group] (, Aalto University, Finland. If you would like to reference the code, you can refer to my dissertation published [here](
Archontis Politis, Microphone array processing for parametric spatial audio techniques, 2016
Doctoral Dissertation, Department of Signal Processing and Acoustics, Aalto University, Finland

## Description

This is a compact Matlab/Octave library implementing most common operations
associated with higher-order ambisonics (HOA), which refer to a set of
spatial audio techniques for capturing, manipulating and reproducing
sound scenes, based on a spherical Fourier expansion of the sound field.
Most of the functionality of the library is demonstrated in the included
script TEST_AMBI_SCRIPT.m. The same documentation can be also found in


The included functions implement HOA encoding of directional sounds,
decoding using various decoding approaches, and rotation of HOA sound
scenes. All operations are defined in terms of orthonormalized real
Spherical Harmonics (N3D in ambisonic slang) and channel indexing
according to $q = n^2+n+m+1$, where n is the order and m is the degree (ACN
in ambisonic slang). However, functions are included to convert to and
from N3D/ACN to some other established conventions (namely
semi-normalized SHs (SN3D) and an alternative channel indexing, termed

Ambisonic decoding can be approached from various sides, more physically
inspired or more perceptually inspired. Five approaches are implemented

* 1) Sampling or projection decoding (transpose)
* 2) Mode-matching decoding (pseudo-inverse)
* 3) Energy-preserving decoding [ref.1]
* 4) All-round ambisonic decoding [ref.2]
* 5) Constant-angular spread decoding [ref.3]

Apart from the two first traditional approaches, the three last are more
recent and more perceptually motivated. They are also more
flexible and robust, in terms of loudspeaker layouts.

Additionally, the library implements
* visualization of the ambisonic performance measures of velocity and energy vectors
* maximum energy vector weighting (max-rE) [ref.4 & ref.2]
* soundfield rotations

ALLRAD and CSAD decoders, and the scene rotations require
the additional Vector-base Amplitude Panning library found in


and the general Spherical Harmonic Transform library found in


or in the Matlab file exchange page of the author.

These two libraries should be added to the Matlab path before executing
this script.

For any questions, comments, corrections, or general feedback, please

## References

[1] Zotter, F., Pomberger, H., Noisternig, M. (2012).
Energy-Preserving Ambisonic Decoding. Acta Acustica United with Acustica, 98(1), 37:47.

[2] Zotter, F., Frank, M. (2012).
All-Round Ambisonic Panning and Decoding. Journal of the Audio Engineering Society, 60(10), 807:820.

[3] Epain, N., Jin, C. T., Zotter, F. (2014).
Ambisonic Decoding With Constant Angular Spread. Acta Acustica United with Acustica, 100, 928:936.

[4] Daniel, J. (2001).
Representation de champs acoustiques, application ? la transmission et ? la reproduction de scenes sonores complexes dans un contexte multim?dia. Doctoral Thesis. Universite Paris 6.

[5] Makita, Y. (1962).
On the directional localization of sound in the stereophonic sound field. EBU Review, 73, 1536:1539.

[6] Gerzon, M. A. (1992).
General Metatheory of Auditory Localization. In 92nd AES Convention (Preprint 3306). Vienna, Austria.

[7] Merimaa, J. (2007).
Energetic sound field analysis of stereo and multichannel loudspeaker reproduction. In 123rd AES Convention. New York, NY.

[8] Matthias, F. (2013).
Phantom Sources using Multiple Loudspeakers in the Horizontal Plane. Doctoral thesis, Institute of Electronic Music and Acoustics, University of Music and Performing Arts, Graz

[9] Laitinen, M., Vilkamo, J., Jussila, K., Politis, A., & Pulkki, V. (2014).
Gain normalization in amplitude panning as a function of frequency and room reverberance. In 55th International Conference of AES. Helsinki, Finland.

[10] Frank, M. (2013).
Source Width of Frontal Phantom Sources: Perception, Measurement, and Modeling. Archives of Acoustics. 38(3), 311?319

[11] Daniel, J. (2003).
Spatial Sound Encoding Including Near Field Effect : Introducing Distance Coding Filters and a Viable , New Ambisonic Format. In 23rd International Conference of AES. Copenhagen, Denmark.

Cite As

Archontis Politis (2022). Higher Order Ambisonics (HOA) library (, GitHub. Retrieved .

MATLAB Release Compatibility
Created with R2015a
Compatible with any release
Platform Compatibility
Windows macOS Linux

Inspired: Spherical Harmonic Decomposition

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
To view or report issues in this GitHub add-on, visit the GitHub Repository.
To view or report issues in this GitHub add-on, visit the GitHub Repository.