HoaLibrary  2.0
High Order Ambisonics Library
 All Classes Namespaces Functions Enumerations Enumerator
Public Types | Public Member Functions | List of all members
Hoa3D::Optim Class Reference

The ambisonic optimization. More...

#include <Optim.h>

Inheritance diagram for Hoa3D::Optim:
Hoa3D::Ambisonic

Public Types

enum  Mode { Basic = 0, MaxRe = 1, InPhase = 2 }
 

Public Member Functions

 Optim (unsigned int order, Mode mode)
 The optimization constructor. More...
 
 ~Optim ()
 The optimization destructor. More...
 
void setMode (Mode mode)
 This method set the optimization mode. More...
 
Mode getMode () const
 Retrieve the optimization mode. More...
 
void process (const float *inputs, float *outputs)
 This method performs the optimization with single precision. More...
 
void process (const double *inputs, double *outputs)
 This method performs the optimization with double precision. More...
 
- Public Member Functions inherited from Hoa3D::Ambisonic
 Ambisonic (unsigned int order)
 The ambisonic constructor. More...
 
 ~Ambisonic ()
 The ambisonic destructor. More...
 
unsigned int getOrder () const
 Retrieve the decomposition order. More...
 
unsigned int getNumberOfHarmonics () const
 Retrieve the number of harmonics. More...
 
int getHarmonicArgument (const unsigned int index) const
 Retrieve the argument of an harmonic. More...
 
unsigned int getHarmonicBand (const unsigned int index) const
 Retrieve the band of an harmonic. More...
 
std::string getHarmonicsName (const unsigned int index) const
 Retrieve a name for an harmonic. More...
 

Detailed Description

The ambisonic optimization.

The optimization should be used to optimize the ambisonic sound field. There are 3 optimization modes, Basic (no optimizations), MaxRe (energy vector optimization) and InPhase (energy and velocity vector optimization). Basic has no effect, it should be used with a perfect ambisonic loudspeakers (arrengement where all the loudspeakers are to equal distance on a sphere) and for a listener placed at the perfect center of the sphere. MaxRe should be used for auditory confined to the center of the sphere. InPhase should be used when the auditory covers the entire loudspeaker area and when the loudspeakers arragement is not a perfect sphere or when the loudspeakers are not to equal distance. Note that the optimizations decrease the precision sound field restitution thus it can be compared to particular cases of the fractional orders.

Definition at line 17 of file Optim.h.

Member Enumeration Documentation

Enumerator
Basic 

basic Optimization

MaxRe 

max-re Optimization

InPhase 

in-phase Optimization

Definition at line 20 of file Optim.h.

Constructor & Destructor Documentation

Hoa3D::Optim::Optim ( unsigned int  order,
Mode  mode 
)

The optimization constructor.

The optimization constructor allocates and initialize the member values to computes spherical harmonics weighted coefficients depending of a decomposition order. The order must be at least 1.

Parameters
orderThe order.
modeThe optimization mode.

Definition at line 11 of file Optim.cpp.

Hoa3D::Optim::~Optim ( )

The optimization destructor.

The optimization destructor free the memory.

Definition at line 56 of file Optim.cpp.

Member Function Documentation

Mode Hoa3D::Optim::getMode ( ) const
inline

Retrieve the optimization mode.

Retrieve the optimization mode : Basic, MaxRe or InPhase.

Returns
The method returns the optimization mode.

Definition at line 59 of file Optim.h.

void Hoa3D::Optim::process ( const float *  inputs,
float *  outputs 
)

This method performs the optimization with single precision.

You should use this method for in-place or not-in-place processing and performs the optimization sample by sample. The inputs array and outputs array contains the spherical harmonics samples and the minimum size must be the number of harmonics.

Parameters
inputsThe inputs array.
outputsThe outputs array.

Definition at line 44 of file Optim.cpp.

void Hoa3D::Optim::process ( const double *  inputs,
double *  outputs 
)

This method performs the optimization with double precision.

You should use this method for in-place or not-in-place processing and performs the optimization sample by sample. The inputs array and outputs array contains the spherical harmonics samples and the minimum size must be the number of harmonics.

Parameters
inputsThe inputs array.
outputsThe outputs array.

Definition at line 50 of file Optim.cpp.

void Hoa3D::Optim::setMode ( Mode  mode)

This method set the optimization mode.

The mode should be one of the 3 optimization modes, Basic, MaxRe or InPhase.

Parameters
modeThe optimization mode.

Definition at line 17 of file Optim.cpp.