HoaLibrary
2.0
High Order Ambisonics Library
|
The ambisonic encoder. More...
#include <Encoder.h>
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... | |
![]() | |
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... | |
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.
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.
order | The 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.
|
inline |
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.
input | The input sample. |
outputs | The 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.
input | The input sample. |
outputs | The 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.
azimuth | The azimuth. |
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.
elevation | The elevation. |
Definition at line 65 of file Encoder.cpp.