HOA Library  beta 3.0
High Order Ambisonics Library
Public Types | Public Member Functions | List of all members
Optim< D, T > Class Template Reference

The class optimizes the ambisonic sound field for several restitution systems. More...

#include <Hoa_Optim.hpp>

Inheritance diagram for Optim< D, T >:
ProcessorHarmonics< D, T > Processor< D, T >

Public Types

Public Member Functions

 Optim (size_t order) hoa_noexcept
 The constructor. More...
 
 ~Optim () hoa_noexcept
 The destructor.
 
Mode getMode () const hoa_noexcept
 Returns the current optimization mode.
 
void setMode (Mode mode) hoa_noexcept
 Set the optimization mode. More...
 
void process (T const *inputs, T *outputs) hoa_noexcept hoa_final
 The method performs the optimization on the harmonics signal. More...
 
- Public Member Functions inherited from ProcessorHarmonics< D, T >
 ProcessorHarmonics (const size_t order) hoa_noexcept
 The harmonics constructor. More...
 
virtual ~ProcessorHarmonics () hoa_noexcept
 The harmonics destructor.
 
size_t getDecompositionOrder () const hoa_noexcept
 Returns the order of decomposition.
 
size_t getNumberOfHarmonics () const hoa_noexcept
 Returns the number of harmonics.
 
size_t getHarmonicDegree (const size_t index) const hoa_noexcept
 Returns the degree of an harmonic. More...
 
long getHarmonicOrder (const size_t index) const hoa_noexcept
 Returns the azimuthal order of an harmonic. More...
 
size_t getHarmonicIndex (const size_t degree, const long order) const hoa_noexcept
 Returns the index of an harmonic given the degree and the azimuthal order. More...
 
std::string getHarmonicName (const size_t index) const hoa_noexcept
 Returns the name of an harmonic. More...
 
getHarmonicNormalization (const size_t index) const hoa_noexcept
 Returns the normalization of an harmonic. More...
 
getHarmonicSemiNormalization (const size_t index) const hoa_noexcept
 Returns the semi-normalization of an harmonic. More...
 
- Public Member Functions inherited from Processor< D, T >
virtual ~Processor () hoa_noexcept
 The destructor.
 
virtual void process (const T *inputs, T *outputs) hoa_noexcept
 The pure virtual method performs that performs the digital signal processing. More...
 

Detailed Description

template<Dimension D, typename T>
class hoa::Optim< D, T >

The class optimizes the ambisonic sound field for several restitution systems.

The class should be used to optimize the ambisonic sound field. There are 3 optimizations, basic (no optimization), max-re (energy vector optimization) and in-phase (energy and velocity vector optimization).
The basic optimization has no effect, it should be used (or not) with a perfect ambisonic channels arrangement where all the channels are to equal distance on a circle or a sphere, and for a listener placed at the perfect center of the circle of the sphere. The basic optimization generates a set of weights defined by:

\[W^{basic}_{l,m} = 1\]


The max-re should be used should be used for an auditory confined to the center of the circle or the sphere. The max-re optimization generates a set of weights defined by:

\[W^{max-re}_{l,m} = \cos{(l \times \frac{\pi}{2N + 2})}\]


The in-phase optimization should be used when the auditory covers the entire channels area and/or when the channels arrangement is not a perfect circle or a perfect sphere (when the channels are not to equal distance for example).The in-phase optimization generates a set of weights defined by:

\[W^{in-phase}_{l,m} = \frac{N!^2}{(N + l)!(N -l)!}\]


with \(N\) the order of decomposition, \(l\) the degree and \(m\) the azimuthal order. Note that the optimizations decrease the precision of the sound field restitution thus it can be compared to particular cases of the fractional orders.

Definition at line 40 of file Hoa_Optim.hpp.

Member Enumeration Documentation

enum Mode

The different optimization mode.

See also
getMode(), setMode()
Enumerator
Basic 

The basic optimization.

MaxRe 

The max-re optimization.

InPhase 

The in-phase optimization.

Definition at line 46 of file Hoa_Optim.hpp.

Constructor & Destructor Documentation

Optim ( size_t  order)
inline

The constructor.

Parameters
orderThe order of decomposition.

Definition at line 55 of file Hoa_Optim.hpp.

Member Function Documentation

void setMode ( Mode  mode)
inline

Set the optimization mode.

Parameters
modeThe mode of optimization.

Definition at line 67 of file Hoa_Optim.hpp.

void process ( T const *  inputs,
T *  outputs 
)
inline

The method performs the optimization on the harmonics signal.

The method can be used for in-place or not-in-place processing and sample by sample. The inputs array and outputs array contains the spherical harmonics samples thus the minimum size of the array must be the number of harmonics.

Parameters
inputsThe inputs array.
outputsThe outputs array.

Definition at line 104 of file Hoa_Optim.hpp.