|
double | min (const double v1, const double v2) |
| The minimum function. More...
|
|
double | max (const double v1, const double v2) |
| The maximum function. More...
|
|
double | clip_minmax (const double value, const double min, const double max) |
| The clipping function. More...
|
|
double | clip_min (const double value, const double low) |
| The minimum clipping function. More...
|
|
double | clip_max (const double value, const double high) |
| The maximum clipping function. More...
|
|
long double | factorial (long n) |
| The factorial. More...
|
|
unsigned long | double_factorial (long n) |
| The double factorial. More...
|
|
double | associated_legendre (int l, int m, const double x) |
| The associated Legendre polynomials. More...
|
|
double | legendre_normalization (const int l, const int m) |
| The legendre normalization. More...
|
|
double | spherical_harmonics_azimuth (const int l, const int m, const double phi) |
| The azimuth part of the spherical harmonics function. More...
|
|
double | spherical_harmonics_elevation (const int l, const int m, const double theta) |
| The elevation part of the spherical harmonics function. More...
|
|
double | spherical_harmonics (const int l, const int m, const double phi, const double theta) |
| The spherical harmonics function. More...
|
|
double | wrap (double value, const double low, const double high) |
| The wrapping function. More...
|
|
double | wrap_twopi (const double value) |
| The wrapping function over \(2\pi\). More...
|
|
double | wrap_360 (const double value) |
| The wrapping function in degrees. More...
|
|
double | ordinate (const double radius, const double azimuth) |
| The ordinate converter function. More...
|
|
double | abscissa (const double radius, const double azimuth) |
| The abscissa converter function. More...
|
|
double | radius (const double x, const double y) |
| The radius converter function. More...
|
|
double | azimuth (const double x, const double y) |
| The azimuth converter function. More...
|
|
std::string | int_to_string (int aValue) |
| The int to string conversion. More...
|
|
The high order ambisonic namespace.
This namespace have all the standard methods and functions necessary for ambisonic processing.
double Hoa::associated_legendre |
( |
int |
l, |
|
|
int |
m, |
|
|
const double |
x |
|
) |
| |
|
inline |
The associated Legendre polynomials.
The function computes the associated Legendre polynomial \form#2 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\)
- Parameters
-
l | The band of the spherical harmonic. |
m | The argument of the spherical harmonic. |
x | The cosinus of the elevation. |
- Returns
- The function return the associated Legendre polynomial of x for l and m.
- See Also
- legendre_normalization
-
spherical_harmonics
Definition at line 169 of file HoaMath.h.
double Hoa::legendre_normalization |
( |
const int |
l, |
|
|
const int |
m |
|
) |
| |
|
inline |
The legendre normalization.
The function normalizes the associated Legendre polynomial over \form#8 : \n
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\)
- Parameters
-
l | The band of the spherical harmonic. |
m | The argument of the spherical harmonic. |
- Returns
- The function return the normalization of the associated Legendre polynomial for l and m.
- See Also
- associated_legendre
-
spherical_harmonics
Definition at line 203 of file HoaMath.h.
double Hoa::spherical_harmonics |
( |
const int |
l, |
|
|
const int |
m, |
|
|
const double |
phi, |
|
|
const double |
theta |
|
) |
| |
|
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)\]
- Parameters
-
l | The band of the spherical harmonic. |
m | The argument of the spherical harmonic. |
phi | The azimuth. |
theta | The elevation. |
- Returns
- The function return the coefficient for phi and theta for the spherical harmonics of band l and argument m.
- See Also
- spherical_harmonics_azimuth
-
spherical_harmonics_elevation
Definition at line 283 of file HoaMath.h.
double Hoa::spherical_harmonics_azimuth |
( |
const int |
l, |
|
|
const int |
m, |
|
|
const double |
phi |
|
) |
| |
|
inline |
The azimuth part of the spherical harmonics function.
The function computes the azimuth coefficient of the spherical harmonic \form#12 for an angle \form#13 in radian :\n
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\)
- Parameters
-
l | The band of the spherical harmonic. |
m | The argument of the spherical harmonic. |
phi | The azimuth. |
- Returns
- The function return the azimuth coefficient for phi of the spherical harmonic of band l and argument m.
- See Also
- spherical_harmonics_elevation
-
spherical_harmonics
Definition at line 242 of file HoaMath.h.
double Hoa::spherical_harmonics_elevation |
( |
const int |
l, |
|
|
const int |
m, |
|
|
const double |
theta |
|
) |
| |
|
inline |
The elevation part of the spherical harmonics function.
The function computes the elevation coefficient of the the spherical harmonic \form#12 for an angle \form#17 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.
- Parameters
-
l | The band of the spherical harmonic. |
m | The argument of the spherical harmonic. |
theta | The elevation. |
- Returns
- The function return the elevation coefficient for theta of the spherical harmonic of band l and argument m.
- See Also
- legendre_normalization
-
associated_legendre
-
spherical_harmonics_azimuth
-
spherical_harmonics
Definition at line 265 of file HoaMath.h.