aspcol.sphericalharmonics

Functions for handling the spherical harmonic wave function and estimating the sound field coefficients

All math and translation theorems are taken from [martinMultiple2006] unless otherwise stated.

References

[martinMultiple2006] P. A. Martin, Multiple scattering: Interaction of time-harmonic waves with N obstacles, vol. 107. in Encyclopedia of mathematics and its applications, vol. 107. Cambridge, UK: Cambridge University Press, 2006.

[brunnstromBayesianSubmitted] J. Brunnström, M. B. Møller, and M. Moonen, “Bayesian sound field estimation using moving microphones,” IEEE Open Journal of Signal Processing, submitted.

[uenoSound2018] N. Ueno, S. Koyama, and H. Saruwatari, “Sound field recording using distributed microphones based on harmonic analysis of infinite order,” IEEE Signal Process. Lett., vol. 25, no. 1, pp. 135–139, Jan. 2018, doi: 10.1109/LSP.2017.2775242.

Equivalence of spherical harmonic definitions

The scipy spherical harmonic implementation is https://docs.scipy.org/doc/scipy/reference/generated/scipy.special.sph_harm.html

The Legendre polynomial (referred to as Legendre function of the first kind in Scipy documentation) definition given in Scipy is (37) after inserting the definition of the Hypergeometric function. The definition used in Martin is (30), the Rodrigues formula. The two definitions are equivalent, therefore the Legendre polynomial is consistent. https://mathworld.wolfram.com/LegendrePolynomial.html

Martins definition of the Associated Legendre Polynomial $P_n^m(t)$, found in (A.1) in [martinMultiple2006] is $P_n^m(t) = (1-t^2)^{m/2} frac{d^m}{dt^m} P_n(t)$. Scipy has almost the same definition, $S_n^m(t) = (-1)^m P_n^m(t)$, where S_n^m(t) denotes the Scipy definition. Therefore they are equivalent except for that Scipy includes the Condon-Shortley phase in the ALP.

The definition of the spherical harmonics in (3.6) in [martinMultiple2006] is equivalent to Scipy’s definition, except for the inclusion of an additional factor (-1)^m, i.e. the Condon-Shortley phase. Because the same factor is included in Scipy’s ALP but not Martin ALP, the spherical harmonic definitions are equivalent.

Functions

basis_translation_3_80(pos, wave_num, ...)

Translation operator for shd basis function, such that shd_basis(pos_orig + pos) = T(pos) @ shd_basis(pos_orig)x

basis_translation_3_92(pos, wave_num, ...)

Translation operator for harmonic basis functions, such that shd_basis(pos_orig + pos) = T(pos) @ shd_basis(pos_orig)

directivity_linear(A, d_mic[, max_order])

Harmonic coefficients of a linear directivity function

directivity_omni([max_order])

Harmonic coefficients of an omnidirectional directivity function

gaunt_coef_lookup(max_order)

Returns a lookup table for the gaunt coefficients

gaunt_coefficient(l1, m1, l2, m2, l3)

Gaunt coefficient G(l1, m1, l2, m2, l3)

reconstruct_pressure(shd_coeffs, pos, ...)

Returns the complex sound pressure at some positions using the provided spherical harmonic coefficients

shd_basis(pos, order, degree, wavenum)

Spherical harmonic basis function for sound field in 3D

shd_coeffs_order_degree_to_index(order, degree)

shd_max_order(num_coeffs)

Returns the maximum order of the spherical harmonics that is required to represent a given number of coefficients

shd_min_order(wave_num, radius)

Returns the minimum order of the spherical harmonics that should be used for a given wavenumber and radius

shd_num_coeffs(max_order)

Number of coefficients required to represent a spherical harmonic function of a given order

shd_num_degrees(max_order)

Returns a list of mode indices for each order when order = n, the degrees are only non-zero for -n <= degree <= n

shd_num_degrees_vector(max_order)

Constructs a vector with the index of each order and degree when order = n, the degrees are only non-zero for -n <= degree <= n

translate_shd_coeffs(shd_coeffs, pos, ...)

Translates the provided shd_coeffs to another expansion center

translated_inner_product(pos1, pos2, ...)

Computes the inner product of translated sequences of coefficients

translation_operator(pos, wave_num, ...)

Translation operator for harmonic coefficients, such that shd_coeffs(pos_orig + pos) = T(pos) @ shd_coeffs(pos_orig)

triple_harmonic_integral(l1, l2, l3, m1, m2, m3)

Integral of the product of three spherical harmonics