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

The ambisonic optimization. More...

#include <Optim.h>

Inheritance diagram for Hoa2D::Optim:
Hoa2D::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...
 
Mode getMode () const
 Retrieve the optimization mode. More...
 
void setMode (Mode mode)
 This method set 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 Hoa2D::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...
 
long getHarmonicArgument (unsigned int index) const
 Retrieve the argument of an harmonic. More...
 
long getHarmonicBand (unsigned int index) const
 Retrieve the band of an harmonic. More...
 
std::string getHarmonicsName (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 optimization), 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 circle, and for a listener placed at the perfect center of the circle. MaxRe should be used for auditory confined to the center of the circle. InPhase should be used when the auditory covers the entire loudspeakers area and when the loudspeakers arragement is not a perfect circle or when the loudspeakers are not to equal distance. 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 16 of file Optim.h.

Member Enumeration Documentation

Enumerator
Basic 

Basic Optimization

MaxRe 

Max Re Optimization

InPhase 

In Phase Optimization

Definition at line 19 of file Optim.h.

Constructor & Destructor Documentation

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

Definition at line 11 of file Optim.cpp.

Hoa2D::Optim::~Optim ( )

The optimization destructor.

The optimization destructor free the memory.

Definition at line 59 of file Optim.cpp.

Member Function Documentation

Mode Hoa2D::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 50 of file Optim.h.

void Hoa2D::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 47 of file Optim.cpp.

void Hoa2D::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 53 of file Optim.cpp.

void Hoa2D::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.