HoaLibrary
2.0
High Order Ambisonics Library
|
The ambisonic binaural decoder. More...
#include <Decoder.h>
Public Types | |
enum | PinnaSize { Small = 0, Large = 1 } |
Public Member Functions | |
DecoderBinaural (unsigned int order) | |
The binaural decoder constructor. More... | |
~DecoderBinaural () | |
The binaural decoder destructor. More... | |
void | setSampleRate (unsigned int sampleRate) |
Set the sample rate. More... | |
void | setVectorSize (unsigned int vectorSize) |
Set the vector size. More... | |
bool | getState () const |
Retrieve if the decoder is ready to process. More... | |
void | setPinnaSize (PinnaSize pinnaSize) |
Set the pinna size. More... | |
PinnaSize | getPinnaSize () const |
Retrieve the pinna size. More... | |
std::string | getChannelName (unsigned int index) |
Retrieve a name for a channel. More... | |
void | process (const float *const *inputs, float **outputs) |
This method performs the binaural decoding with single precision. More... | |
void | process (const double *const *inputs, double **outputs) |
This method performs the binaural decoding 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... | |
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 binaural decoder.
The binaural decoder should be used to decode an ambisonic sound field for headphones.
Hoa2D::DecoderBinaural::DecoderBinaural | ( | unsigned int | order | ) |
The binaural decoder constructor.
The binaural decoder constructor allocates and initialize the member values to the decoding matrix depending of a decomposition order and a number of channels. The order and the number of channels must be at least 1 and the maximum order is 35. It is essential to set the sample rate and the vector size to load the impulse response and to be able to use the binaural decoding. The binaural process is optimized for block processing. The HRTF are from the MIT database.
order | The order |
Definition at line 203 of file Decoder.cpp.
Hoa2D::DecoderBinaural::~DecoderBinaural | ( | ) |
The binaural decoder destructor.
The binaural decoder destructor free the memory.
Definition at line 430 of file Decoder.cpp.
|
inline |
|
inline |
|
inline |
void Hoa2D::DecoderBinaural::process | ( | const float *const * | inputs, |
float ** | outputs | ||
) |
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. |
Definition at line 359 of file Decoder.cpp.
void Hoa2D::DecoderBinaural::process | ( | const double *const * | inputs, |
double ** | outputs | ||
) |
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].
input | The input samples. |
outputs | The output array that contains samples destinated to channels. |
Definition at line 390 of file Decoder.cpp.
void Hoa2D::DecoderBinaural::setPinnaSize | ( | PinnaSize | pinnaSize | ) |
Set the pinna size.
Set the pinna size used to compute the HRTF. Setting the pinna size will re-allocate the vector to compute the binaural decoding.
pinnaSize | The pinna size. |
Definition at line 236 of file Decoder.cpp.
void Hoa2D::DecoderBinaural::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 247 of file Decoder.cpp.
void Hoa2D::DecoderBinaural::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 size. |
Definition at line 323 of file Decoder.cpp.