OpenDAFF C++ API  v1.7
Directional Audio File Format
Public Member Functions | List of all members
DAFFContentMPS Class Referenceabstract

Magnitude-phase spectrum content interface. More...

#include <DAFFContentMPS.h>

Inheritance diagram for DAFFContentMPS:
DAFFContent DAFFReaderImpl

Public Member Functions

virtual ~DAFFContentMPS ()
 
virtual int getNumFrequencies () const =0
 Returns the number of support points (frequencies) More...
 
virtual const std::vector< float > & getFrequencies () const =0
 Retrieves the frequencies [in Hertz] at which values are defined. More...
 
virtual float getOverallMagnitudeMaximum () const =0
 Returns the overall greatest magnitude value. More...
 
virtual int getMagnitudes (int iRecordIndex, int iChannel, float *pfDest) const =0
 Retrieves magnitude coefficients. More...
 
virtual int getMagnitude (int iRecordIndex, int iChannel, int iFreqIndex, float &fMag) const =0
 Retrieves a single magnitude coefficient. More...
 
virtual int getPhases (int iRecordIndex, int iChannel, float *pfDest) const =0
 Retrieves phase coefficients. More...
 
virtual int getPhase (int iRecordIndex, int iChannel, int iFreqIndex, float &fPhase) const =0
 Retrieves a single phase coefficient. More...
 
virtual int getCoefficientsMP (int iRecordIndex, int iChannel, float *pfDest) const =0
 Retrieves coefficients in polar form. More...
 
virtual int getCoefficientsRI (int iRecordIndex, int iChannel, float *pfDest) const =0
 Retrieves coefficients in cartesian form. More...
 
- Public Member Functions inherited from DAFFContent
virtual ~DAFFContent ()
 
virtual DAFFReadergetParent () const =0
 Returns the parent reader. More...
 
virtual const DAFFPropertiesgetProperties () const =0
 Returns the properties. More...
 
virtual const DAFFMetadatagetRecordMetadata (int iRecordIndex) const =0
 Returns the metadata of a record. More...
 
virtual int getRecordCoords (int iRecordIndex, int iView, float &fAngle1Deg, float &fAngle2Deg) const =0
 Determines the spherical coordinates of a record (grid point on spherical regular grid) More...
 
virtual void getNearestNeighbour (int iView, float fAngle1Deg, float fAngle2Deg, int &iRecordIndex) const =0
 Determine the nearest neighbour record and return its index. More...
 
virtual void getNearestNeighbour (int iView, float fAngle1Deg, float fAngle2Deg, int &iRecordIndex, bool &bOutOfBounds) const =0
 Determine the nearest neighbour record and return its index (with boundary validatsion) More...
 
virtual void getCell (int iView, float fAngle1Deg, float fAngle2Deg, DAFFQuad &qIndices) const =0
 Determines the cell of a given direction on the sphere grid and delivers its surrounding record indices. More...
 
virtual void transformAnglesD2O (float fAlphaDeg, float fBetaDeg, float &fAzimuthDeg, float &fElevationDeg) const =0
 Transforms data spherical coordinates into object spherical coordinates. More...
 
virtual void transformAnglesO2D (float fAzimuthDeg, float fElevationDeg, float &fAlphaDeg, float &fBetaDeg) const =0
 Transforms object spherical coordinates into data spherical coordinates. More...
 

Detailed Description

Magnitude-phase spectrum content interface.

This purely abstract class defines the special interface for spectrum content (frequency-domain). Each record contains for each channel a fixed number of magnitude and phase coefficients defined over a common support of frequencies.

The number and values of the support frequencies can be determined using the methods getNumFrequencies and getFrequencies. The magnitude coefficients can be retrieved using the method getMagnitudes. The phase can be retrieved using getPhases. If you want both magnitude and phase use getCoefficientsMP. You will get the same as number with a real and imagninary part by getCoefficientsRI.

Definition at line 34 of file DAFFContentMPS.h.

Constructor & Destructor Documentation

virtual DAFFContentMPS::~DAFFContentMPS ( )
inlinevirtual

Definition at line 37 of file DAFFContentMPS.h.

Member Function Documentation

virtual int DAFFContentMPS::getCoefficientsMP ( int  iRecordIndex,
int  iChannel,
float *  pfDest 
) const
pure virtual

Retrieves coefficients in polar form.

This method retrives the coefficients for the given direction (record index) and channel and stores them in the supplied destination buffers. Each coefficient consists of a magnitude and phase which will be returned in the destination buffer. The method writes exactly as many coefficients as there are support frequencies. Their number can be determined using the method getNumFrequencies.

The output storage scheme is: pfDest = (Mag[0], Ph[0], Mag[1], Ph[1], ...)

Parameters
[in]iRecordIndexRecord index (direction)
[in]iChannelChannel index
[out]pfDestDestination buffer (size >= number of frequencies)
Returns
DAFF_NO_ERROR on success, another DAFF_ERROR otherwise

Implemented in DAFFReaderImpl.

virtual int DAFFContentMPS::getCoefficientsRI ( int  iRecordIndex,
int  iChannel,
float *  pfDest 
) const
pure virtual

Retrieves coefficients in cartesian form.

This method retrives the coefficients for the given direction (record index) and channel and stores them in the supplied destination buffers. Each coefficient consists of a real and imaginary part which will be returned in the destination buffer. The method writes exactly as many coefficients as there are support frequencies. Their number can be determined using the method getNumFrequencies.

The output storage scheme is: pfDest = (Re[0], Im[0], Re[1], Im[1], ...)

Parameters
[in]iRecordIndexRecord index (direction)
[in]iChannelChannel index
[out]pfDestMagnitudes destination buffer (size >= number of frequencies)
Returns
DAFF_NO_ERROR on success, another DAFF_ERROR otherwise

Implemented in DAFFReaderImpl.

virtual const std::vector<float>& DAFFContentMPS::getFrequencies ( ) const
pure virtual

Retrieves the frequencies [in Hertz] at which values are defined.

Implemented in DAFFReaderImpl.

virtual int DAFFContentMPS::getMagnitude ( int  iRecordIndex,
int  iChannel,
int  iFreqIndex,
float &  fMag 
) const
pure virtual

Retrieves a single magnitude coefficient.

This method retrives the magnitude coefficient for the given direction (record index), channel and frequency index. It stores the value in the supplied destination.

Parameters
[in]iRecordIndexRecord index (direction)
[in]iChannelChannel index
[in]iFreqIndexFrequency index
[out]fMagMagnuitude value
Returns
DAFF_NO_ERROR on success, another DAFF_ERROR otherwise
Note
The magnitude value is a factor (no decibel).

Implemented in DAFFReaderImpl.

virtual int DAFFContentMPS::getMagnitudes ( int  iRecordIndex,
int  iChannel,
float *  pfDest 
) const
pure virtual

Retrieves magnitude coefficients.

This method retrives the magnitude coefficients for the given direction (record index) and channel and stores them in the supplied destination buffer. The method writes exactly as many coefficients as there are support frequencies. Their number can be determined using the method getNumFrequencies.

Parameters
iRecordIndexRecord index (direction)
iChannelChannel index
pfDestDestination buffer (size >= number of frequencies)
Returns
DAFF_NO_ERROR on success, another DAFF_ERROR otherwise
Note
The magnitude values are factors (no decibel).

Implemented in DAFFReaderImpl.

virtual int DAFFContentMPS::getNumFrequencies ( ) const
pure virtual

Returns the number of support points (frequencies)

Implemented in DAFFReaderImpl.

virtual float DAFFContentMPS::getOverallMagnitudeMaximum ( ) const
pure virtual

Returns the overall greatest magnitude value.

This method returns the greatest magnitude value over all directions, channels and frequencies. It is important to know this value for instance for visualization.

Implemented in DAFFReaderImpl.

virtual int DAFFContentMPS::getPhase ( int  iRecordIndex,
int  iChannel,
int  iFreqIndex,
float &  fPhase 
) const
pure virtual

Retrieves a single phase coefficient.

This method retrives the phase coefficient for the given direction (record index), channel and frequency index. It stores the value in the supplied destination.

Parameters
[in]iRecordIndexRecord index (direction)
[in]iChannelChannel index
[in]iFreqIndexFrequency index
[out]fPhasePhase value
Returns
DAFF_NO_ERROR on success, another DAFF_ERROR otherwise

Implemented in DAFFReaderImpl.

virtual int DAFFContentMPS::getPhases ( int  iRecordIndex,
int  iChannel,
float *  pfDest 
) const
pure virtual

Retrieves phase coefficients.

This method retrives the phase coefficients for the given direction (record index) and channel and stores them in the supplied destination buffer. The method writes exactly as many coefficients as there are support frequencies. Their number can be determined using the method getNumFrequencies.

Parameters
[in]iRecordIndexRecord index (direction)
[in]iChannelChannel index
[out]pfDestDestination buffer (size >= number of frequencies)
Returns
DAFF_NO_ERROR on success, another DAFF_ERROR otherwise

Implemented in DAFFReaderImpl.


The documentation for this class was generated from the following file:
OpenDAFF is a project from the Institute of Technical Acoustics, RWTH Aachen University, Germany.