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

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

#include <Map.h>

Inheritance diagram for Hoa3D::Map:
Hoa3D::Ambisonic

Public Member Functions

 Map (unsigned int order, unsigned int numberOfSources)
 The map constructor. More...
 
 ~Map ()
 The map destructor. More...
 
void setAzimuth (unsigned int index, const double azimuth)
 This method set the angle of azimuth of a source. More...
 
void setElevation (unsigned int index, const double elevation)
 This method set the angle of elevation of a source. More...
 
void setDistance (unsigned int index, const double distance)
 This method set the diatnce of a source. More...
 
unsigned int getNumberOfSources () const
 This method retrieve the number of sources. 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 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 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 sphere and a simple diminution of the gain when the sources get away from the ambisonic sphere.

See Also
Encoder

Definition at line 21 of file Map.h.

Constructor & Destructor Documentation

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

Hoa3D::Map::~Map ( )

The map destructor.

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

Definition at line 77 of file Map.cpp.

Member Function Documentation

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

This method retrieve the number of sources.

Retrieve the number of sources.

Returns
The number of sources.

Definition at line 83 of file Map.h.

void Hoa3D::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 53 of file Map.cpp.

void Hoa3D::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 65 of file Map.cpp.

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

This method set the angle of azimuth of a source.

The angle of azimuth in radian, look at the Encoder for further informations. The index must be between 0 and the number of sources.

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

Definition at line 26 of file Map.cpp.

void Hoa3D::Map::setDistance ( unsigned int  index,
const double  distance 
)

This method set the diatnce of a source.

The distance is between 0 and infinity. At 0, the source is in the center of the ambisonic sphere and at 1, the source is at the surface of the ambisonic sphere. Over 1, the source get away the ambisonic sphere. The index must be between 0 and the number of sources.

Parameters
indexThe index of the source.
elevationThe elevation.
See Also
setAzimuth()
setElevation()

Definition at line 38 of file Map.cpp.

void Hoa3D::Map::setElevation ( unsigned int  index,
const double  elevation 
)

This method set the angle of elevation of a source.

The angle of elevation in radian, look at the Encoder for further informations. The index must be between 0 and the number of sources.

Parameters
indexThe index of the source.
elevationThe elevation.
See Also
setAzimuth()
setDistance()

Definition at line 32 of file Map.cpp.