Loading [MathJax]/extensions/tex2jax.js
HoaLibrary  2.0
High Order Ambisonics Library
All Classes Namespaces Functions Enumerations Enumerator
Public Member Functions | List of all members
Hoa3D::Encoder Class Reference

The ambisonic encoder. More...

#include <Encoder.h>

Inheritance diagram for Hoa3D::Encoder:
Hoa3D::Ambisonic

Public Member Functions

 Encoder (unsigned int order)
 The encoder constructor. More...
 
 ~Encoder ()
 The encoder destructor. More...
 
void setAzimuth (const double azimuth)
 This method set the angle of azimuth. More...
 
void setElevation (const double elevation)
 This method set the angle of elevation. More...
 
double getNormalization (const unsigned int index) const
 
void process (const float input, float *outputs)
 This method performs the encoding with single precision. More...
 
void process (const double input, double *outputs)
 This method performs the encoding 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 encoder.

The encoder should be used to encode a signal in the spherical harmonics domain depending of an order of decomposition. It allows to control the azimuth and the elevation of the encoding. If you want to spatialize with distance compensation, you should use the Map class.

See Also
Map

Definition at line 19 of file Encoder.h.

Constructor & Destructor Documentation

Hoa3D::Encoder::Encoder ( unsigned int  order)

The encoder constructor.

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

Parameters
orderThe order.

Definition at line 11 of file Encoder.cpp.

Hoa3D::Encoder::~Encoder ( )

The encoder destructor.

The encoder destructor free the memory.

Definition at line 116 of file Encoder.cpp.

Member Function Documentation

double Hoa3D::Encoder::getNormalization ( const unsigned int  index) const
inline

Retreive the normalization of an harmonics

Parameters
indexThe index of the harmonics.

Definition at line 63 of file Encoder.h.

void Hoa3D::Encoder::process ( const float  input,
float *  outputs 
)

This method performs the encoding with single precision.

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

Parameters
inputThe input sample.
outputsThe outputs array.

Definition at line 70 of file Encoder.cpp.

void Hoa3D::Encoder::process ( const double  input,
double *  outputs 
)

This method performs the encoding with double precision.

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

Parameters
inputThe input sample.
outputsThe outputs array.

Definition at line 92 of file Encoder.cpp.

void Hoa3D::Encoder::setAzimuth ( const double  azimuth)

This method set the angle of azimuth.

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.

Parameters
azimuthThe azimuth.
See Also
setElevation()

Definition at line 60 of file Encoder.cpp.

void Hoa3D::Encoder::setElevation ( const double  elevation)

This method set the angle of elevation.

The angle of elevation 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 from bottom to the top. The 0 radian is centered at the "front" of the soundfield, then Pi/2 is at the top, -Pi/2 is at the bottom and Pi is behind. Note that if the angle of elevation is between Pi/2 and 3*Pi/2, the azimuth is reversed.

Parameters
elevationThe elevation.
See Also
setElevation()

Definition at line 65 of file Encoder.cpp.