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

The ambisonic vector. More...

#include <Vector.h>

Inheritance diagram for Hoa2D::Vector:
Hoa2D::Planewaves

Public Member Functions

 Vector (unsigned int numberOfChannels)
 The vector constructor. More...
 
 ~Vector ()
 The optimization destructor. More...
 
void setChannelsOffset (double offset)
 Set the offset of the channels. More...
 
double getChannelsOffset () const
 Get the offset of the channels. More...
 
void setChannelAzimuth (unsigned int index, double azimuth)
 Set the azimtuh of a channel. More...
 
void setChannelsAzimuth (double *azimuth)
 Set the azimtuh of all the channels. More...
 
void process (const float *inputs, float *outputs)
 This method compute the energy and velocity vectors with single precision. More...
 
void process (const double *inputs, double *outputs)
 This method compute the energy and velocity vectors with double precision. More...
 
void processVelocity (const float *inputs, float *outputs)
 This method compute the velocity vector with single precision. More...
 
void processVelocity (const double *inputs, double *outputs)
 This method compute the velocity vector with double precision. More...
 
void processEnergy (const float *inputs, float *outputs)
 This method compute the energy vector with single precision. More...
 
void processEnergy (const double *inputs, double *outputs)
 This method compute the energy vector with double precision. More...
 
- Public Member Functions inherited from Hoa2D::Planewaves
 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

- Protected Member Functions inherited from Hoa2D::Planewaves
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...
 

Detailed Description

The ambisonic vector.

The vector class compute the energy and the velocity vector of a soudfield for a set of channels. It is an useful tool to characterize the quality of the sound field resitution. For futher information : Michael A. Gerzon, General metatheorie of auditory localisation. Audio Engineering Society Preprint, 3306, 1992. This class retreive the cartesian coordinates of the vectors, the abscissa and the ordinate.

Definition at line 17 of file Vector.h.

Constructor & Destructor Documentation

Hoa2D::Vector::Vector ( unsigned int  numberOfChannels)

The vector constructor.

The optimization constructor allocates and initialize the member values to computes vectors. The number of channels must be at least 1.

Parameters
numberOfChannelsThe number of channels.

Definition at line 11 of file Vector.cpp.

Hoa2D::Vector::~Vector ( )

The optimization destructor.

The optimization destructor free the memory.

Definition at line 151 of file Vector.cpp.

Member Function Documentation

double Hoa2D::Vector::getChannelsOffset ( ) const
inline

Get the offset of the channels.

Retreive the azimuth offset of the channels in radian.
Returns
The offset of the channels.

Definition at line 55 of file Vector.h.

void Hoa2D::Vector::process ( const float *  inputs,
float *  outputs 
)

This method compute the energy and velocity vectors with single precision.

You should use this method for in-place or not-in-place processing and compute the vectors sample by sample. The inputs array contains the channels samples and the minimum size must be the number of channels. The outputs array contains the vectors cartesian coordinates and the minimum size must be 4. The coordinates arrangement in the outputs array is velocity abscissa, velocity ordinate, energy abscissa, energy ordinate.

Parameters
inputsThe inputs array.
outputsThe outputs array.

Definition at line 139 of file Vector.cpp.

void Hoa2D::Vector::process ( const double *  inputs,
double *  outputs 
)

This method compute the energy and velocity vectors with double precision.

You should use this method for in-place or not-in-place processing and compute the vectors sample by sample. The inputs array contains the channels samples and the minimum size must be the number of channels. The outputs array contains the vectors cartesian coordinates and the minimum size must be 4. The coordinates arrangement in the outputs array is velocity abscissa, velocity ordinate, energy abscissa, energy ordinate.

Parameters
inputsThe inputs array.
outputsThe outputs array.

Definition at line 145 of file Vector.cpp.

void Hoa2D::Vector::processEnergy ( const float *  inputs,
float *  outputs 
)

This method compute the energy vector with single precision.

You should use this method for in-place or not-in-place processing and compute the vectors sample by sample. The inputs array and contains the channels samples and the minimum size must be the number of harmonics. The outputs array contains the vectors cartesian coordinates and the minimum size must be 2. The coordinates arrangement in the outputs array is energy abscissa, energy ordinate.
Parameters
inputsThe inputs array.
outputsThe outputs array.

Definition at line 92 of file Vector.cpp.

void Hoa2D::Vector::processEnergy ( const double *  inputs,
double *  outputs 
)

This method compute the energy vector with double precision.

You should use this method for in-place or not-in-place processing and compute the vectors sample by sample. The inputs array and contains the channels samples and the minimum size must be the number of harmonics. The outputs array contains the vectors cartesian coordinates and the minimum size must be 2. The coordinates arrangement in the outputs array is energy abscissa, energy ordinate.
Parameters
inputsThe inputs array.
outputsThe outputs array.

Definition at line 115 of file Vector.cpp.

void Hoa2D::Vector::processVelocity ( const float *  inputs,
float *  outputs 
)

This method compute the velocity vector with single precision.

You should use this method for in-place or not-in-place processing and compute the vectors sample by sample. The inputs array and contains the channels samples and the minimum size must be the number of channels. The outputs array contains the vectors cartesian coordinates and the minimum size must be 2. The coordinates arrangement in the outputs array is velocity abscissa, velocity ordinate.
Parameters
inputsThe inputs array.
outputsThe outputs array.

Definition at line 54 of file Vector.cpp.

void Hoa2D::Vector::processVelocity ( const double *  inputs,
double *  outputs 
)

This method compute the velocity vector with double precision.

You should use this method for in-place or not-in-place processing and compute the vectors sample by sample. The inputs array and contains the channels samples and the minimum size must be the number of channels. The outputs array contains the vectors cartesian coordinates and the minimum size must be 2. The coordinates arrangement in the outputs array is velocity abscissa, velocity ordinate.
Parameters
inputsThe inputs array.
outputsThe outputs array.

Definition at line 73 of file Vector.cpp.

void Hoa2D::Vector::setChannelAzimuth ( unsigned int  index,
double  azimuth 
)

Set the azimtuh of a channel.

Set the azimtuh of a channel. The azimtuh 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.

Parameters
indexThe index of the channel.
azimuthThe azimuth.

Definition at line 37 of file Vector.cpp.

void Hoa2D::Vector::setChannelsAzimuth ( double *  azimuth)

Set the azimtuh of all the channels.

Set the azimtuh of all the channels. 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.

Parameters
azimuthsThe azimuths array.
See Also
setChannelAzimuth

Definition at line 44 of file Vector.cpp.

void Hoa2D::Vector::setChannelsOffset ( double  offset)

Set the offset of the channels.

Set the azimuth offset of the channels in radian.
Parameters
offsetAn azimuth value.

Definition at line 27 of file Vector.cpp.