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

The ambisonic encoder. More...

#include <Encoder.h>

Inheritance diagram for Hoa2D::Encoder:
Hoa2D::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...
 
double getAzimuth () const
 This method performs the encoding with single precision. More...
 
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 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 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 of the encoding.

Definition at line 17 of file Encoder.h.

Constructor & Destructor Documentation

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

Hoa2D::Encoder::~Encoder ( )

The encoder destructor.

The encoder destructor free the memory.

Definition at line 55 of file Encoder.cpp.

Member Function Documentation

double Hoa2D::Encoder::getAzimuth ( ) const
inline

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 output array.Get the azimuth angle The method returns the last angle of encoding between 0 and 2π.
Returns
The azimuth.

Definition at line 59 of file Encoder.h.

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

Definition at line 23 of file Encoder.cpp.

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

Definition at line 39 of file Encoder.cpp.

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

Definition at line 16 of file Encoder.cpp.