HoaLibrary
2.0
High Order Ambisonics Library
|
The ambisonic multi-decoder. More...
#include <Decoder.h>
Public Types | |
enum | Mode { Regular = 0, Irregular = 1, Binaural = 2 } |
Public Member Functions | |
DecoderMulti (unsigned int order) | |
The multi-decoder constructor. More... | |
~DecoderMulti () | |
The multi-decoder destructor. More... | |
void | setDecodingMode (Mode mode) |
Set the decoding mode. More... | |
Mode | getDecodingMode () const |
Retrieve the decoding mode. More... | |
void | setNumberOfChannels (unsigned int numberOfChannels) |
Set the number of channels for the regular or irregular decoding. More... | |
unsigned int | getNumberOfChannels () const |
Retrieve the number of channels. More... | |
void | setChannelsOffset (double offset) |
Set the offset of the channels for the regular decoding. More... | |
double | getChannelsOffset () const |
Get the offset of the channels of the regular decoding. More... | |
void | setChannelAzimuth (unsigned int index, double azimuth) |
Set the azimuth of a channel for the irregular decoding mode. More... | |
void | setChannelsAzimtuh (double *azimuths) |
Set the azimtuh of all the channels for the irregular decoding mode. More... | |
void | setSampleRate (unsigned int sampleRate) |
Set the sample rate. More... | |
void | setVectorSize (unsigned int vectorSize) |
Set the vector size. More... | |
void | setPinnaSize (DecoderBinaural::PinnaSize pinnaSize) |
Set the pinna size. More... | |
bool | getBinauralState () const |
Retrieve if the binaural decoder is ready to process. More... | |
DecoderBinaural::PinnaSize | getPinnaSize () const |
Retrieve if the pinna size of the binaural decoder. More... | |
double | getChannelAzimuth (unsigned int index) const |
Retrieve the azimuth of a channel. More... | |
double | getChannelAbscissa (unsigned int index) const |
Retrieve the abscissa of a channel. More... | |
double | getChannelOrdinate (unsigned int index) const |
Retrieve the ordinate of a channel. More... | |
std::string | getChannelName (unsigned int index) |
Retrieve a name for a channel. More... | |
void | processBinaural (const float *const *inputs, float **outputs) |
This method performs the binaural decoding with single precision. More... | |
void | processBinaural (const double *const *inputs, double **outputs) |
This method performs the binaural decoding with double precision. More... | |
void | processRegular (const float *inputs, float *outputs) |
This method performs the decoding depending of the mode with single precision. More... | |
void | processRegular (const double *inputs, double *outputs) |
This method performs the regular decoding with single precision. More... | |
void | processIrregular (const float *inputs, float *outputs) |
This method performs the irregular decoding with single precision. More... | |
void | processIrregular (const double *inputs, double *outputs) |
This method performs the irregular decoding with single 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... | |
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... | |
![]() | |
Planewaves (unsigned int numberOfChannels) | |
The planewaves constructor. More... | |
~Planewaves () | |
The planewaves destructor. More... | |
unsigned int | getNumberOfChannels () const |
Retrieve the number of channels. More... | |
double | getChannelAzimuth (unsigned int index) const |
Retrieve the azimuth of a channel. More... | |
double | getChannelAbscissa (unsigned int index) const |
Retrieve the abscissa of a channel. More... | |
double | getChannelOrdinate (unsigned int index) const |
Retrieve the ordinate of a channel. More... | |
std::string | getChannelName (unsigned int index) |
Retrieve a name for a channel. More... | |
Additional Inherited Members | |
![]() | |
void | setChannelAzimuth (unsigned int index, double azimuth) |
Set the azimuth of a channel. More... | |
void | setChannelsAzimuth (double *azimuths) |
Set the azimtuh of all the channels. More... | |
The ambisonic multi-decoder.
The multi-decoder is a class that facilitates the use of the three decoder : regular, irregular and binaural.
Hoa2D::DecoderMulti::DecoderMulti | ( | unsigned int | order | ) |
The multi-decoder constructor.
The multi-decoder constructor allocates and initialize the three decoder. The default decoder will be the regular one with 2 * order + 2 number of channels.
order | The order |
Definition at line 456 of file Decoder.cpp.
Hoa2D::DecoderMulti::~DecoderMulti | ( | ) |
The multi-decoder destructor.
The multi-decoder destructor free the memory.
Definition at line 537 of file Decoder.cpp.
|
inline |
|
inline |
Retrieve the abscissa of a channel.
Retrieve the abscissa of a channel. The abscissa is between -1 and 1, -1 is the left of the soundfield, 0 is the center of the soundfield and 1 is the right of the soundfield. The maximum index must be the number of channels - 1.
index | The index of the loudspeaker. |
|
inline |
Retrieve the azimuth of a channel.
Retrieve the azimuth of a channel. The azimuth of the channel is in radian, 0 radian is at the front of the soundfield and Pi is at the back of the sound field. The maximum index must be the number of channels - 1.
index | The index of the channel. |
|
inline |
|
inline |
Retrieve the ordinate of a channel.
Retrieve the ordinate of a channel. The ordinate is between -1 and 1, -1 is the back of the soundfield, 0 is the center of the soundfield and 1 is the front of the soundfield. The maximum index must be the number of channels - 1.
index | The index of the channel. |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
This method performs the binaural decoding with single precision.
You should use this method for not-in-place processing and performs the binaural decoding on block of samples. The inputs matrix contains the spherical harmonics samples : inputs[number of harmonics][vector size] and the outputs array contains the headphones samples : outputs[2][vector size].
inputs | The input samples. |
outputs | The output array that contains samples destinated to channels. |
|
inline |
This method performs the binaural decoding with double precision.
You should use this method for not-in-place processing and performs the binaural decoding on block of samples. The inputs matrix contains the spherical harmonics samples : inputs[number of harmonics][vector size] and the outputs array contains the headphones samples : outputs[2][vector size].
inputs | The input samples. |
outputs | The output array that contains samples destinated to channels. |
|
inline |
This method performs the irregular decoding with single precision.
You should use this method for in-place or not-in-place processing and performs the irregular decoding sample by sample. The inputs array contains the spherical harmonics samples and the minimum size must be the number of harmonics and the outputs array contains the channels samples and the minimum size must be the number of channels.
input | The input sample. |
outputs | The output array that contains samples destinated to channels. |
|
inline |
This method performs the irregular decoding with single precision.
You should use this method for in-place or not-in-place processing and performs the irregular decoding sample by sample. The inputs array contains the spherical harmonics samples and the minimum size must be the number of harmonics and the outputs array contains the channels samples and the minimum size must be the number of channels.
input | The input sample. |
outputs | The output array that contains samples destinated to channels. |
|
inline |
This method performs the decoding depending of the mode with single precision.
You should use this method for not-in-place processing and performs the binaural decoding on block of samples. The inputs matrix contains the spherical harmonics samples : inputs[number of harmonics][vector size] and the outputs array contains the headphones samples : outputs[2][vector size].
inputs | The input samples. |
outputs | The output array that contains samples destinated to channels. |
|
inline |
This method performs the regular decoding with single precision.
You should use this method for in-place or not-in-place processing and performs the regular decoding sample by sample. The inputs array contains the spherical harmonics samples and the minimum size must be the number of harmonics and the outputs array contains the channels samples and the minimym size must be the number of channels.
input | The input sample. |
outputs | The output array that contains samples destinated to channels. |
void Hoa2D::DecoderMulti::setChannelAzimuth | ( | unsigned int | index, |
double | azimuth | ||
) |
Set the azimuth of a channel for the irregular decoding mode.
Set the azimuth of a channel for the irregular decoding mode. The azimuth is in radian between 0 and 2 Pi, O is the front of the soundfield and Pi is the back of the sound field. The maximum index must be the number of channel - 1.
index | The index of the loudspeaker. |
azimuth | The azimuth. |
Definition at line 498 of file Decoder.cpp.
void Hoa2D::DecoderMulti::setChannelsAzimtuh | ( | double * | azimuths | ) |
Set the azimtuh of all the channels for the irregular decoding mode.
Set the azimtuh of all the channels for the irregular decoding mode. It is more efficient to set all the channels azimuths at the same time because even if only one channel has changed, all the decoding matrix have to be recomputed. The azimuths are in radian between 0 and 2 Pi, O is the front of the soundfield and Pi is the back of the sound field. The azimtuhs array must have a minimum size of the number of channels.
azimuths | The azimuths array. |
Definition at line 506 of file Decoder.cpp.
void Hoa2D::DecoderMulti::setChannelsOffset | ( | double | offset | ) |
Set the offset of the channels for the regular decoding.
Set the azimuth offset of the channels in radian for the regular decoding, if the decoding mode.
offset | An azimuth value. |
Definition at line 486 of file Decoder.cpp.
void Hoa2D::DecoderMulti::setDecodingMode | ( | Mode | mode | ) |
Set the decoding mode.
Set the decoding mode. It will allocate the right decoder and initialize the class.
mode | The decoding mode. |
Definition at line 464 of file Decoder.cpp.
void Hoa2D::DecoderMulti::setNumberOfChannels | ( | unsigned int | numberOfChannels | ) |
Set the number of channels for the regular or irregular decoding.
Set the number of channels for the regular or irregular decoding.
numberOfChannels | The number of channels. |
Definition at line 469 of file Decoder.cpp.
void Hoa2D::DecoderMulti::setPinnaSize | ( | DecoderBinaural::PinnaSize | pinnaSize | ) |
Set the pinna size.
Set the pinna size of the binaural decoding.
pinnaSize | The pinna size. |
Definition at line 514 of file Decoder.cpp.
void Hoa2D::DecoderMulti::setSampleRate | ( | unsigned int | sampleRate | ) |
Set the sample rate.
Set the sample rate. The sample will change the impulse responses size and their sizes increase with it. The valid sample rate are 44100, 48000, 88200 and 9600. Setting the sample rate will load the impulse responses, it is essential to define it before the digital signal processing.
sampleRate | The sample rate. |
Definition at line 519 of file Decoder.cpp.
void Hoa2D::DecoderMulti::setVectorSize | ( | unsigned int | vectorSize | ) |
Set the vector size.
Set the vector size. Setting the sample size will allocate the vector to compute the binaural decoding.
vectorSize | The vector rate. |
Definition at line 528 of file Decoder.cpp.