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

The ambisonic scope. More...

#include <Scope.h>

Inheritance diagram for Hoa3D::Scope:
Hoa3D::Ambisonic

Public Member Functions

 Scope (unsigned int order, unsigned int numberOfRows, unsigned int numberOfColumns)
 The Scope constructor. More...
 
 ~Scope ()
 The Scope destructor. More...
 
unsigned int getNumberOfRows () const
 Retrieve the number of rows. More...
 
unsigned int getNumberOfColumns () const
 Retrieve the number of column. More...
 
double getValue (unsigned int rowIndex, unsigned int columnIndex) const
 Retrieve the value of a point of the spherical harmonics projection. More...
 
double getRadius (unsigned int rowIndex, unsigned int columnIndex) const
 Retrieve the radius of a point of the spherical harmonics projection. More...
 
double getAzimuth (unsigned int columnIndex) const
 Retrieve the azimuth of a point of the spherical harmonics projection. More...
 
double getElevation (unsigned int rowIndex) const
 Retrieve the elevation of a point of the spherical harmonics projection. More...
 
void process (const float *inputs)
 This method performs the spherical harmonics projection with single precision. More...
 
void process (const double *inputs)
 This method performs the spherical harmonics projection with double precision. More...
 
- Public Member Functions inherited from Hoa3D::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...
 
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...
 

Detailed Description

The ambisonic scope.

The scope discretize a sphere by a set of point and uses a decoder to project the spherical harmonics on it. This class should be used for graphical interfaces outside the digital signal processing if the number of points to discretize the sphere is very large. Then you should prefer to record snapshot of the spherical harmonics and to call the process method at an interval adapted to a graphical rendering.

Definition at line 18 of file Scope.h.

Constructor & Destructor Documentation

Hoa3D::Scope::Scope ( unsigned int  order,
unsigned int  numberOfRows,
unsigned int  numberOfColumns 
)

The Scope constructor.

The Scope constructor allocates and initialize the member values to computes spherical harmonics projection on a sphere depending on a decomposition order and a sphere discretization. The sphere discretization is done by a set of points defined by rows and columns then the precision will be lower at the elevation center (0 radian) than at the top (1/2 Pi) or the bottom (-1/2 Pi) of the sphere. The number of row discretize the elevation then it set how many points are used between the bottom and the top. The number of column discretize the azimuth circle then it set how many points are used to make the turn from the front (O radian). Then the sphere is discretized by number of rows * number of columns points. The order must be at least 1. The number of rows and column should be at least 3 (but it's very low).
Parameters
orderThe order.
numberOfRowThe number of rows.
numberOfColumnThe number of columns.

Definition at line 11 of file Scope.cpp.

Hoa3D::Scope::~Scope ( )

The Scope destructor.

The Scope destructor free the memory.

Definition at line 54 of file Scope.cpp.

Member Function Documentation

double Hoa3D::Scope::getAzimuth ( unsigned int  columnIndex) const
inline

Retrieve the azimuth of a point of the spherical harmonics projection.

Retrieve the azimuth of the spherical harmonics projection for a given point defined by a row index and a column index. For the column index, 0 is the front (0 radian) and number of columns / 2 is the rear of the sphere. The maximum column index must be the number of columns - 1.
Parameters
rowIndexThe row index of the point.
columnIndexThe column index of the point.
Returns
This method returns the azimuth of a point of the ambisonic sphere.
See Also
getValue
getRadius
getElevation

Definition at line 106 of file Scope.h.

double Hoa3D::Scope::getElevation ( unsigned int  rowIndex) const
inline

Retrieve the elevation of a point of the spherical harmonics projection.

Retrieve the elevation of the spherical harmonics projection for a given point defined by a row index. For the row index, 0 is the bottom of the sphere, number of rows / 2 is at the center of the elevation and number of rows - 1 is at the top of the sphere. The maximum row index must be the number of row - 1.
Parameters
rowIndexThe row index of the point.
columnIndexThe column index of the point.
Returns
This method returns the elevation of a point of the ambisonic sphere.
See Also
getValue
getRadius
getAzimuth

Definition at line 122 of file Scope.h.

unsigned int Hoa3D::Scope::getNumberOfColumns ( ) const
inline

Retrieve the number of column.

Retrieve the number of column used to discretize the ambisonic sphere.
Returns
This method returns the number of column used to discretize the sphere.

Definition at line 57 of file Scope.h.

unsigned int Hoa3D::Scope::getNumberOfRows ( ) const
inline

Retrieve the number of rows.

Retrieve the number of rows used to discretize the ambisonic sphere.
Returns
This method returns the number of rows used to discretize the sphere.

Definition at line 47 of file Scope.h.

double Hoa3D::Scope::getRadius ( unsigned int  rowIndex,
unsigned int  columnIndex 
) const
inline

Retrieve the radius of a point of the spherical harmonics projection.

Retrieve the radius of the spherical harmonics projection for a given point defined by a row index and a column index. This the absolute of the result of the projection. For the row index, 0 is the bottom of the sphere, number of rows / 2 is at the center of the elevation and number of rows - 1 is at the top of the sphere. For the column index, 0 is the front (0 radian) and number of columns / 2 is the rear of the sphere. The maximum row index must be the number of row - 1 and the maximum column index must be the number of columns - 1.
Parameters
rowIndexThe row index of the point.
columnIndexThe column index of the point.
Returns
This method returns the radius of a point of the ambisonic sphere.
See Also
getAzimuth
getElevation
getValue

Definition at line 89 of file Scope.h.

double Hoa3D::Scope::getValue ( unsigned int  rowIndex,
unsigned int  columnIndex 
) const
inline

Retrieve the value of a point of the spherical harmonics projection.

Retrieve the result value of the spherical harmonics projection for a given point defined by a row index and a column index. The absolute of the value can be used as the radius of the point for a 3 dimentionnal representation. For the row index, 0 is the bottom of the sphere, number of rows / 2 is at the center of the elevation and number of rows - 1 is at the top of the sphere. For the column index, 0 is the front (0 radian) and number of columns / 2 is the rear of the sphere. The maximum row index must be the number of row - 1 and the maximum column index must be the number of columns - 1.
Parameters
rowIndexThe row index of the point.
columnIndexThe column index of the point.
Returns
This method returns the value of a point of the ambisonic sphere.
See Also
getradius
getAzimuth
getElevation

Definition at line 72 of file Scope.h.

void Hoa3D::Scope::process ( const float *  inputs)

This method performs the spherical harmonics projection with single precision.

You should use this method to compute the projection of the spherical harmonics over an ambisonics sphere. The inputs array contains the spherical harmonics samples and the minimum size must be the number of harmonics.
Parameters
inputsThe inputs array.

Definition at line 28 of file Scope.cpp.

void Hoa3D::Scope::process ( const double *  inputs)

This method performs the spherical harmonics projection with double precision.

You should use this method to compute the projection of the spherical harmonics over an ambisonics sphere. The inputs array contains the spherical harmonics samples and the minimum size must be the number of harmonics.
Parameters
inputsThe inputs array.

Definition at line 43 of file Scope.cpp.