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

The rotate class rotates a sound field in the harmonics domain (2d available only). More...

#include <Hoa_Rotate.hpp>

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

Public Member Functions

 Rotate (const size_t order) hoa_noexcept
 The rotate constructor. More...
 
virtual ~Rotate () hoa_noexcept=0
 The Rotate destructor. More...
 
virtual void setYaw (const T yaw) hoa_noexcept
 This method sets the angle of the rotation around the z axis, the yaw value. More...
 
virtual T getYaw () const hoa_noexcept
 Get the angle of the rotation around the z axis, the yaw value. More...
 
virtual void process (const T *inputs, T *outputs) hoa_noexcept
 This method performs the rotation. 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.
 

Detailed Description

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

The rotate class rotates a sound field in the harmonics domain (2d available only).

The rotate should be used to rotate a sound field by weighting the harmonics depending on the rotation.

Definition at line 22 of file Hoa_Rotate.hpp.

Constructor & Destructor Documentation

Rotate ( const size_t  order)

The rotate constructor.

The rotate constructor allocates and initialize the member values. The order must be at least 1.

Parameters
orderThe order.
virtual ~Rotate ( )
pure virtual

The Rotate destructor.

The Rotate destructor free the memory.

Member Function Documentation

virtual void setYaw ( const T  yaw)
virtual

This method sets the angle of the rotation around the z axis, the yaw value.

The yaw is equivalent to a rotation around the z axis, the yaw value \(\theta\) is in radian and should be between \(0\) and \(2\pi\).

Parameters
yawThe yaw value.
virtual T getYaw ( ) const
virtual

Get the angle of the rotation around the z axis, the yaw value.

The method returns the angle of the rotation around the z axis, the yaw value \(\theta\), in radian between \(0\) and \(2\pi\).

Returns
The yaw value.
virtual void process ( const T *  inputs,
T *  outputs 
)
virtual

This method performs the rotation.

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. If \(l = 0\)

\[Y^{rotated}_{0,0}(\theta) = Y_{0,0}\]

else

\[Y^{rotated}_{l,-l}(\theta) = \sin{(\theta l)} \times Y_{l,l} + \cos{(\theta l)} \times Y_{l,-l}\]

and

\[Y^{rotated}_{l,l}(\theta) = \cos{(\theta l)} \times Y_{l,l} - \sin{(\theta l)} \times Y_{l,-l}\]

with \(\theta\) the rotation in radian, \(l\) the degree and \(m\) the order.

Parameters
inputsThe input array.
outputsThe output array.

Reimplemented from Processor< D, T >.