HOA Library  beta 3.0
High Order Ambisonics Library
Public Types | Public Member Functions | List of all members
Exchanger< D, T > Class Template Referenceabstract

The echanger class renumber and normalize the harmonics channels. More...

#include <Hoa_Exchanger.hpp>

Inheritance diagram for Exchanger< D, T >:
ProcessorHarmonics< D, T > Processor< D, T >

Public Types

Public Member Functions

 Exchanger (const size_t order) hoa_noexcept
 The exchanger constructor. More...
 
virtual ~Exchanger () hoa_noexcept=0
 The exchanger destructor. More...
 
virtual void process (T const *inputs, T *outputs) hoa_noexcept
 This method performs the numbering and the normalization. More...
 
virtual void setNumbering (const Numbering mode) hoa_noexcept
 Sets the numbering conversion. More...
 
virtual Numbering getNumbering () const hoa_noexcept
 Gets the numbering conversion. More...
 
virtual void setNormalization (const Normalization mode) hoa_noexcept
 Sets the normalization conversion. More...
 
virtual Normalization getNormalization () const hoa_noexcept
 Gets the normalization conversion. More...
 
virtual long getInputHarmonicOrder (const size_t index) const hoa_noexcept
 Retrieves the harmonic order of an input depending on the current numbering configuration. More...
 
virtual long getOutputHarmonicOrder (const size_t index) const hoa_noexcept
 Retrieves the harmonic order of an output depending on the current numbering configuration. More...
 
virtual std::string getHarmonicName (const size_t index, const bool isInput) const hoa_noexcept
 Retrieves the name of an harmonic depending on the current numbering configuration. More...
 
- Public Member Functions inherited from ProcessorHarmonics< D, T >
 ProcessorHarmonics (const size_t order) hoa_noexcept
 The harmonics constructor. More...
 
virtual ~ProcessorHarmonics () hoa_noexcept
 The harmonics destructor.
 
size_t getDecompositionOrder () const hoa_noexcept
 Returns the order of decomposition.
 
size_t getNumberOfHarmonics () const hoa_noexcept
 Returns the number of harmonics.
 
size_t getHarmonicDegree (const size_t index) const hoa_noexcept
 Returns the degree of an harmonic. More...
 
long getHarmonicOrder (const size_t index) const hoa_noexcept
 Returns the azimuthal order of an harmonic. More...
 
size_t getHarmonicIndex (const size_t degree, const long order) const hoa_noexcept
 Returns the index of an harmonic given the degree and the azimuthal order. More...
 
std::string getHarmonicName (const size_t index) const hoa_noexcept
 Returns the name of an harmonic. More...
 
getHarmonicNormalization (const size_t index) const hoa_noexcept
 Returns the normalization of an harmonic. More...
 
getHarmonicSemiNormalization (const size_t index) const hoa_noexcept
 Returns the semi-normalization of an harmonic. More...
 
- Public Member Functions inherited from Processor< D, T >
virtual ~Processor () hoa_noexcept
 The destructor.
 
virtual void process (const T *inputs, T *outputs) hoa_noexcept
 The pure virtual method performs that performs the digital signal processing. More...
 

Detailed Description

template<Dimension D, typename T>
class hoa::Exchanger< D, T >

The echanger class renumber and normalize the harmonics channels.

The echanger should be used to renumber and normalize the harmonics channels. The library uses the Ambisonics Channels Numbering (ACN), this class allows to convert channels arrengements from Furse-Malham (B-format) or Single Index (SID) to Ambisonics Channels Numbering (ACN) and conversely. Furse-Malham and SID never reach up to 3rd order so the maximum order of decomposition should be 3. The library uses the semi-normalization (SN2D and SN3D), this class allows to normalize the channels to the full normalization (N2D and N3D) or to MaxN (B-format) and conversely.

Definition at line 22 of file Hoa_Exchanger.hpp.

Member Enumeration Documentation

enum Numbering

The numbering conversion.

The enum defines the numbering conversion.

Enumerator
ACN 

The numbering is considered as ACN.

fromFurseMalham 

From Furse-Malham (B-format) to ACN.

fromSID 

From SID to ACN.

toFurseMalham 

To Furse-Malham (B-format) from ACN.

toSID 

To SID from ACN.

Definition at line 29 of file Hoa_Exchanger.hpp.

The numbering conversion.

The enum defines the numbering conversion.

Enumerator
SN2D 

The normalization is considered as semi-normalization.

SN3D 

The normalization is considered as semi-normalization.

fromN3D 

From N3D to SN3D.

fromMaxN 

From MaxN (B-format) to SN2D/SN3D.

toN3D 

To N3D from SN3D.

toMaxN 

To MaxN (B-format) from SN2D/SN3D.

Definition at line 41 of file Hoa_Exchanger.hpp.

Constructor & Destructor Documentation

Exchanger ( const size_t  order)

The exchanger constructor.

The exchanger constructor allocates and initialize the member values to renumber and normalize the harmonics channels. The order must be at least 1 and should be 3 at maximum.

Parameters
orderThe order.
virtual ~Exchanger ( )
pure virtual

The exchanger destructor.

The exchanger destructor free the memory.

Member Function Documentation

virtual void process ( T const *  inputs,
T *  outputs 
)
virtual

This method performs the numbering and the normalization.

You should use this method for in-place or not-in-place processing and sample by sample. The inputs array and outputs array contains the spherical harmonics samples and the minimum size must be the number of harmonics.

Parameters
inputsThe inputs array.
outputsThe outputs array.
virtual void setNumbering ( const Numbering  mode)
virtual

Sets the numbering conversion.

This method sets the numbering conversion.

Parameters
modeThe numbering convertion.
virtual Numbering getNumbering ( ) const
virtual

Gets the numbering conversion.

This method gets the numbering conversion.

Returns
The numbering convertion.
virtual void setNormalization ( const Normalization  mode)
virtual

Sets the normalization conversion.

This method sets the normalization conversion.

Parameters
modeThe normalization convertion.
virtual Normalization getNormalization ( ) const
virtual

Gets the normalization conversion.

This method gets the normalization conversion.

Returns
The normalization convertion.
virtual long getInputHarmonicOrder ( const size_t  index) const
virtual

Retrieves the harmonic order of an input depending on the current numbering configuration.

Parameters
indexThe index of an harmonic.
Returns
The harmonic order.
See also
getHarmonicDegree()
getHarmonicOrder()
virtual long getOutputHarmonicOrder ( const size_t  index) const
virtual

Retrieves the harmonic order of an output depending on the current numbering configuration.

Parameters
indexThe index of an harmonic.
Returns
The harmonic order.
See also
getHarmonicDegree()
getHarmonicOrder()
virtual std::string getHarmonicName ( const size_t  index,
const bool  isInput 
) const
virtual

Retrieves the name of an harmonic depending on the current numbering configuration.

This methods returns the name that contains the degree and the order of the harmonic for ACN and SID or the letter code of the harmonic for Furse-Malham.

Parameters
indexThe index of an harmonic.
isInputPass true to retrieve the input harmonic name, false for an output.
Returns
The name of the harmonic.
See also
getHarmonicDegree()
getHarmonicOrder()