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

The ambisonic multi-encoder with distance compensation. More...

#include <Map.h>

Inheritance diagram for Hoa2D::Map:
Hoa2D::Ambisonic

Public Member Functions

 Map (unsigned int order, unsigned int numberOfSources)
 The map constructor. More...
 
 ~Map ()
 The map destructor. More...
 
unsigned int getNumberOfSources () const
 This method retrieve the number of sources. More...
 
void setAzimuth (const unsigned int index, const double azimuth)
 This method set the angle of azimuth of a source. More...
 
void setRadius (const unsigned int index, const double radius)
 This method set the radius of a source. More...
 
void setMute (const unsigned int index, const bool muted)
 This method mute or unmute a source. More...
 
double getAzimuth (const unsigned int index) const
 This method retrieve the azimuth of a source. More...
 
double getRadius (const unsigned int index) const
 This method retrieve the radius of a source. More...
 
bool getMute (const unsigned int index, const bool muted) const
 This method retrieve the mute or unmute state of a source. More...
 
void process (const float *inputs, float *outputs)
 This method performs the encoding with distance compensation with single precision. More...
 
void process (const double *inputs, double *outputs)
 This method performs the encoding with distance compensation 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 multi-encoder with distance compensation.

The map is a multi Encoder with distance compensation. It uses intances of the Wider class to decrease the directionnality of sources by simulating fractionnal orders when the sources are inside the ambisonic circle and a simple diminution of the gain when the sources get away from the ambisonic circle.

See Also
Encoder

Definition at line 21 of file Map.h.

Constructor & Destructor Documentation

Hoa2D::Map::Map ( unsigned int  order,
unsigned int  numberOfSources 
)

The map constructor.

The map constructor allocates and initialize the member values and classes depending of a decomposition order and the number of sources. The order and the number of sources must be at least 1.

Parameters
orderThe order.
numberOfSourcesThe number of sources.

Definition at line 11 of file Map.cpp.

Hoa2D::Map::~Map ( )

The map destructor.

The map destructor free the memory and deallocate the member classes.

Definition at line 113 of file Map.cpp.

Member Function Documentation

double Hoa2D::Map::getAzimuth ( const unsigned int  index) const
inline

This method retrieve the azimuth of a source.

Retrieve the azimuth of a source.

Parameters
indexThe index of the source.
Returns
The azimuth of the source if the source exists, otherwise the function generates an error.

Definition at line 92 of file Map.h.

bool Hoa2D::Map::getMute ( const unsigned int  index,
const bool  muted 
) const
inline

This method retrieve the mute or unmute state of a source.

Get the Mute state of a source.

Parameters
indexThe index of the source.
Returns
The mute state of the source if the source exists, otherwise the function generates an error.
See Also
setMute()

Definition at line 120 of file Map.h.

unsigned int Hoa2D::Map::getNumberOfSources ( ) const
inline

This method retrieve the number of sources.

Retrieve the number of sources.

Returns
The number of sources.

Definition at line 55 of file Map.h.

double Hoa2D::Map::getRadius ( const unsigned int  index) const
inline

This method retrieve the radius of a source.

Retrieve the radius of a source.

Parameters
indexThe index of the source.
Returns
The radius of the source if the source exists, otherwise the function generates an error.

Definition at line 104 of file Map.h.

void Hoa2D::Map::process ( const float *  inputs,
float *  outputs 
)

This method performs the encoding with distance compensation with single precision.

You should use this method for in-place or not-in-place processing and performs the encoding with distance compensation sample by sample. The inputs array contains the samples of the sources and the minimum size sould be the number of sources. The 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 66 of file Map.cpp.

void Hoa2D::Map::process ( const double *  inputs,
double *  outputs 
)

This method performs the encoding with distance compensation with double precision.

You should use this method for in-place or not-in-place processing and performs the encoding with distance compensation sample by sample. The inputs array contains the samples of the sources and the minimum size sould be the number of sources. The 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 89 of file Map.cpp.

void Hoa2D::Map::setAzimuth ( const unsigned int  index,
const double  azimuth 
)

This method set the angle of azimuth of a source.

The angle of azimuth in radian and you should prefer to use it between 0 and 2 Pi to avoid recursive wrapping of the value. The direction of rotation is counterclockwise. The 0 radian is Pi/2 phase shifted relative to a mathematical representation of a circle, then the 0 radian is at the "front" of the soundfield. The index must be between 0 and the number of sources - 1.

Parameters
indexThe index of the source.
azimuthThe azimuth.
See Also
setRadius()

Definition at line 30 of file Map.cpp.

void Hoa2D::Map::setMute ( const unsigned int  index,
const bool  muted 
)

This method mute or unmute a source.

Mute or unmute a source with a boolean value. The index must be between 0 and the number of sources - 1.

Parameters
indexThe index of the source.
mutedThe mute state.

Definition at line 51 of file Map.cpp.

void Hoa2D::Map::setRadius ( const unsigned int  index,
const double  radius 
)

This method set the radius of a source.

The radius is between 0 and infinity. At 0, the source is in the center of the ambisonic circle and at 1, the source is at the limit of the ambisonic circle. Over 1, the source get away the ambisonic circle. The index must be between 0 and the number of sources - 1.

Parameters
indexThe index of the source.
radiusThe radius.
See Also
setAzimuth()

Definition at line 36 of file Map.cpp.