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

The class decodes a sound field from the harmonics domain to a set of planewaves. More...

#include <Hoa_Decoder.hpp>

Inheritance diagram for DecoderRegular< D, T >:
Decoder< D, T > ProcessorHarmonics< D, T > ProcessorPlanewaves< D, T > Processor< D, T > Processor< D, T >

Public Member Functions

 DecoderRegular (size_t order, size_t nplws)
 The constructor. More...
 
 ~DecoderRegular () hoa_noexcept
 The destructor.
 
void process (const T *inputs, T *outputs) hoa_noexcept hoa_override
 The method performs the decoding of the harmonics signal. More...
 
void prepare (const size_t vectorsize=64) hoa_override
 Prepare the decoder for processing.
 
Decoder< D, T >::Mode getMode () const hoa_noexcept hoa_override
 Return the type of the decoder.
 
- Public Member Functions inherited from Decoder< D, T >
 Decoder (const size_t order, const size_t numberOfPlanewaves) hoa_noexcept
 The decoder constructor. More...
 
virtual ~Decoder ()=0
 The destructor. 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.
 
- Public Member Functions inherited from ProcessorPlanewaves< D, T >
 ProcessorPlanewaves (const size_t nplws) hoa_noexcept
 The planewaves constructor. More...
 
virtual ~ProcessorPlanewaves () hoa_noexcept
 The planewaves destructor.
 
size_t getNumberOfPlanewaves () const hoa_noexcept
 Returns the number of planewaves.
 
void setPlanewavesRotation (const T x_axe, const T y_axe, const T z_axe) hoa_noexcept
 Sets the global rotation of the planewaves. More...
 
getPlanewavesRotationX () const hoa_noexcept
 Returns the angle of rotation around the x axis in radian of the planewaves.
 
getPlanewavesRotationY () const hoa_noexcept
 Returns the angle of rotation around the y axis in radian of the planewaves.
 
getPlanewavesRotationZ () const hoa_noexcept
 Returns the angle of rotation around the z axis in radian of the planewaves.
 
size_t getPlanewaveIndex (const size_t index) hoa_noexcept
 Returns the index of a planewave.
 
void setPlanewaveAzimuth (const size_t index, const T azimuth) hoa_noexcept
 Sets the azimuth of a planewave in radian. More...
 
void setPlanewaveElevation (const size_t index, const T elevation) hoa_noexcept
 Sets the azimuth of a planewave in radian. More...
 
getPlanewaveAzimuth (const size_t index, const bool rotation=true) const hoa_noexcept
 Returns the azimuth of a planewave. More...
 
getPlanewaveElevation (const size_t index, const bool rotation=true) const hoa_noexcept
 Returns the elevation of a planewave. More...
 
getPlanewaveAbscissa (const size_t index, const bool rotation=true) const hoa_noexcept
 Returns the abscissa of a planewave. More...
 
getPlanewaveOrdinate (const size_t index, const bool rotation=true) const hoa_noexcept
 Returns the ordinate of a planewave. More...
 
getPlanewaveHeight (const size_t index, const bool rotation=true) const hoa_noexcept
 Returns the height of a planewave. More...
 
std::string getPlanewaveName (const size_t index) const hoa_noexcept
 Retruns the name for a planewave. More...
 

Detailed Description

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

The class decodes a sound field from the harmonics domain to a set of planewaves.

The regular decoder should be used to decode from a set of signals associated to harmonics to a set signals associated to plane waves. The plane waves can match to loudspeakers or microphones. The decoding amounts to compute for each plane wave the dot product of the signal associated to the harmonics with the harmonic coefficients of a unitary signal in the direction of the plane wave.

\[S(\theta, \varphi)=\sum_{l=0}^{N}\sum_{m=-l}^{l}S_{l,m}Y_{l,m}^{\frac{1}{N+1}}(\theta,\varphi) \]

with \(S_{l,m}\), the signals associated to the harmonics to decode, \(Y_{l,m}^{\frac{1}{N+1}}\) the harmonic coefficients of a unitary signal \(\frac{1}{N+1}\) in the direction of the plane wave, \(N\) the order of decomposition, \(l\) the degree, \(m\) the azimuthal order, \(\theta\) the azimuth and \(\varphi\) the elevation in radian of the plane wave.
The plane waves must be equally spaced on a circle or a sphere and the number of plane waves must be at least the number of harmonics.

Definition at line 74 of file Hoa_Decoder.hpp.

Constructor & Destructor Documentation

DecoderRegular ( size_t  order,
size_t  nplws 
)
inline

The constructor.

Parameters
orderThe order
nplwsThe number of channels.

Definition at line 81 of file Hoa_Decoder.hpp.

Member Function Documentation

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

The method performs the decoding of the harmonics signal.

The input pointer must be the harmonics signal to decoder and the outputs array contains the plane waves samples thus the minimum size of the array must be the number of harmonics and the number of plane waves.

Parameters
inputsThe inputs array.
outputsThe outputs array.

Reimplemented from Decoder< D, T >.

Definition at line 96 of file Hoa_Decoder.hpp.