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

Impulse response content interface. More...

#include <DAFFContentIR.h>

Inheritance diagram for DAFFContentIR:
DAFFContent DAFFReaderImpl

Public Member Functions

virtual ~DAFFContentIR ()
 
virtual double getSamplerate () const =0
 Returns the sampling rate [in Hertz]. More...
 
virtual int getFilterLength () const =0
 Returns the number of filter coefficients. More...
 
virtual int getFilterCoeffs (int iRecordIndex, int iChannel, float *pfDest, float fGain=1.0F) const =0
 Retrieves filter coefficients for record and channel. More...
 
virtual int addFilterCoeffs (int iRecordIndex, int iChannel, float *pfDest, float fGain=1.0F) const =0
 Adds filter coefficients for record and channel to a given buffer. More...
 
virtual int getMinEffectiveFilterOffset () const =0
 Returns the minimal effective filter offset over all records. More...
 
virtual int getMaxEffectiveFilterLength () const =0
 Returns the maximum effective filter length over all records. More...
 
virtual int getEffectiveFilterBounds (int iRecordIndex, int iChannel, int &iOffset, int &iLength) const =0
 Retrieves the offset and length of the effective part of a filter. More...
 
virtual int getEffectiveFilterCoeffs (int iRecordIndex, int iChannel, float *pfDest, float fGain=1.0F) const =0
 Retrieves effective filter coefficients for record and channel. More...
 
virtual int addEffectiveFilterCoeffs (int iRecordIndex, int iChannel, float *pfDest, float fGain=1.0F) const =0
 Adds effective filter coefficients for record and channel to a given buffer. More...
 
virtual float getOverallPeak ()=0
 Get overall peak value. 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

Impulse response content interface.

This purely abstract class defines the special interface for impulse response content (time-domain). Each record contains impulse responses (IRs) of a fixed length (number of filter coefficients) defined for each channel.

The simple way to access the IR coefficients is to use the method getFilterCoeffs, which delivers the full impulse response for a given direction (record index) and channel.

A more advanced method is to only copy and process those filter coefficients which are effective, meaning that they are non-zero. To determine this effectiv range (start and length) you can employ the method getEffectiveFilterBounds. You can request the effective filter coefficients only using the method getEffectiveFilterCoeffs and thus improve execution speed. For more details please refer to the manual.

Definition at line 38 of file DAFFContentIR.h.

Constructor & Destructor Documentation

virtual DAFFContentIR::~DAFFContentIR ( )
inlinevirtual

Definition at line 41 of file DAFFContentIR.h.

Member Function Documentation

virtual int DAFFContentIR::addEffectiveFilterCoeffs ( int  iRecordIndex,
int  iChannel,
float *  pfDest,
float  fGain = 1.0F 
) const
pure virtual

Adds effective filter coefficients for record and channel to a given buffer.

This method retrieves effective filter impulse response only (non-zero sample range) for the given direction (record index) and channel and numerically adds them in the supplied destination buffer. The method writes exactly as many filter coefficients into the buffer as the effective filter is long. This length can be requested using the getEffectiveFilterBounds() method. A copy of the entire filter in user code can be avoided using the add filter funcionality. Extensive use of record requests can be accelerated by this method. The method starts to write into the destination buffer at position 0 (but not the effective filter offset).

Parameters
iRecordIndexRecord index (direction)
iChannelChannel index
pfDestDestination buffer (size >= effective filter length)
fGainGain factor (optional, default: 1)
Returns
DAFF_NO_ERROR on success, another DAFF_ERROR otherwise
See also
getEffectiveFilterBounds

Implemented in DAFFReaderImpl.

virtual int DAFFContentIR::addFilterCoeffs ( int  iRecordIndex,
int  iChannel,
float *  pfDest,
float  fGain = 1.0F 
) const
pure virtual

Adds filter coefficients for record and channel to a given buffer.

This method retrieves the full filter impulse response for the given direction (record index) and channel and numerically adds them in the supplied destination buffer. The method writes exactly as many filter coefficients into the buffer as the filter is long. A copy of the entire filter in user code can be avoided using the add filter funcionality. Extensive use of record requests can be accelerated by this method.

Parameters
[in]iRecordIndexRecord index (direction)
[in]iChannelChannel index
[out]pfDestDestination buffer (size >= filter length)
[in]fGainGain factor (optional, default: 1)
Returns
DAFF_NO_ERROR on success, another DAFF_ERROR otherwise

Implemented in DAFFReaderImpl.

virtual int DAFFContentIR::getEffectiveFilterBounds ( int  iRecordIndex,
int  iChannel,
int &  iOffset,
int &  iLength 
) const
pure virtual

Retrieves the offset and length of the effective part of a filter.

This method retrieves the start (offset) and length of the effective filter zone for the given direction (record index) and channel.

Parameters
[in]iRecordIndexRecord index (direction) [in]
[in]iChannelChannel index [in]
[out]iOffsetEffective filter offset [out]
[out]iLengthEffective filter length [out]
Returns
DAFF_NO_ERROR on success, another DAFF_ERROR otherwise
See also
getEffectiveFilterCoeffs

Implemented in DAFFReaderImpl.

virtual int DAFFContentIR::getEffectiveFilterCoeffs ( int  iRecordIndex,
int  iChannel,
float *  pfDest,
float  fGain = 1.0F 
) const
pure virtual

Retrieves effective filter coefficients for record and channel.

This method retrieves the only the effective (non-zero) filter impulse coefficients for the given direction (record index) and channel and stores them in the supplied destination buffer. The method only writes as many filter coefficients into the buffer as this very filter's effective length. This length can be determined using the method getEffectiveFilterBounds. The method starts to write into the destination buffer at position 0 (but not the effective filter offset).

Parameters
[in]iRecordIndexRecord index (direction)
[in]iChannelChannel index
[out]pfDestDestination buffer (size >= effective filter length)
[in]fGainGain factor (optional, default: 1)
Returns
DAFF_NO_ERROR on success, another DAFF_ERROR otherwise
See also
getEffectiveFilterBounds

Implemented in DAFFReaderImpl.

virtual int DAFFContentIR::getFilterCoeffs ( int  iRecordIndex,
int  iChannel,
float *  pfDest,
float  fGain = 1.0F 
) const
pure virtual

Retrieves filter coefficients for record and channel.

This method retrieves the full filter impulse response for the given direction (record index) and channel and stores them in the supplied destination buffer. The method writes exactly as many filter coefficients into the buffer as the filter length.

Parameters
[in]iRecordIndexRecord index (direction)
[in]iChannelChannel index
[out]pfDestDestination buffer (size >= filter length)
[in]fGainGain factor (optional, default: 1)
Returns
DAFF_NO_ERROR on success, another DAFF_ERROR otherwise

Implemented in DAFFReaderImpl.

virtual int DAFFContentIR::getFilterLength ( ) const
pure virtual

Returns the number of filter coefficients.

This function returns the number of data elements each data record consists of. For impuls response this means the number of filter coefficients, ergo the filter length.

Implemented in DAFFReaderImpl.

virtual int DAFFContentIR::getMaxEffectiveFilterLength ( ) const
pure virtual

Returns the maximum effective filter length over all records.

This methods returns the maximum effective filter length over all records, ergo the greatest length you could be faced with among all records.

This value is helpful for buffer dimensioning, when using the low-level interface.

Implemented in DAFFReaderImpl.

virtual int DAFFContentIR::getMinEffectiveFilterOffset ( ) const
pure virtual

Returns the minimal effective filter offset over all records.

This methods returns the minimal effective filter offset over all records, ergo the smallest offset you could be faced with among all records.

This value is helpful if you for instance want to ignore the sound runtime (leading zeros) and compensate it.

Implemented in DAFFReaderImpl.

virtual float DAFFContentIR::getOverallPeak ( )
pure virtual

Get overall peak value.

Returns
Overall peak value

Implemented in DAFFReaderImpl.

virtual double DAFFContentIR::getSamplerate ( ) const
pure virtual

Returns the sampling rate [in Hertz].

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.