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

#include <DAFFReaderImpl.h>

Inheritance diagram for DAFFReaderImpl:
DAFFReader DAFFProperties DAFFContentIR DAFFContentMS DAFFContentPS DAFFContentMPS DAFFContentDFT DAFFContent DAFFContent DAFFContent DAFFContent DAFFContent

Public Member Functions

 DAFFReaderImpl ()
 
 ~DAFFReaderImpl ()
 
bool isFileOpened () const
 Returns whether a file is opened. More...
 
int openFile (const std::string &)
 Opens a DAFF file for reading. More...
 
void closeFile ()
 Closes an opened DAFF file. More...
 
std::string getFilename () const
 Returns the name of the opened DAFF file. More...
 
int deserialize (char *pDAFFDataBuffer)
 Deserializes DAFF content from a byte buffer. More...
 
bool isValid () const
 
int getFileFormatVersion () const
 Returns the DAFF version of the file format. More...
 
int getContentType () const
 Returns the content type. More...
 
DAFFContentgetContent () const
 Returns the content. More...
 
const DAFFMetadatagetMetadata () const
 Returns the metadata. More...
 
DAFFPropertiesgetProperties () const
 Returns the properties of the file. More...
 
std::string toString () const
 Returns string with information about the reader. More...
 
int getQuantization () const
 Returns the quantization of the data elements. More...
 
int getNumberOfChannels () const
 Returns the number of channels. More...
 
int getNumberOfRecords () const
 Returns the overall number of records. More...
 
std::string getChannelLabel (int iChannel) const
 Returns the label of a channel. More...
 
int getAlphaPoints () const
 
float getAlphaResolution () const
 
float getAlphaStart () const
 
float getAlphaEnd () const
 
float getAlphaSpan () const
 
int getBetaPoints () const
 
float getBetaResolution () const
 
float getBetaStart () const
 
float getBetaEnd () const
 
float getBetaSpan () const
 
void getDefaultOrientation (DAFFOrientationYPR &o) const
 Returns the default orientation as stored in the file. More...
 
void setDefaultOrientation ()
 Sets/alters the default orientation manually. More...
 
void getOrientation (DAFFOrientationYPR &o) const
 Returns the current orientation of the object view. More...
 
void setOrientation (const DAFFOrientationYPR &o)
 Sets the current orientation of the object view. More...
 
bool coversFullAlphaRange () const
 Indicates whether the data covers the full alpha range [0°, 360°) More...
 
bool coversFullBetaRange () const
 Indicates whether the data covers the full beta range [0°, 180°]. More...
 
bool coversFullSphere () const
 Indicates whether the data covers the full sphere. More...
 
DAFFReadergetParent () const
 Returns the parent reader. More...
 
const DAFFMetadatagetRecordMetadata (int iRecordIndex) const
 Returns the metadata of a record. More...
 
int getRecordCoords (int iRecordIndex, int iView, float &fAngle1, float &fAngle2) const
 Determines the spherical coordinates of a record (grid point on spherical regular grid) More...
 
void getNearestNeighbour (int iView, float fAngle1Deg, float fAngle2Deg, int &iRecordIndex) const
 Determine the nearest neighbour record and return its index. More...
 
void getNearestNeighbour (int iView, float fAngle1Deg, float fAngle2Deg, int &iRecordIndex, bool &bOutOfBounds) const
 Determine the nearest neighbour record and return its index (with boundary validatsion) More...
 
void getCell (int iView, float fAngle1, float fAngle2, DAFFQuad &qIndices) const
 Determines the cell of a given direction on the sphere grid and delivers its surrounding record indices. More...
 
void transformAnglesD2O (float fAlpha, float fBeta, float &fAzimuth, float &fElevation) const
 Transforms data spherical coordinates into object spherical coordinates. More...
 
void transformAnglesO2D (float fAzimuth, float fElevation, float &fAlpha, float &fBeta) const
 Transforms object spherical coordinates into data spherical coordinates. More...
 
double getSamplerate () const
 Returns the correspondig sampling rate [in Hertz]. More...
 
int getFilterLength () const
 Returns the number of filter coefficients. More...
 
int getFilterCoeffs (int iRecordIndex, int iChannel, float *pfDest, float fGain=1.0F) const
 Retrieves filter coefficients for record and channel. More...
 
int addFilterCoeffs (int iRecordIndex, int iChannel, float *pfDest, float fGain=1.0F) const
 Adds filter coefficients for record and channel to a given buffer. More...
 
int getMinEffectiveFilterOffset () const
 Returns the minimal effective filter offset over all records. More...
 
int getMaxEffectiveFilterLength () const
 Returns the maximum effective filter length over all records. More...
 
int getEffectiveFilterBounds (int iRecordIndex, int iChannel, int &iOffset, int &iLength) const
 Retrieves the offset and length of the effective part of a filter. More...
 
int getEffectiveFilterCoeffs (int iRecordIndex, int iChannel, float *pfDest, float fGain=1.0F) const
 Retrieves effective filter coefficients for record and channel. More...
 
int addEffectiveFilterCoeffs (int iRecordIndex, int iChannel, float *pfDest, float fGain=1.0F) const
 Adds effective filter coefficients for record and channel to a given buffer. More...
 
float getOverallPeak ()
 Get overall peak value. More...
 
int getNumFrequencies () const
 Returns the number of support points (frequencies) More...
 
const std::vector< float > & getFrequencies () const
 Retrieves the frequencies [in Hertz] at which values are defined. More...
 
float getOverallMagnitudeMaximum () const
 Returns the overall greatest magnitude value. More...
 
int getMagnitudes (int iRecordIndex, int iChannel, float *pfData) const
 Retrieves magnitude coefficients. More...
 
int getMagnitude (int iRecordIndex, int iChannel, int iFreqIndex, float &fMag) const
 Retrieves a single magnitude coefficient. More...
 
int getPhases (int iRecordIndex, int iChannel, float *pfData) const
 Retrieves phase coefficients. More...
 
int getPhase (int iRecordIndex, int iChannel, int iFreqIndex, float &fPhase) const
 Retrieves a single phase coefficient. More...
 
int getCoefficientsMP (int iRecordIndex, int iChannel, float *pfDest) const
 Retrieves coefficients in polar form. More...
 
int getCoefficientsRI (int iRecordIndex, int iChannel, float *pfDest) const
 Retrieves coefficients in cartesian form. More...
 
int getTransformSize () const
 Returns the size of the transform (number of overall DFT coefficients) More...
 
int getNumDFTCoeffs () const
 Returns the number of DFT coefficients. More...
 
bool isSymmetric () const
 Returns whether the spectrum is complex-conjugated symmetric. More...
 
double getFrequencyBandwidth () const
 Returns the frequency resolution [in Hertz]. More...
 
int getDFTCoeff (int iRecordIndex, int iChannel, int iDFTCoeff, float &fReal, float &fImag) const
 Retrieve a single magnitude coefficient. More...
 
int getDFTCoeffs (int iRecordIndex, int iChannel, float *pfDest) const
 Retrieves magnitude coefficients. More...
 
- Public Member Functions inherited from DAFFReader
virtual ~DAFFReader ()
 Destructor. More...
 
- Public Member Functions inherited from DAFFProperties
virtual ~DAFFProperties ()
 Destructor. More...
 
- Public Member Functions inherited from DAFFContentIR
virtual ~DAFFContentIR ()
 
- Public Member Functions inherited from DAFFContent
virtual ~DAFFContent ()
 
- Public Member Functions inherited from DAFFContentMS
virtual ~DAFFContentMS ()
 
- Public Member Functions inherited from DAFFContentPS
virtual ~DAFFContentPS ()
 
- Public Member Functions inherited from DAFFContentMPS
virtual ~DAFFContentMPS ()
 
- Public Member Functions inherited from DAFFContentDFT
virtual ~DAFFContentDFT ()
 

Additional Inherited Members

- Static Public Member Functions inherited from DAFFReader
static DAFFReadercreate ()
 Factory method. More...
 

Detailed Description

Definition at line 29 of file DAFFReaderImpl.h.

Constructor & Destructor Documentation

DAFFReaderImpl::DAFFReaderImpl ( )

Definition at line 21 of file DAFFReaderImpl.cpp.

DAFFReaderImpl::~DAFFReaderImpl ( )

Definition at line 36 of file DAFFReaderImpl.cpp.

Member Function Documentation

int DAFFReaderImpl::addEffectiveFilterCoeffs ( int  iRecordIndex,
int  iChannel,
float *  pfDest,
float  fGain = 1.0F 
) const
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

Implements DAFFContentIR.

Definition at line 1462 of file DAFFReaderImpl.cpp.

int DAFFReaderImpl::addFilterCoeffs ( int  iRecordIndex,
int  iChannel,
float *  pfDest,
float  fGain = 1.0F 
) const
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

Implements DAFFContentIR.

Definition at line 1382 of file DAFFReaderImpl.cpp.

void DAFFReaderImpl::closeFile ( )
virtual

Closes an opened DAFF file.

Implements DAFFReader.

Definition at line 788 of file DAFFReaderImpl.cpp.

bool DAFFReaderImpl::coversFullAlphaRange ( ) const
virtual

Indicates whether the data covers the full alpha range [0°, 360°)

Implements DAFFProperties.

Definition at line 1066 of file DAFFReaderImpl.cpp.

bool DAFFReaderImpl::coversFullBetaRange ( ) const
virtual

Indicates whether the data covers the full beta range [0°, 180°].

Implements DAFFProperties.

Definition at line 1075 of file DAFFReaderImpl.cpp.

bool DAFFReaderImpl::coversFullSphere ( ) const
virtual

Indicates whether the data covers the full sphere.

Implements DAFFProperties.

Definition at line 1084 of file DAFFReaderImpl.cpp.

int DAFFReaderImpl::deserialize ( char *  pDAFFDataBuffer)
virtual

Deserializes DAFF content from a byte buffer.

Implements DAFFReader.

Definition at line 52 of file DAFFReaderImpl.cpp.

float DAFFReaderImpl::getAlphaEnd ( ) const
virtual

Implements DAFFProperties.

Definition at line 1008 of file DAFFReaderImpl.cpp.

int DAFFReaderImpl::getAlphaPoints ( ) const
virtual

Implements DAFFProperties.

Definition at line 991 of file DAFFReaderImpl.cpp.

float DAFFReaderImpl::getAlphaResolution ( ) const
virtual

Implements DAFFProperties.

Definition at line 997 of file DAFFReaderImpl.cpp.

float DAFFReaderImpl::getAlphaSpan ( ) const
virtual

Implements DAFFProperties.

Definition at line 1013 of file DAFFReaderImpl.cpp.

float DAFFReaderImpl::getAlphaStart ( ) const
virtual

Implements DAFFProperties.

Definition at line 1003 of file DAFFReaderImpl.cpp.

float DAFFReaderImpl::getBetaEnd ( ) const
virtual

Implements DAFFProperties.

Definition at line 1036 of file DAFFReaderImpl.cpp.

int DAFFReaderImpl::getBetaPoints ( ) const
virtual

Implements DAFFProperties.

Definition at line 1021 of file DAFFReaderImpl.cpp.

float DAFFReaderImpl::getBetaResolution ( ) const
virtual

Implements DAFFProperties.

Definition at line 1026 of file DAFFReaderImpl.cpp.

float DAFFReaderImpl::getBetaSpan ( ) const
virtual

Implements DAFFProperties.

Definition at line 1041 of file DAFFReaderImpl.cpp.

float DAFFReaderImpl::getBetaStart ( ) const
virtual

Implements DAFFProperties.

Definition at line 1031 of file DAFFReaderImpl.cpp.

void DAFFReaderImpl::getCell ( int  iView,
float  fAngle1Deg,
float  fAngle2Deg,
DAFFQuad qIndices 
) const
virtual

Determines the cell of a given direction on the sphere grid and delivers its surrounding record indices.

This method takes a direction in form of an angular pair and searches for the valid surrounding grid points which are related to a record. In a full covered sphere, this means a rectangular cell at any point except of the area near the poles, where we obtain triangular cells. Nevertheless, the method will return four valid record indices in any given case. It makes heavy use of the getNearestNeighbour method (which does not make it that fast) and is invented for custom interpolation purposes.

Sequence convention

Imagine you are sitting at the origin of the sphere and you point in a random direction. What you prickle will be a cell similar to this one:

(3)--—(2) | | | | ^ (4)--—(1) | (direction beta increases)

       <--

(direction alpha increases)

The first index will always be the lower grid point of both given angles, the second is the first point increased by the beta resolution at beta angle. The third point is represented by both the increase of the alpha and beta angle each with their resolution steps. The fourth point is the first point only with an increase by alpha resolution of the alpha angle.

Let's discuss an example: Requested direction: alpha = 2°, beta = 2° object view coordinate system (front direction would be 0°,0°) Resolution: alpha = 10°, beta = 5° Index1 -> alpha = 0°, beta = 0° (object view) Index2 -> alpha = 0°, beta = 5° (object view) Index3 -> alpha = 10°, beta = 5° (object view) Index4 -> alpha = 10°, beta = 0° (object view)

Special cases

  • if a pole is directly hitten and the full sphere is covered, it will return 4 times the pole's record index.
  • if the requested direction is near a pole or out of boundaries, the method will simply search for the nearest neighbouring directions for each of the four cell points as if the cell would exists on a regular sphere grid. This will result in the return of at least two indices indicating the same record. You most certainly will discover something like that near north pole

    (3,2) / \ / \ (4)-—(1)

    or that near south pole
    

(3)-—(2) \ / \ / (4,1)

or, if out of bounds, something similar to

(3,4)--—(1,2)

or

(3,2)
  |
  |
(4,1)

Anyway, using getCell out of the boundaries does not make that much sense. In case you run
out of bounds onsider using getNearestNeighbour with boundary flag instead.
Parameters
[in]iViewView, one of DAFF_VIEWS
[in]fAngle1DegAngle of first value in degree
[in]fAngle2DegAngle of first value in degree
[out]qIndicesQuad struct with index values

Implements DAFFContent.

Definition at line 1280 of file DAFFReaderImpl.cpp.

std::string DAFFReaderImpl::getChannelLabel ( int  iChannel) const
virtual

Returns the label of a channel.

Implements DAFFProperties.

Definition at line 972 of file DAFFReaderImpl.cpp.

int DAFFReaderImpl::getCoefficientsMP ( int  iRecordIndex,
int  iChannel,
float *  pfDest 
) const
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

Implements DAFFContentMPS.

Definition at line 1681 of file DAFFReaderImpl.cpp.

int DAFFReaderImpl::getCoefficientsRI ( int  iRecordIndex,
int  iChannel,
float *  pfDest 
) const
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

Implements DAFFContentMPS.

Definition at line 1705 of file DAFFReaderImpl.cpp.

DAFFContent * DAFFReaderImpl::getContent ( ) const
virtual

Returns the content.

Implements DAFFReader.

Definition at line 871 of file DAFFReaderImpl.cpp.

int DAFFReaderImpl::getContentType ( ) const
virtual

Returns the content type.

Returns
Content type, one of

Implements DAFFProperties.

Definition at line 865 of file DAFFReaderImpl.cpp.

void DAFFReaderImpl::getDefaultOrientation ( DAFFOrientationYPR o) const
virtual

Returns the default orientation as stored in the file.

Implements DAFFProperties.

Definition at line 1046 of file DAFFReaderImpl.cpp.

int DAFFReaderImpl::getDFTCoeff ( int  iRecordIndex,
int  iChannel,
int  iDFTCoeff,
float &  fReal,
float &  fImag 
) const
virtual

Retrieve a single magnitude coefficient.

This method retrives a single complex-valued DFT coefficient for the given direction (record index) and channel and stores them in the supplied destination variable.

Parameters
[in]iRecordIndexRecord index (direction)
[in]iChannelChannel index
[in]iDFTCoeffDFT coefficient index
[out]fRealReal part
[out]fImagImaginary part
Returns
DAFF_NO_ERROR on success, another DAFF_ERROR otherwise

Implements DAFFContentDFT.

Definition at line 1739 of file DAFFReaderImpl.cpp.

int DAFFReaderImpl::getDFTCoeffs ( int  iRecordIndex,
int  iChannel,
float *  pfDest 
) const
virtual

Retrieves magnitude coefficients.

This method retrives the complex-valued DFT coefficients for the given direction (record index) and channel and stores them in the supplied destination buffer. The method writes exactly as many complex-valued coefficients as the function getNumDFTCoeffs() returns.

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

Parameters
iRecordIndexRecord index (direction)
iChannelChannel index
pfDestDestination buffer (size >= 2*getNumDFTCoeffs())
Returns
DAFF_NO_ERROR on success, another DAFF_ERROR otherwise

Implements DAFFContentDFT.

Definition at line 1755 of file DAFFReaderImpl.cpp.

int DAFFReaderImpl::getEffectiveFilterBounds ( int  iRecordIndex,
int  iChannel,
int &  iOffset,
int &  iLength 
) const
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

Implements DAFFContentIR.

Definition at line 1400 of file DAFFReaderImpl.cpp.

int DAFFReaderImpl::getEffectiveFilterCoeffs ( int  iRecordIndex,
int  iChannel,
float *  pfDest,
float  fGain = 1.0F 
) const
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

Implements DAFFContentIR.

Definition at line 1416 of file DAFFReaderImpl.cpp.

int DAFFReaderImpl::getFileFormatVersion ( ) const
virtual

Returns the DAFF version of the file format.

Returns
File format version number (i.e. 170)

Implements DAFFProperties.

Definition at line 859 of file DAFFReaderImpl.cpp.

std::string DAFFReaderImpl::getFilename ( ) const
virtual

Returns the name of the opened DAFF file.

Implements DAFFReader.

Definition at line 853 of file DAFFReaderImpl.cpp.

int DAFFReaderImpl::getFilterCoeffs ( int  iRecordIndex,
int  iChannel,
float *  pfDest,
float  fGain = 1.0F 
) const
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

Implements DAFFContentIR.

Definition at line 1358 of file DAFFReaderImpl.cpp.

int DAFFReaderImpl::getFilterLength ( ) const
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.

Implements DAFFContentIR.

Definition at line 1346 of file DAFFReaderImpl.cpp.

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

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

Implements DAFFContentMPS.

Definition at line 1511 of file DAFFReaderImpl.cpp.

double DAFFReaderImpl::getFrequencyBandwidth ( ) const
virtual

Returns the frequency resolution [in Hertz].

Returns
Linear frequency spacing in Hertz

Implements DAFFContentDFT.

Definition at line 1735 of file DAFFReaderImpl.cpp.

int DAFFReaderImpl::getMagnitude ( int  iRecordIndex,
int  iChannel,
int  iFreqIndex,
float &  fMag 
) const
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).

Implements DAFFContentMPS.

Definition at line 1582 of file DAFFReaderImpl.cpp.

int DAFFReaderImpl::getMagnitudes ( int  iRecordIndex,
int  iChannel,
float *  pfDest 
) const
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).

Implements DAFFContentMPS.

Definition at line 1551 of file DAFFReaderImpl.cpp.

int DAFFReaderImpl::getMaxEffectiveFilterLength ( ) const
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.

Implements DAFFContentIR.

Definition at line 1354 of file DAFFReaderImpl.cpp.

const DAFFMetadata * DAFFReaderImpl::getMetadata ( ) const
virtual

Returns the metadata.

Implements DAFFReader.

Definition at line 879 of file DAFFReaderImpl.cpp.

int DAFFReaderImpl::getMinEffectiveFilterOffset ( ) const
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.

Implements DAFFContentIR.

Definition at line 1350 of file DAFFReaderImpl.cpp.

void DAFFReaderImpl::getNearestNeighbour ( int  iView,
float  fAngle1Deg,
float  fAngle2Deg,
int &  iRecordIndex 
) const
virtual

Determine the nearest neighbour record and return its index.

This method takes a direction in form of an angular pair and searches the grid for the nearest neighbouring record (grid point). The distance measure is the angle on the great circle (spherical law of cosines).

Note: The method always returns a valid record index, even if the angular pair points outside the spherical grid (e.g. consider boundaries). Thereby we maintain a consistent behaviour. You can check if the point was within the boundaries using the bOutOfBounds argument.

Parameters
[in]iViewThe view that should be used for the given pair of angles, one of DAFF_VIEWS
[in]fAngle1DegFirst angle (Phi or Alpha, depending on view)
[in]fAngle2DegSecond angle (Theta or Beta, depending on view)
[out]iRecordIndexIndex that corresponds to this pair of angles

Implements DAFFContent.

Definition at line 1101 of file DAFFReaderImpl.cpp.

void DAFFReaderImpl::getNearestNeighbour ( int  iView,
float  fAngle1Deg,
float  fAngle2Deg,
int &  iRecordIndex,
bool &  bOutOfBounds 
) const
virtual

Determine the nearest neighbour record and return its index (with boundary validatsion)

This method takes a direction in form of an angular pair and searches the grid for the nearest neighbouring record (grid point). The distance measure is the angle on the great circle (spherical law of cosines).

Note: The method always returns a valid record index, even if the angular pair points outside the spherical grid (e.g. consider boundaries). Thereby we maintain a consistent behaviour. You can check if the point was within the boundaries using the bOutOfBounds argument.

Parameters
[in]iViewThe view that should be used for the given pair of angles, one of DAFF_VIEWS
[in]fAngle1DegFirst angle (Phi or Alpha, depending on view)
[in]fAngle2DegSecond angle (Theta or Beta, depending on view)
[out]iRecordIndexIndex that corresponds to this pair of angles
[out]bOutOfBoundsIndicator if requested direction was out of bounds (true in this case)

Implements DAFFContent.

Definition at line 1172 of file DAFFReaderImpl.cpp.

int DAFFReaderImpl::getNumberOfChannels ( ) const
virtual

Returns the number of channels.

Returns
Number of chanels

Implements DAFFProperties.

Definition at line 961 of file DAFFReaderImpl.cpp.

int DAFFReaderImpl::getNumberOfRecords ( ) const
virtual

Returns the overall number of records.

Returns
Total number of data records (multi channel data sets)

Implements DAFFProperties.

Definition at line 966 of file DAFFReaderImpl.cpp.

int DAFFReaderImpl::getNumDFTCoeffs ( ) const
virtual

Returns the number of DFT coefficients.

This functions returns the actually stored number of complex-valued DFT coefficients. Note: For real-valued time-domain data, this includes only the non-symmetric coefficients. Examplarily, for a transform size of N the function returns floor(N/2)+1. For arbitrary complex-valued time-domain data the returned number equals the transform size.

Returns
Number of DFT coefficients

Implements DAFFContentDFT.

Definition at line 1726 of file DAFFReaderImpl.cpp.

int DAFFReaderImpl::getNumFrequencies ( ) const
virtual

Returns the number of support points (frequencies)

Implements DAFFContentMPS.

Definition at line 1498 of file DAFFReaderImpl.cpp.

void DAFFReaderImpl::getOrientation ( DAFFOrientationYPR o) const
virtual

Returns the current orientation of the object view.

Implements DAFFProperties.

Definition at line 1056 of file DAFFReaderImpl.cpp.

float DAFFReaderImpl::getOverallMagnitudeMaximum ( ) const
virtual

Returns the overall greatest magnitude value.

This method returns the greatest magnitude value of the DFT coefficients over all directions, channels and frequencies.

Returns
Absolute maximum magnitude value

Implements DAFFContentDFT.

Definition at line 1516 of file DAFFReaderImpl.cpp.

float DAFFReaderImpl::getOverallPeak ( )
virtual

Get overall peak value.

Returns
Overall peak value

Implements DAFFContentIR.

Definition at line 1529 of file DAFFReaderImpl.cpp.

DAFFReader * DAFFReaderImpl::getParent ( ) const
virtual

Returns the parent reader.

Implements DAFFContent.

Definition at line 1095 of file DAFFReaderImpl.cpp.

int DAFFReaderImpl::getPhase ( int  iRecordIndex,
int  iChannel,
int  iFreqIndex,
float &  fPhase 
) const
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

Implements DAFFContentMPS.

Definition at line 1648 of file DAFFReaderImpl.cpp.

int DAFFReaderImpl::getPhases ( int  iRecordIndex,
int  iChannel,
float *  pfDest 
) const
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

Implements DAFFContentMPS.

Definition at line 1617 of file DAFFReaderImpl.cpp.

DAFFProperties * DAFFReaderImpl::getProperties ( ) const
virtual

Returns the properties of the file.

Implements DAFFReader.

Definition at line 885 of file DAFFReaderImpl.cpp.

int DAFFReaderImpl::getQuantization ( ) const
virtual

Returns the quantization of the data elements.

Returns
Sample quantization, one of

Implements DAFFProperties.

Definition at line 956 of file DAFFReaderImpl.cpp.

int DAFFReaderImpl::getRecordCoords ( int  iRecordIndex,
int  iView,
float &  fAngle1Deg,
float &  fAngle2Deg 
) const
virtual

Determines the spherical coordinates of a record (grid point on spherical regular grid)

Parameters
[in]iRecordIndexThe index of the record on regular spherical grid
[in]iViewThe view that should be used for the given pair of angles, one of DAFF_VIEWS
[out]fAngle1DegFirst angle that corresponds to this index (Phi or Alpha, depending on view)
[out]fAngle2DegSecond angle that corresponds to this index (Theta or Beta, depending on view)
Returns
DAFF_NO_ERROR on success, another DAFF_ERROR otherwise

Implements DAFFContent.

Definition at line 1125 of file DAFFReaderImpl.cpp.

const DAFFMetadata * DAFFReaderImpl::getRecordMetadata ( int  iRecordIndex) const
virtual

Returns the metadata of a record.

Note: The method always returns a valid DAFFMetadata, even if there is none specified in the file. Thereby we maintain a consistent behaviour. Metadata may therefore be empty.

Parameters
[in]iRecordIndexThe index of the record on regular spherical grid
Returns
The const pointer to metadata

Implements DAFFContent.

Definition at line 1108 of file DAFFReaderImpl.cpp.

double DAFFReaderImpl::getSamplerate ( ) const
virtual

Returns the correspondig sampling rate [in Hertz].

Returns
Sampling rate in Hertz

Implements DAFFContentDFT.

Definition at line 1338 of file DAFFReaderImpl.cpp.

int DAFFReaderImpl::getTransformSize ( ) const
virtual

Returns the size of the transform (number of overall DFT coefficients)

This functions returns the overall number of complex-valued DFT coefficients. Note: For real-valued time-domain data, this also includes the symmetric coefficients.

Returns
DFT transform size

Implements DAFFContentDFT.

Definition at line 1722 of file DAFFReaderImpl.cpp.

bool DAFFReaderImpl::isFileOpened ( ) const
virtual

Returns whether a file is opened.

Implements DAFFReader.

Definition at line 42 of file DAFFReaderImpl.cpp.

bool DAFFReaderImpl::isSymmetric ( ) const
virtual

Returns whether the spectrum is complex-conjugated symmetric.

Returns
True, if the DFT spectrum is complex-conjugated symmetric

Implements DAFFContentDFT.

Definition at line 1730 of file DAFFReaderImpl.cpp.

bool DAFFReaderImpl::isValid ( ) const
virtual

Implements DAFFReader.

Definition at line 47 of file DAFFReaderImpl.cpp.

int DAFFReaderImpl::openFile ( const std::string &  sFilePath)
virtual

Opens a DAFF file for reading.

This method opens the given DAFF file for reading and loads all of its data into the memory.

Returns
DAFF_NO_ERROR on success, another DAFF_ERROR otherwise

Implements DAFFReader.

Definition at line 218 of file DAFFReaderImpl.cpp.

void DAFFReaderImpl::setDefaultOrientation ( )
virtual

Sets/alters the default orientation manually.

Implements DAFFProperties.

Definition at line 1051 of file DAFFReaderImpl.cpp.

void DAFFReaderImpl::setOrientation ( const DAFFOrientationYPR o)
virtual

Sets the current orientation of the object view.

Implements DAFFProperties.

Definition at line 1061 of file DAFFReaderImpl.cpp.

std::string DAFFReaderImpl::toString ( ) const
virtual

Returns string with information about the reader.

Implements DAFFReader.

Definition at line 892 of file DAFFReaderImpl.cpp.

void DAFFReaderImpl::transformAnglesD2O ( float  fAlphaDeg,
float  fBetaDeg,
float &  fAzimuthDeg,
float &  fElevationDeg 
) const
virtual

Transforms data spherical coordinates into object spherical coordinates.

This methods takes an angular pair (alpha, beta) in data spherical coordinates (DSC) and transforms it into the equivalent direction expressed in object spherical coordinates (OSC) as an angular pair (azimuth, elevation).

Parameters
[in]fAlphaDegAlpha angle in the DSC [degrees] (input)
[in]fBetaDegBeta angle in the DSC [degrees] (input)
[out]fAzimuthDegAzimuthal angle in the OSC [degrees] (output)
[out]fElevationDegElevation angle in the OSC [degrees] (output)

Implements DAFFContent.

Definition at line 1330 of file DAFFReaderImpl.cpp.

void DAFFReaderImpl::transformAnglesO2D ( float  fAzimuthDeg,
float  fElevationDeg,
float &  fAlphaDeg,
float &  fBetaDeg 
) const
virtual

Transforms object spherical coordinates into data spherical coordinates.

This methods takes an angular pair (alpha, beta) in object spherical coordinates (OSC) and transforms it into the equivalent direction expressed in data spherical coordinates (DSC) as an angular pair (azimuth, elevation).

Parameters
[in]fAzimuthDegAzimuthal angle in the OSC [degrees] (input)
[in]fElevationDegElevation angle in the OSC [degrees] (input)
[out]fAlphaDegAlpha angle in the DSC [degrees] (output)
[out]fBetaDegBeta angle in the DSC [degrees] (output)

Implements DAFFContent.

Definition at line 1334 of file DAFFReaderImpl.cpp.


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