CLAM::SpectralPeakArray Class Reference

This processing data class offers an interface for storing an array of spectral peaks while maintaining efficient data access. More...

#include <SpectralPeakArray.hxx>

List of all members.

Public Member Functions

 SpectralPeakArray ()
 SpectralPeakArray (const SpectralPeakArray &prototype, const bool shareData=false, const bool deep=true)
 __COMMON_DYNAMIC_TYPE (SpectralPeakArray, 8)
 __COMMON_DYN_ATTRIBUTE (0, public, EScale, Scale) protected
bool LoadScale (CLAM::Storage &s)
 __COMMON_DYN_ATTRIBUTE (1, public, DataArray, MagBuffer) protected
bool LoadMagBuffer (CLAM::Storage &s)
 __COMMON_DYN_ATTRIBUTE (2, public, DataArray, FreqBuffer) protected
bool LoadFreqBuffer (CLAM::Storage &s)
 __COMMON_DYN_ATTRIBUTE (3, public, DataArray, PhaseBuffer) protected
bool LoadPhaseBuffer (CLAM::Storage &s)
 __COMMON_DYN_ATTRIBUTE (4, public, DataArray, BinPosBuffer) protected
bool LoadBinPosBuffer (CLAM::Storage &s)
 __COMMON_DYN_ATTRIBUTE (5, public, DataArray, BinWidthBuffer) protected
bool LoadBinWidthBuffer (CLAM::Storage &s)
 __COMMON_DYN_ATTRIBUTE (6, public, IndexArray, IndexArray) protected
bool LoadIndexArray (CLAM::Storage &s)
 __COMMON_DYN_ATTRIBUTE (7, public, bool, MinimizeResizes) protected
bool LoadMinimizeResizes (CLAM::Storage &s)
 SpectralPeakArray (const SpectralPeak &prototype)
 Accessory Constructor method Constructs the spectral peak array given a peak structure used as prototype and instantiating the needed dynamic attributes.
void InitFromPrototype (const SpectralPeak &spectralPeak)
 Accessory Initialitation method Initializes the spectral peak array given a peak structure used as prototype and instantiating the needed dynamic attributes.
void InitPeak (SpectralPeak &spectralPeak) const
 Accessory Initialitation method Initializes the spectral peak according to peak array prototype and instantiating the needed dynamic attributes.
TData GetMag (TIndex pos) const
 Accessory getter .
TData GetFreq (TIndex pos) const
 Accessory getter .
TData GetPhase (TIndex pos) const
 Accessory getter .
TData GetBinPos (TIndex pos) const
 Accessory getter .
int GetBinWidth (TIndex pos) const
 Accessory getter .
void SetMag (TIndex pos, TData newMag)
 Accessory setter .
void SetFreq (TIndex pos, TData newFreq)
 Accessory setter .
void SetPhase (TIndex pos, TData newPhase)
 Accessory setter .
void SetBinPos (TIndex pos, TData newBinPos)
 Accessory setter .
void SetBinWidth (TIndex pos, int newBinWidth)
 Accessory setter .
TIndex GetMaxMagPos () const
 Additional interface.
TIndex GetMaxMagIndex () const
 Additional interface.
void InitSpectralPeak (SpectralPeak &spectralPeak) const
 Accessory method offering interface for working with SpectralPeak class.
bool IsCorrectPrototype (const SpectralPeak &spectralPeak) const
 Accessory method offering interface for working with SpectralPeak class.
SpectralPeak GetSpectralPeak (TIndex pos) const
 Accessory getter offering interface for working with SpectralPeak class.
SpectralPeak GetThruIndexSpectralPeak (TIndex pos) const
 Accessory getter offering interface for working with SpectralPeak class.
void SetSpectralPeak (TIndex pos, const SpectralPeak &spectralPeak, TIndex index=-1)
 Accessory setter offering interface for working with SpectralPeak class.
void InsertSpectralPeak (TIndex pos, const SpectralPeak &spectralPeak, bool insertIndex=false, TIndex index=-1)
 Accessory method offering interface for working with SpectralPeak class.
void AddSpectralPeak (const SpectralPeak &spectralPeak, bool addIndex=false, TIndex index=-1)
 Accessory method offering interface for working with SpectralPeak class.
void DeleteSpectralPeak (TIndex pos, bool deleteIndex=false)
 Accessory method offering interface for working with SpectralPeak class.
int GetnIndexedPeaks () const
 Additional interface for working with indices.
TIndex GetPositionFromIndex (TIndex index) const
 Additional interface for working with indices.
void SetIndex (TIndex pos, TIndex index)
 Additional interface for working with indices.
TIndex GetIndex (TIndex pos) const
 Additional interface for working with indices.
void DeleteIndex (TIndex index)
 Additional interface for working with indices.
void ResetIndices ()
 Additional interface for working with indices resizes index array according to the current number of peaks and assigns subsecuent indices starting with 0 and finishing with nPeaks-1.
void InitIndices ()
 Additional interface for working with indices resizes index array according to the current number of peaks and sets each index to -1 (which is usually interpreted as "no valid index".
void SetIndicesTo (TIndex val)
 Additional interface for working with indices sets all indices to a given value.
void AddIndex (TIndex index)
 Additional interface for working with indices.
TIndex GetFirstNonValidIndexPosition (TIndex beginAt) const
 Additional interface for working with indices returns first position in index array to have a value of -1.
bool IsValidIndex (TIndex position) const
 Additional interface for working with indices.
TIndex IsIndexExisting (TIndex index) const
 Additional interface for working with indices.
TIndex GetMaxIndex () const
 Additional interface for working with indices.
TSize GetnPeaks () const
 Returns the actual size of the different instantiated buffers which should be consistent in size (this is guaranteed if this interface is used but not if the user sets the buffer size directly accessing the arrays.
void SetnPeaks (TSize npeaks)
 Sets the actual size of the different instantiated buffers keeping them consistent.
void SetnMaxPeaks (TSize npeaks)
 Sets the actual allocated size of the different instantiated buffers keeping them consistent.
TSize GetnMaxPeaks () const
 Returns the actual allocated size of the different instantiated buffers which should be consistent in size (this is guaranteed if this interface is used but not if the user resizes buffers directly accessing the arrays.
double GetThruIndexFreq (TIndex pos) const
double GetThruIndexMag (TIndex pos) const
double GetThruIndexPhase (TIndex pos) const
double GetThruIndexBinPos (TIndex pos) const
TSize GetThruIndexBinWidth (TIndex pos) const
void SetThruIndexFreq (TIndex pos, double freq)
void SetThruIndexMag (TIndex pos, double mag)
void SetThruIndexPhase (TIndex pos, double phase)
void SetThruIndexBinPos (TIndex pos, double binPos)
void SetThruIndexBinWidth (TIndex pos, TSize binWidth)
void SetThruIndexSpectralPeak (TIndex pos, SpectralPeak &peak)
void SetIsIndexUpToDate (bool isUpToDate)
void TodB ()
 Converts linear magnitude data to dB.
void ToLinear ()
 Converts dB magnitude data to linear.
void CopyMembers (SpectralPeakArray &sourceSpectralPeakArray)
 Copies all of the spectral peak data from the given objects member arrays -- FreqBuffer, MagBuffer, PhaseBuffer, BinPosBuffer, BinWidthBuffer, and IndexArray -- to the member arrays of this object.
SpectralPeakArray operator+ (const SpectralPeakArray &in)

Protected Member Functions

void DefaultInit ()
 The concrete dynamic type constructor calls DefaultInit().

Detailed Description

This processing data class offers an interface for storing an array of spectral peaks while maintaining efficient data access.

This is accomplished by actually storing in memory an independent buffer for each of the attributes of a spectral peak. The interface to use SpectralPeak class is simulated adding an interface that constructs these objects on the fly, whenever a Peak is accessed. Furthermore, this class holds an array of indices that can be used for different purposes such as sorting, assigning tracks...Any peak can be accessed throug its actual position in the array or its associated index

See also:
ProcessingData
SpectralPeak
Author:
Xavier Amatriain

Definition at line 68 of file SpectralPeakArray.hxx.


Constructor & Destructor Documentation

CLAM::SpectralPeakArray::SpectralPeakArray (  )  [inline]

Definition at line 71 of file SpectralPeakArray.hxx.

CLAM::SpectralPeakArray::SpectralPeakArray ( const SpectralPeakArray prototype,
const bool  shareData = false,
const bool  deep = true 
) [inline]

Definition at line 71 of file SpectralPeakArray.hxx.

CLAM::SpectralPeakArray::SpectralPeakArray ( const SpectralPeak prototype  ) 

Accessory Constructor method Constructs the spectral peak array given a peak structure used as prototype and instantiating the needed dynamic attributes.

Parameters:
SpectralPeak used as prototype

Definition at line 41 of file SpectralPeakArray.cxx.

References InitFromPrototype().


Member Function Documentation

CLAM::SpectralPeakArray::__COMMON_DYN_ATTRIBUTE ( ,
public  ,
bool  ,
MinimizeResizes   
) [inline]

Definition at line 79 of file SpectralPeakArray.hxx.

CLAM::SpectralPeakArray::__COMMON_DYN_ATTRIBUTE ( ,
public  ,
IndexArray  ,
IndexArray   
) [inline]

Definition at line 78 of file SpectralPeakArray.hxx.

CLAM::SpectralPeakArray::__COMMON_DYN_ATTRIBUTE ( ,
public  ,
DataArray  ,
BinWidthBuffer   
) [inline]

Definition at line 77 of file SpectralPeakArray.hxx.

CLAM::SpectralPeakArray::__COMMON_DYN_ATTRIBUTE ( ,
public  ,
DataArray  ,
BinPosBuffer   
) [inline]

Definition at line 76 of file SpectralPeakArray.hxx.

CLAM::SpectralPeakArray::__COMMON_DYN_ATTRIBUTE ( ,
public  ,
DataArray  ,
PhaseBuffer   
) [inline]

Definition at line 75 of file SpectralPeakArray.hxx.

CLAM::SpectralPeakArray::__COMMON_DYN_ATTRIBUTE ( ,
public  ,
DataArray  ,
FreqBuffer   
) [inline]

Definition at line 74 of file SpectralPeakArray.hxx.

CLAM::SpectralPeakArray::__COMMON_DYN_ATTRIBUTE ( ,
public  ,
DataArray  ,
MagBuffer   
) [inline]

Definition at line 73 of file SpectralPeakArray.hxx.

CLAM::SpectralPeakArray::__COMMON_DYN_ATTRIBUTE ( ,
public  ,
EScale  ,
Scale   
) [inline]

Definition at line 72 of file SpectralPeakArray.hxx.

CLAM::SpectralPeakArray::__COMMON_DYNAMIC_TYPE ( SpectralPeakArray  ,
 
)
void CLAM::SpectralPeakArray::AddIndex ( TIndex  index  ) 

Additional interface for working with indices.

Parameters:
index to add at the end of the index array

Definition at line 366 of file SpectralPeakArray.cxx.

References CLAM_ASSERT.

void CLAM::SpectralPeakArray::AddSpectralPeak ( const SpectralPeak spectralPeak,
bool  addIndex = false,
TIndex  index = -1 
)

Accessory method offering interface for working with SpectralPeak class.

Note: for efficiency you need to work directly on the buffer Adds a peak (or rather the values of its attributes) at the end of the array

Parameters:
SpectralPeak to add
boolean value indicating if the index array should be modified or not
Index value of the given SpectralPeak, set by default to -1

Definition at line 214 of file SpectralPeakArray.cxx.

References CLAM_ASSERT, and IsCorrectPrototype().

Referenced by CLAM::SpectralPeakArrayAdder::Do().

void CLAM::SpectralPeakArray::CopyMembers ( SpectralPeakArray sourceSpectralPeakArray  ) 

Copies all of the spectral peak data from the given objects member arrays -- FreqBuffer, MagBuffer, PhaseBuffer, BinPosBuffer, BinWidthBuffer, and IndexArray -- to the member arrays of this object.

Copies the properties Scale and MinimizeResizes too.

Definition at line 517 of file SpectralPeakArray.cxx.

References GetnMaxPeaks(), GetnPeaks(), ResetIndices(), SetnMaxPeaks(), and SetnPeaks().

Referenced by CLAM::DataUtil::CopySpectralPeakArraysMembers().

void CLAM::SpectralPeakArray::DefaultInit ( void   )  [protected]

The concrete dynamic type constructor calls DefaultInit().

This allows user to initialize his/her object. But we define DefaultInit() here because we don't want to force writting one DefaultInit() function for each concrete dynamic type. If a dynamic type concrete class defines some (not-default) constructors, this should also call the DefaultInit().

See also:
CopyInit()

Reimplemented from CLAM::DynamicType.

Definition at line 47 of file SpectralPeakArray.cxx.

References CLAM::EScale::eLinear, SetnPeaks(), and CLAM::DynamicType::UpdateData().

void CLAM::SpectralPeakArray::DeleteIndex ( TIndex  index  ) 

Additional interface for working with indices.

Parameters:
position where to delete an index

Definition at line 358 of file SpectralPeakArray.cxx.

References CLAM_ASSERT, and GetPositionFromIndex().

Referenced by CLAM::FundFreqDetect::Do().

void CLAM::SpectralPeakArray::DeleteSpectralPeak ( TIndex  pos,
bool  deleteIndex = false 
)

Accessory method offering interface for working with SpectralPeak class.

Note: for efficiency you need to work directly on the buffer Deletes a peak (or rather the values of its attributes) at a given position

Parameters:
position of the peak to delete
boolean value indicating if the index array should be modified or not

Definition at line 232 of file SpectralPeakArray.cxx.

References CLAM_ASSERT, and GetnPeaks().

TData CLAM::SpectralPeakArray::GetBinPos ( TIndex  pos  )  const [inline]

Accessory getter .

Note: for efficiency you need to work directly on the buffer

Returns:
Bin Position of the peak in the given position
Parameters:
Position in the array

Definition at line 126 of file SpectralPeakArray.hxx.

Referenced by GetSpectralPeak(), and GetThruIndexBinPos().

int CLAM::SpectralPeakArray::GetBinWidth ( TIndex  pos  )  const [inline]

Accessory getter .

Note: for efficiency you need to work directly on the buffer

Returns:
Bin Width of the peak in the given position
Parameters:
Position in the array

Definition at line 131 of file SpectralPeakArray.hxx.

Referenced by GetSpectralPeak(), and GetThruIndexBinWidth().

TIndex CLAM::SpectralPeakArray::GetFirstNonValidIndexPosition ( TIndex  beginAt  )  const

Additional interface for working with indices returns first position in index array to have a value of -1.

Returns:
position where the index was found, -1 if all indices are valid
Parameters:
position to begin search

Definition at line 372 of file SpectralPeakArray.cxx.

References CLAM_ASSERT, and CLAM::Array< T >::Size().

TData CLAM::SpectralPeakArray::GetFreq ( TIndex  pos  )  const [inline]

Accessory getter .

Note: for efficiency you need to work directly on the buffer

Returns:
Frequency of the peak in the given position
Parameters:
Position in the array

Definition at line 116 of file SpectralPeakArray.hxx.

Referenced by CLAM::SpectralPeakArrayAdder::Do(), GetSpectralPeak(), and GetThruIndexFreq().

TIndex CLAM::SpectralPeakArray::GetIndex ( TIndex  pos  )  const [inline]

Additional interface for working with indices.

Returns:
index found at a given position of the index array
Parameters:
position in the index array

Definition at line 252 of file SpectralPeakArray.hxx.

Referenced by CLAM::SpectralPeakArrayInterpolator::Do().

TData CLAM::SpectralPeakArray::GetMag ( TIndex  pos  )  const [inline]

Accessory getter .

Note: for efficiency you need to work directly on the buffer

Returns:
Magnitude of the peak in the given position
Parameters:
Position in the array

Definition at line 111 of file SpectralPeakArray.hxx.

Referenced by CLAM::FundFreqDetect::Do(), GetSpectralPeak(), and GetThruIndexMag().

TIndex CLAM::SpectralPeakArray::GetMaxIndex (  )  const

Additional interface for working with indices.

Returns:
the value of the index with a higher value
TIndex CLAM::SpectralPeakArray::GetMaxMagIndex (  )  const

Additional interface.

Returns:
the position of the index array containing the index of the peak ewhere the maximum amplitude is found

Definition at line 288 of file SpectralPeakArray.cxx.

References CLAM_ASSERT.

Referenced by CLAM::FundFreqDetect::Do().

TIndex CLAM::SpectralPeakArray::GetMaxMagPos (  )  const

Additional interface.

Returns:
the position of the peak array where the maximum amplitude is found

Definition at line 268 of file SpectralPeakArray.cxx.

References GetnPeaks().

Referenced by CLAM::FundFreqDetect::Do().

int CLAM::SpectralPeakArray::GetnIndexedPeaks (  )  const

Additional interface for working with indices.

Returns:
the number of non assigned peaks in the array

Definition at line 384 of file SpectralPeakArray.cxx.

References CLAM_ASSERT, and CLAM::Array< T >::Size().

TSize CLAM::SpectralPeakArray::GetnMaxPeaks (  )  const [inline]

Returns the actual allocated size of the different instantiated buffers which should be consistent in size (this is guaranteed if this interface is used but not if the user resizes buffers directly accessing the arrays.

Definition at line 382 of file SpectralPeakArray.hxx.

Referenced by CopyMembers(), CLAM::SpectralPeakDetect::Do(), CLAM::SpectralEnvelopeApply::Do(), CLAM::SMSSinusoidalGain::Do(), CLAM::FundFreqDetect::Do(), InitIndices(), operator+(), ResetIndices(), and SetnPeaks().

TSize CLAM::SpectralPeakArray::GetnPeaks (  )  const [inline]
TData CLAM::SpectralPeakArray::GetPhase ( TIndex  pos  )  const [inline]

Accessory getter .

Note: for efficiency you need to work directly on the buffer

Returns:
Phase of the peak in the given position
Parameters:
Position in the array

Definition at line 121 of file SpectralPeakArray.hxx.

Referenced by GetSpectralPeak(), and GetThruIndexPhase().

TIndex CLAM::SpectralPeakArray::GetPositionFromIndex ( TIndex  index  )  const

Additional interface for working with indices.

Returns:
first Position in the index array that holds a given index
Parameters:
index to find in index array

Definition at line 252 of file SpectralPeakArray.cxx.

References CLAM_ASSERT, and CLAM::Array< T >::Size().

Referenced by DeleteIndex(), and CLAM::SpectralPeakArrayInterpolator::Do().

SpectralPeak CLAM::SpectralPeakArray::GetSpectralPeak ( TIndex  pos  )  const

Accessory getter offering interface for working with SpectralPeak class.

Note: for efficiency you need to work directly on the buffer

Returns:
SpectralPeak in the given position
Parameters:
position in the array

Definition at line 154 of file SpectralPeakArray.cxx.

References CLAM_ASSERT, GetBinPos(), GetBinWidth(), GetFreq(), GetMag(), GetnPeaks(), GetPhase(), and InitSpectralPeak().

Referenced by CLAM::SpectralPeakArrayAdder::Do(), CLAM::SMSSinusoidalGain::Do(), and GetThruIndexSpectralPeak().

double CLAM::SpectralPeakArray::GetThruIndexBinPos ( TIndex  pos  )  const

Definition at line 422 of file SpectralPeakArray.cxx.

References CLAM_ASSERT, and GetBinPos().

TSize CLAM::SpectralPeakArray::GetThruIndexBinWidth ( TIndex  pos  )  const

Definition at line 430 of file SpectralPeakArray.cxx.

References CLAM_ASSERT, and GetBinWidth().

double CLAM::SpectralPeakArray::GetThruIndexFreq ( TIndex  pos  )  const

Definition at line 398 of file SpectralPeakArray.cxx.

References CLAM_ASSERT, and GetFreq().

double CLAM::SpectralPeakArray::GetThruIndexMag ( TIndex  pos  )  const

Definition at line 406 of file SpectralPeakArray.cxx.

References CLAM_ASSERT, and GetMag().

double CLAM::SpectralPeakArray::GetThruIndexPhase ( TIndex  pos  )  const

Definition at line 414 of file SpectralPeakArray.cxx.

References CLAM_ASSERT, and GetPhase().

SpectralPeak CLAM::SpectralPeakArray::GetThruIndexSpectralPeak ( TIndex  pos  )  const

Accessory getter offering interface for working with SpectralPeak class.

Note: for efficiency you need to work directly on the buffer

Returns:
SpectralPeak in the position given by the value of the index in the given position
Parameters:
index position in the index array

Definition at line 149 of file SpectralPeakArray.cxx.

References GetSpectralPeak().

void CLAM::SpectralPeakArray::InitFromPrototype ( const SpectralPeak spectralPeak  ) 

Accessory Initialitation method Initializes the spectral peak array given a peak structure used as prototype and instantiating the needed dynamic attributes.

Parameters:
SpectralPeak used as prototype

Definition at line 91 of file SpectralPeakArray.cxx.

References CLAM::DynamicType::UpdateData().

Referenced by SpectralPeakArray().

void CLAM::SpectralPeakArray::InitIndices (  ) 

Additional interface for working with indices resizes index array according to the current number of peaks and sets each index to -1 (which is usually interpreted as "no valid index".

Definition at line 328 of file SpectralPeakArray.cxx.

References CLAM_ASSERT, GetnMaxPeaks(), GetnPeaks(), CLAM::Array< T >::Resize(), and CLAM::Array< T >::SetSize().

void CLAM::SpectralPeakArray::InitPeak ( SpectralPeak spectralPeak  )  const

Accessory Initialitation method Initializes the spectral peak according to peak array prototype and instantiating the needed dynamic attributes.

Parameters:
SpectralPeak to initialize

Definition at line 70 of file SpectralPeakArray.cxx.

References CLAM::DynamicType::UpdateData().

void CLAM::SpectralPeakArray::InitSpectralPeak ( SpectralPeak spectralPeak  )  const

Accessory method offering interface for working with SpectralPeak class.

Note: for efficiency you need to work directly on the buffer Initializes a given peak structure according to structure of array instantiating the needed dynamic attributes

Parameters:
SpectralPeak to be initialized

Definition at line 117 of file SpectralPeakArray.cxx.

References CLAM::DynamicType::UpdateData().

Referenced by GetSpectralPeak().

void CLAM::SpectralPeakArray::InsertSpectralPeak ( TIndex  pos,
const SpectralPeak spectralPeak,
bool  insertIndex = false,
TIndex  index = -1 
)

Accessory method offering interface for working with SpectralPeak class.

Note: for efficiency you need to work directly on the buffer Inserts a peak (or rather the values of its attributes) at the given position moving the ones in next positions

Parameters:
position in the array where to insert
SpectralPeak to set in the given position
boolean value indicating if the index array should be modified or not
Index value of the given SpectralPeak, set by default to -1

Definition at line 195 of file SpectralPeakArray.cxx.

References CLAM_ASSERT, GetnPeaks(), and IsCorrectPrototype().

bool CLAM::SpectralPeakArray::IsCorrectPrototype ( const SpectralPeak spectralPeak  )  const

Accessory method offering interface for working with SpectralPeak class.

Note: for efficiency you need to work directly on the buffer Checks that spectral peak prototype is consistent with spectral array structure

Parameters:
SpectralPeak to be checked

Definition at line 133 of file SpectralPeakArray.cxx.

Referenced by AddSpectralPeak(), InsertSpectralPeak(), and SetSpectralPeak().

TIndex CLAM::SpectralPeakArray::IsIndexExisting ( TIndex  index  )  const

Additional interface for working with indices.

Returns:
true if index is found in the arry
Parameters:
index to find
bool CLAM::SpectralPeakArray::IsValidIndex ( TIndex  position  )  const

Additional interface for working with indices.

Returns:
true if index at the given position is greater than 0
Parameters:
position of the index to validate
bool CLAM::SpectralPeakArray::LoadBinPosBuffer ( CLAM::Storage s  )  [inline]

Definition at line 76 of file SpectralPeakArray.hxx.

bool CLAM::SpectralPeakArray::LoadBinWidthBuffer ( CLAM::Storage s  )  [inline]

Definition at line 77 of file SpectralPeakArray.hxx.

bool CLAM::SpectralPeakArray::LoadFreqBuffer ( CLAM::Storage s  )  [inline]

Definition at line 74 of file SpectralPeakArray.hxx.

bool CLAM::SpectralPeakArray::LoadIndexArray ( CLAM::Storage s  )  [inline]

Definition at line 78 of file SpectralPeakArray.hxx.

bool CLAM::SpectralPeakArray::LoadMagBuffer ( CLAM::Storage s  )  [inline]

Definition at line 73 of file SpectralPeakArray.hxx.

bool CLAM::SpectralPeakArray::LoadMinimizeResizes ( CLAM::Storage s  )  [inline]

Definition at line 79 of file SpectralPeakArray.hxx.

bool CLAM::SpectralPeakArray::LoadPhaseBuffer ( CLAM::Storage s  )  [inline]

Definition at line 75 of file SpectralPeakArray.hxx.

bool CLAM::SpectralPeakArray::LoadScale ( CLAM::Storage s  )  [inline]

Definition at line 72 of file SpectralPeakArray.hxx.

SpectralPeakArray CLAM::SpectralPeakArray::operator+ ( const SpectralPeakArray in  ) 
void CLAM::SpectralPeakArray::ResetIndices (  ) 

Additional interface for working with indices resizes index array according to the current number of peaks and assigns subsecuent indices starting with 0 and finishing with nPeaks-1.

Definition at line 312 of file SpectralPeakArray.cxx.

References CLAM::Array< T >::AllocatedSize(), CLAM_ASSERT, GetnMaxPeaks(), GetnPeaks(), CLAM::IndexArray::Reset(), CLAM::Array< T >::Resize(), and CLAM::Array< T >::SetSize().

Referenced by CopyMembers(), and CLAM::FundFreqDetect::Do().

void CLAM::SpectralPeakArray::SetBinPos ( TIndex  pos,
TData  newBinPos 
) [inline]

Accessory setter .

Note: for efficiency you need to work directly on the buffer

Parameters:
Position in the array
new value for bin position of the peak in the given position

Definition at line 151 of file SpectralPeakArray.hxx.

Referenced by SetThruIndexBinPos().

void CLAM::SpectralPeakArray::SetBinWidth ( TIndex  pos,
int  newBinWidth 
) [inline]

Accessory setter .

Note: for efficiency you need to work directly on the buffer

Parameters:
Position in the array
new value for bin width of the peak in the given position

Definition at line 156 of file SpectralPeakArray.hxx.

Referenced by SetThruIndexBinWidth().

void CLAM::SpectralPeakArray::SetFreq ( TIndex  pos,
TData  newFreq 
) [inline]

Accessory setter .

Note: for efficiency you need to work directly on the buffer

Parameters:
Position in the array
new value for frequency of the peak in the given position

Definition at line 141 of file SpectralPeakArray.hxx.

Referenced by SetThruIndexFreq().

void CLAM::SpectralPeakArray::SetIndex ( TIndex  pos,
TIndex  index 
) [inline]

Additional interface for working with indices.

Parameters:
position where to set the given index
index to set

Definition at line 247 of file SpectralPeakArray.hxx.

void CLAM::SpectralPeakArray::SetIndicesTo ( TIndex  val  ) 

Additional interface for working with indices sets all indices to a given value.

Parameters:
value to set all indices to

Definition at line 344 of file SpectralPeakArray.cxx.

References CLAM_ASSERT, and GetnPeaks().

void CLAM::SpectralPeakArray::SetIsIndexUpToDate ( bool  isUpToDate  )  [inline]

Definition at line 405 of file SpectralPeakArray.hxx.

void CLAM::SpectralPeakArray::SetMag ( TIndex  pos,
TData  newMag 
) [inline]

Accessory setter .

Note: for efficiency you need to work directly on the buffer

Parameters:
Position in the array
new value for magnitude of the peak in the given position

Definition at line 136 of file SpectralPeakArray.hxx.

Referenced by SetThruIndexMag().

void CLAM::SpectralPeakArray::SetnMaxPeaks ( TSize  npeaks  )  [inline]

Sets the actual allocated size of the different instantiated buffers keeping them consistent.

Useful for reducing the number of allocations in run time.

Definition at line 349 of file SpectralPeakArray.hxx.

Referenced by CopyMembers(), CLAM::SpectralPeakDetect::Do(), CLAM::SpectralEnvelopeApply::Do(), CLAM::SMSSinusoidalGain::Do(), CLAM::FundFreqDetect::Do(), operator+(), and SetnPeaks().

void CLAM::SpectralPeakArray::SetnPeaks ( TSize  npeaks  )  [inline]

Sets the actual size of the different instantiated buffers keeping them consistent.

If allocated size is less than npeaks, a resize is automatically performed on all buffers.

Definition at line 321 of file SpectralPeakArray.hxx.

References GetnMaxPeaks(), and SetnMaxPeaks().

Referenced by CopyMembers(), DefaultInit(), CLAM::SpectralPeakDetect::Do(), CLAM::SpectralPeakArrayInterpolator::Do(), CLAM::SpectralPeakArrayAdder::Do(), CLAM::SpectralEnvelopeApply::Do(), CLAM::SMSSinusoidalGain::Do(), CLAM::SMSPitchShift::Do(), and operator+().

void CLAM::SpectralPeakArray::SetPhase ( TIndex  pos,
TData  newPhase 
) [inline]

Accessory setter .

Note: for efficiency you need to work directly on the buffer

Parameters:
Position in the array
new value for phase of the peak in the given position

Definition at line 146 of file SpectralPeakArray.hxx.

Referenced by SetThruIndexPhase().

void CLAM::SpectralPeakArray::SetSpectralPeak ( TIndex  pos,
const SpectralPeak spectralPeak,
TIndex  index = -1 
)

Accessory setter offering interface for working with SpectralPeak class.

Note: for efficiency you need to work directly on the buffer

Parameters:
position in the array
SpectralPeak to set in the given position
Index value of the given SpectralPeak, set by default to -1

Definition at line 175 of file SpectralPeakArray.cxx.

References CLAM_ASSERT, GetnPeaks(), and IsCorrectPrototype().

Referenced by CLAM::SMSSinusoidalGain::Do(), and SetThruIndexSpectralPeak().

void CLAM::SpectralPeakArray::SetThruIndexBinPos ( TIndex  pos,
double  binPos 
)

Definition at line 473 of file SpectralPeakArray.cxx.

References CLAM_ASSERT, and SetBinPos().

void CLAM::SpectralPeakArray::SetThruIndexBinWidth ( TIndex  pos,
TSize  binWidth 
)

Definition at line 481 of file SpectralPeakArray.cxx.

References CLAM_ASSERT, and SetBinWidth().

void CLAM::SpectralPeakArray::SetThruIndexFreq ( TIndex  pos,
double  freq 
)

Definition at line 449 of file SpectralPeakArray.cxx.

References CLAM_ASSERT, and SetFreq().

void CLAM::SpectralPeakArray::SetThruIndexMag ( TIndex  pos,
double  mag 
)

Definition at line 457 of file SpectralPeakArray.cxx.

References CLAM_ASSERT, and SetMag().

void CLAM::SpectralPeakArray::SetThruIndexPhase ( TIndex  pos,
double  phase 
)

Definition at line 465 of file SpectralPeakArray.cxx.

References CLAM_ASSERT, and SetPhase().

void CLAM::SpectralPeakArray::SetThruIndexSpectralPeak ( TIndex  pos,
SpectralPeak peak 
)

Definition at line 439 of file SpectralPeakArray.cxx.

References CLAM_ASSERT, and SetSpectralPeak().

void CLAM::SpectralPeakArray::TodB (  ) 

Converts linear magnitude data to dB.

Definition at line 489 of file SpectralPeakArray.cxx.

References CLAM_20log10(), CLAM::EScale::eLog, and GetnPeaks().

Referenced by CLAM::SpectralPeakArrayInterpolator::Do().

void CLAM::SpectralPeakArray::ToLinear (  ) 

Converts dB magnitude data to linear.

Definition at line 503 of file SpectralPeakArray.cxx.

References CLAM::EScale::eLinear, GetnPeaks(), and log2lin().

Referenced by CLAM::SpectralPeakArrayInterpolator::Do(), and CLAM::SDIFOut::Do().


The documentation for this class was generated from the following files:
Generated by  doxygen 1.6.3