HoaLibrary  2.0
High Order Ambisonics Library
 All Classes Namespaces Functions Enumerations Enumerator
Classes | Functions
Hoa3D Namespace Reference

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...
 

Detailed Description

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

Function Documentation

double Hoa3D::associated_legendre ( int  l,
int  m,
double  x 
)
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\)

Parameters
lThe band of the spherical harmonic.
mThe argument of the spherical harmonic.
xThe 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 104 of file Tools.h.

double Hoa3D::clip_max ( const double  value,
const double  high 
)
inline

The maximum clipping function.

The function clips a number at a maximum value.
If \(x > max\), \(f(x) = max\) else \(f(x) = x\).

Parameters
valueThe value to clip.
highThe high boundarie.
Returns
The function return the clipped value.
See Also
clip_minmax
clip_min

Definition at line 324 of file Tools.h.

double Hoa3D::clip_min ( double  value,
double  low 
)
inline

The minimum clipping function.

The function clips a number at a minimum value.
If \(x < min\), \(f(x) = min\) else \(f(x) = x\).

Parameters
valueThe value to clip.
lowThe low boundarie.
Returns
The function return the clipped value.
See Also
clip_minmax
clip_max

Definition at line 305 of file Tools.h.

double Hoa3D::clip_minmax ( double  value,
double  low,
double  high 
)
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\).

Parameters
valueThe value to clip.
lowThe low boundarie.
highThe high boundarie.
Returns
The function return the clipped value.
See Also
clip_min
clip_max

Definition at line 284 of file Tools.h.

unsigned long Hoa3D::double_factorial ( long  n)
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 {...} \]

Parameters
nThe interger.
Returns
The function return the double factorial of n.
See Also
factorial

Definition at line 75 of file Tools.h.

unsigned long Hoa3D::factorial ( long  n)
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 {...} \]

Parameters
nThe interger.
Returns
The function return the factorial of n.
See Also
double_factorial

Definition at line 54 of file Tools.h.

std::string Hoa3D::int_to_string ( int  aValue)
inline

The int to string conversion.

The function converts a interger to a string.

Parameters
valueThe value to convert.
Returns
The function return value in a string format.

Definition at line 398 of file Tools.h.

double Hoa3D::legendre_normalization ( int  l,
int  m 
)
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\)

Parameters
lThe band of the spherical harmonic.
mThe 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 138 of file Tools.h.

double Hoa3D::spherical_harmonics ( int  l,
int  m,
double  phi,
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
lThe band of the spherical harmonic.
mThe argument of the spherical harmonic.
phiThe azimuth.
thetaThe 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 218 of file Tools.h.

double Hoa3D::spherical_harmonics_azimuth ( int  l,
int  m,
double  phi 
)
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\)

Parameters
lThe band of the spherical harmonic.
mThe argument of the spherical harmonic.
phiThe 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 177 of file Tools.h.

double Hoa3D::spherical_harmonics_elevation ( int  l,
int  m,
double  theta 
)
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.

Parameters
lThe band of the spherical harmonic.
mThe argument of the spherical harmonic.
thetaThe 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 200 of file Tools.h.

double Hoa3D::wrap ( double  value,
double  low,
double  high 
)
inline

The wrapping function.

The function wraps a number between boundaries.

Parameters
valueThe value to wrap.
lowThe low boundarie.
highThe high boundarie.
Returns
The function return the wrapped value.
See Also
wrap_twopi

Definition at line 233 of file Tools.h.

double Hoa3D::wrap_twopi ( double  value)
inline

The wrapping function over \(2\pi\).

The function wraps a number between 0 and \(2\pi\).

Parameters
valueThe value to wrap.
Returns
The function return the wrapped value.
See Also
wrap

Definition at line 257 of file Tools.h.