HoaLibrary
2.0
High Order Ambisonics Library
|
The 3D ambisonic classes. More...
Classes | |
class | Ambisonic |
The ambisonic class. More... | |
class | Decoder |
The ambisonic decoder. More... | |
class | Encoder |
The ambisonic encoder. More... | |
class | Map |
The ambisonic multi-encoder with distance compensation. More... | |
class | Meter |
The planewaves peak level meter. More... | |
class | Optim |
The ambisonic optimization. More... | |
class | Planewaves |
The planewaves class. More... | |
class | Rotate |
The ambisonic rotate. More... | |
class | Scope |
The ambisonic scope. More... | |
class | Vector |
The planewaves vector. More... | |
class | Wider |
The ambisonic wider. More... | |
Functions | |
unsigned long | factorial (long n) |
The factorial. More... | |
unsigned long | double_factorial (long n) |
The double factorial. More... | |
double | associated_legendre (int l, int m, double x) |
The associated Legendre polynomials. More... | |
double | legendre_normalization (int l, int m) |
The legendre normalization. More... | |
double | spherical_harmonics_azimuth (int l, int m, double phi) |
The azimuth part of the spherical harmonics function. More... | |
double | spherical_harmonics_elevation (int l, int m, double theta) |
The elevation part of the spherical harmonics function. More... | |
double | spherical_harmonics (int l, int m, double phi, double theta) |
The spherical harmonics function. More... | |
double | wrap (double value, double low, double high) |
The wrapping function. More... | |
double | wrap_twopi (double value) |
The wrapping function over \(2\pi\). More... | |
double | clip_minmax (double value, double low, double high) |
The clipping function. More... | |
double | clip_min (double value, double low) |
The minimum clipping function. More... | |
double | clip_max (const double value, const double high) |
The maximum clipping function. More... | |
std::string | int_to_string (int aValue) |
The int to string conversion. More... | |
The 3D ambisonic classes.
The 3D high order ambisonic namespace.
All the 3D ambisonic and planewaves classes will be part of this namespace
All the 3D ambisonic classes will be part of this namespace
|
inline |
The associated Legendre polynomials.
The function computes the associated Legendre polynomial \(P(l, m)\) that is a part of the formula that compute the spherical harmonic coefficient where l is the band and the m is the argument of a spherical harmonic and x is the cosinus of the elevation. It uses three recurrence formulas :
\[P(l, l)(x) = (-1)^l \times (2l - 1)!! \times (1 - x^2)^{0.5l}\]
\[P(l + 1, l)(x) = x \times (2l + 1) \times P(l, l)\]
\[P(l + 1, m)(x) = \frac{(2l + 1) \times x \times P(m, l) - (l + m) \times P(m, l - 1)}{(l - m + 1)}\]
with \(0 \leq l\) and \(-l \leq m \leq +l\)
l | The band of the spherical harmonic. |
m | The argument of the spherical harmonic. |
x | The cosinus of the elevation. |
|
inline |
The maximum clipping function.
The function clips a number at a maximum value.
If \(x > max\), \(f(x) = max\) else \(f(x) = x\).
value | The value to clip. |
high | The high boundarie. |
|
inline |
The minimum clipping function.
The function clips a number at a minimum value.
If \(x < min\), \(f(x) = min\) else \(f(x) = x\).
value | The value to clip. |
low | The low boundarie. |
|
inline |
The clipping function.
The function clips a number between boundaries.
If \(x < min\), \(f(x) = min\) else if \(x > max\), \(f(x) = max\) else \(f(x) = x\).
value | The value to clip. |
low | The low boundarie. |
high | The high boundarie. |
|
inline |
The double factorial.
The function computes the double factorial, the product of all the odd integers up to some odd positive integer :
\[n!! = n \times (n - 2) \times (n - 4) \times {...} \]
n | The interger. |
|
inline |
The factorial.
The function computes the factorial, the product of all positive integers less than or equal to an integer.
\[n! = n \times (n - 1) \times (n - 2) \times {...} \]
n | The interger. |
|
inline |
|
inline |
The legendre normalization.
The function normalizes the associated Legendre polynomial over \(2\pi\) :
if \( m = 0\)
\[K(l) = \sqrt{\frac{2 \times l + 1}{4\pi}}\]
else
\[K(l, m) = \sqrt{2 \times \frac{2 \times l + 1}{4\pi} \times \frac{(l - |m|)!}{(l + |m|)!}}\]
with \(0 \leq l\) and \(-l \leq m \leq +l\)
l | The band of the spherical harmonic. |
m | The argument of the spherical harmonic. |
|
inline |
The spherical harmonics function.
The function computes the spherical harmonics coefficient for the angles \(\phi\) and \(\theta\) in radian.
\[Y(l, m, \phi, \theta) = Y_{azimuth}(l, m, \phi) \times Y_{elevation}(l, m, \theta)\]
l | The band of the spherical harmonic. |
m | The argument of the spherical harmonic. |
phi | The azimuth. |
theta | The elevation. |
|
inline |
The azimuth part of the spherical harmonics function.
The function computes the azimuth coefficient of the spherical harmonic \([l, m]\) for an angle \(\phi\) in radian :
if \( m \geq 0\)
\[Y_{azimuth}(l, m, \phi) = cos(m \times \phi)\]
else
\[Y_{azimuth}(l, m, \phi) = sin(-m \times \phi)\]
with \(0 \leq l\) and \(-l \leq m \leq +l\)
l | The band of the spherical harmonic. |
m | The argument of the spherical harmonic. |
phi | The azimuth. |
|
inline |
The elevation part of the spherical harmonics function.
The function computes the elevation coefficient of the the spherical harmonic \([l, m]\) for an angle \(\theta\) in radian. It uses the associated Legendre polynomial and applies the Legendre normalization :
\[Y_{elevation}(l, m, \theta) = N(l, m) \times P(l, m, cos(/theta)\]
with \(0 \leq l\), \(-l \leq m \leq +l\) and \(N\) the normalization and \(P\) the associated Legendre polynomial.
l | The band of the spherical harmonic. |
m | The argument of the spherical harmonic. |
theta | The elevation. |
|
inline |
The wrapping function.
The function wraps a number between boundaries.
value | The value to wrap. |
low | The low boundarie. |
high | The high boundarie. |