CLAM-Development  1.4.0
Public Member Functions
CLAM::SpectralPeakDescriptors Class Reference

#include <SpectralPeakDescriptors.hxx>

List of all members.

Public Member Functions

 DYNAMIC_TYPE_USING_INTERFACE (SpectralPeakDescriptors, 10, Descriptor)
 DYN_ATTRIBUTE (0, public, TData, MagnitudeMean)
 The average amplitude (arithmetic mean) of the spectral peaks.
 DYN_ATTRIBUTE (1, public, TData, HarmonicCentroid)
 The center of gravity of the spectral peaks.
 DYN_ATTRIBUTE (2, public, TData, HarmonicDeviation)
 Spectral deviation of magnitude components from spectral envelope.
 DYN_ATTRIBUTE (3, public, TData, FirstTristimulus)
 Energy ratio of the first harmonic to the energy of all peaks.
 DYN_ATTRIBUTE (4, public, TData, SecondTristimulus)
 Energy ratio of the second, third and forth harmonic to the energy of all peaks.
 DYN_ATTRIBUTE (5, public, TData, ThirdTristimulus)
 Energy ratio of all the harmonics starting from the fifth to the energy of all peaks.
 DYN_ATTRIBUTE (6, public, TData, OddHarmonics)
 Energy ratio of odd harmonics (excluding the fundamental) to the energy of all peaks.
 DYN_ATTRIBUTE (7, public, TData, EvenHarmonics)
 Energy ratio of even harmonics to the energy of all peaks.
 DYN_ATTRIBUTE (8, public, TData, OddToEvenRatio)
 Ratio of "OddHarmonics" to "EvenHarmonics".
 DYN_ATTRIBUTE (9, public, Array< TData >, HPCP)
 SpectralPeakDescriptors (SpectralPeakArray *pSpectralPeakArray)
 SpectralPeakDescriptors (TData initVal)
const SpectralPeakArrayGetpSpectralPeakArray () const
void SetpSpectralPeakArray (SpectralPeakArray *pSpectralPeakArray)
void ConcreteCompute ()
- Public Member Functions inherited from CLAM::DescriptorTmpl< abs >
 DescriptorTmpl (int n)
 DescriptorTmpl (const DescriptorTmpl< abs > &prototype, bool shareData=false, bool deep=true)
virtual ~DescriptorTmpl ()
virtual void Compute ()
void SetPrototype (const DescriptorTmpl< abs > &proto)
- Public Member Functions inherited from CLAM::ProcessingData
 ProcessingData (const int n)
 Constructor of an object that will contain the number of attributes passed by parameter.
 ProcessingData (const ProcessingData &prototype, bool shareData=false, bool deep=true)
 Copy constructor of a ProcessingData object.
virtual ~ProcessingData ()
- Public Member Functions inherited from CLAM::DynamicType
 DynamicType (const int nAttr)
 Constructs a DynamicType object that can hold.
 DynamicType (const DynamicType &prototype, const bool shareData, const bool deepCopy)
 Copy constructor of a dynamic Type.
 DynamicType (const DynamicType &prototype)
virtual ~DynamicType ()
virtual const char * GetClassName () const =0
 Return the class name.
void CopyInit (const DynamicType &dt)
 This method allows custom code for the copy-constructor of a dynamic type, since the copy-constructor is macro expanded and can not be overwritted.
bool UpdateData ()
 Method used to resize the data space of the dynamic type, necessary when some AddXXX() / RemoveXXX() (where XXX is an attribute name) has been done.
unsigned GetNDynamicAttributes () const
const char * GetDynamicAttributeName (unsigned i)
virtual const std::type_info & GetTypeId (unsigned i) const =0
bool AttributeIsComponent (unsigned i) const
bool AttributeIsDynamictype (unsigned i) const
bool IsAttributeInstantiated (unsigned i) const
const void * GetAttributeAsVoidPtr (unsigned i) const
const ComponentGetAttributeAsComponent (unsigned i) const
ComponentGetAttributeAsComponent (unsigned i)
void FullfilsInvariant () const
virtual ComponentDeepCopy () const
void Debug () const
virtual void StoreOn (CLAM::Storage &storage) const
 Stores component's subitems on the given Storage.
virtual void LoadFrom (CLAM::Storage &storage)
 Loads component's subitems from the given Storage.
- Public Member Functions inherited from CLAM::Component
virtual ~Component ()

Additional Inherited Members

- Protected Member Functions inherited from CLAM::DescriptorTmpl< abs >
void InitStats (DataArray *pData)
- Protected Attributes inherited from CLAM::DescriptorTmpl< abs >
StatsTmpl< abs > * mpStats

Detailed Description

Definition at line 39 of file SpectralPeakDescriptors.hxx.


Constructor & Destructor Documentation

CLAM::SpectralPeakDescriptors::SpectralPeakDescriptors ( SpectralPeakArray pSpectralPeakArray)

Definition at line 36 of file SpectralPeakDescriptors.cxx.

References CLAM_ASSERT, and CLAM::EScale::eLinear.

CLAM::SpectralPeakDescriptors::SpectralPeakDescriptors ( TData  initVal)

Definition at line 44 of file SpectralPeakDescriptors.cxx.

References CLAM::DynamicType::UpdateData().


Member Function Documentation

void CLAM::SpectralPeakDescriptors::ConcreteCompute ( )
virtual
CLAM::SpectralPeakDescriptors::DYN_ATTRIBUTE ( ,
public  ,
TData  ,
MagnitudeMean   
)

The average amplitude (arithmetic mean) of the spectral peaks.

It is computed on linear scale. Range: [0, 100]

CLAM::SpectralPeakDescriptors::DYN_ATTRIBUTE ( ,
public  ,
TData  ,
HarmonicCentroid   
)

The center of gravity of the spectral peaks.

Only the frequency value (in Hz) of the centroid is computed. Amplitude and frequency scale are linear for this operation.

  • Units: Hz
  • Range: [0, Nyquist frequency]
  • Singularities
    • Returns zero for empty peak array.
      Todo:
      Peaks at 0Hz are not counted
CLAM::SpectralPeakDescriptors::DYN_ATTRIBUTE ( ,
public  ,
TData  ,
HarmonicDeviation   
)

Spectral deviation of magnitude components from spectral envelope.

Descriptor is a MPEG7 LLD (HarmonicSpectralDeviation), see ISO/IEC JTC 1/SC 29 N WXYZ from 2001-03-14.

The local spectral envelopes (SE) are computed on linear scale as the mean of three consecutive peak amplitudes. For the first and the last peak only two peak amplitudes are used.

The spectral HarmonicDeviation is then defined as

\[ \sum_{i=1}^{Num. of Peaks} \left| PeakAmplitude(i) - SE(i)\right| \over {\sum_{i=1}^{Num. of Peaks}PeakAmplitude(i)} \]

,where SE and PeakAmplitude were converted to logarithmic scale. Returns zero for array with less than 4 peaks.

CLAM::SpectralPeakDescriptors::DYN_ATTRIBUTE ( ,
public  ,
TData  ,
FirstTristimulus   
)

Energy ratio of the first harmonic to the energy of all peaks.

Returns zero for empty peak array.

CLAM::SpectralPeakDescriptors::DYN_ATTRIBUTE ( ,
public  ,
TData  ,
SecondTristimulus   
)

Energy ratio of the second, third and forth harmonic to the energy of all peaks.

Returns zero for array with less than 2 peaks.

CLAM::SpectralPeakDescriptors::DYN_ATTRIBUTE ( ,
public  ,
TData  ,
ThirdTristimulus   
)

Energy ratio of all the harmonics starting from the fifth to the energy of all peaks.

Returns zero for array with less than 5 peaks.

CLAM::SpectralPeakDescriptors::DYN_ATTRIBUTE ( ,
public  ,
TData  ,
OddHarmonics   
)

Energy ratio of odd harmonics (excluding the fundamental) to the energy of all peaks.

Returns zero for array with less than 3 peaks.

CLAM::SpectralPeakDescriptors::DYN_ATTRIBUTE ( ,
public  ,
TData  ,
EvenHarmonics   
)

Energy ratio of even harmonics to the energy of all peaks.

Precondition:
The peaks represents an ordered list of harmonics starting at the fundamental.

Returns zero for array with less than 2 peaks.

CLAM::SpectralPeakDescriptors::DYN_ATTRIBUTE ( ,
public  ,
TData  ,
OddToEvenRatio   
)

Ratio of "OddHarmonics" to "EvenHarmonics".

Returns zero if both values are zero.

Precondition:
The peaks represents an ordered list of harmonics starting at the fundamental.

Range: [0, 1]

Formula:

\[ \frac{OddHarmonics}{EvenHarmonics+OddHarmonics} \]

See also:
SpectralPeakDescriptors::DYN_ATTRIBUTE(OddHarmonics)
SpectralPeakDescriptors::DYN_ATTRIBUTE(EvenHarmonics)
CLAM::SpectralPeakDescriptors::DYN_ATTRIBUTE ( ,
public  ,
Array< TData ,
HPCP   
)
CLAM::SpectralPeakDescriptors::DYNAMIC_TYPE_USING_INTERFACE ( SpectralPeakDescriptors  ,
10  ,
Descriptor   
)
const SpectralPeakArray * CLAM::SpectralPeakDescriptors::GetpSpectralPeakArray ( ) const

Definition at line 71 of file SpectralPeakDescriptors.cxx.

void CLAM::SpectralPeakDescriptors::SetpSpectralPeakArray ( SpectralPeakArray pSpectralPeakArray)

The documentation for this class was generated from the following files: