CLAM-Development
1.4.0
|
#include <SpectralPeakDescriptors.hxx>
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 SpectralPeakArray * | GetpSpectralPeakArray () const |
void | SetpSpectralPeakArray (SpectralPeakArray *pSpectralPeakArray) |
void | ConcreteCompute () |
![]() | |
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) |
![]() | |
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 () |
![]() | |
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 Component * | GetAttributeAsComponent (unsigned i) const |
Component * | GetAttributeAsComponent (unsigned i) |
void | FullfilsInvariant () const |
virtual Component * | DeepCopy () 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. | |
![]() | |
virtual | ~Component () |
Additional Inherited Members | |
![]() | |
void | InitStats (DataArray *pData) |
![]() | |
StatsTmpl< abs > * | mpStats |
Definition at line 39 of file SpectralPeakDescriptors.hxx.
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().
|
virtual |
Implements CLAM::DescriptorTmpl< abs >.
Definition at line 86 of file SpectralPeakDescriptors.cxx.
References CLAM::StatsTmpl< abs, T, U, initOrder >::GetMean(), and CLAM::DescriptorTmpl< abs >::mpStats.
CLAM::SpectralPeakDescriptors::DYN_ATTRIBUTE | ( | 0 | , |
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 | ( | 1 | , |
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.
CLAM::SpectralPeakDescriptors::DYN_ATTRIBUTE | ( | 2 | , |
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
,where SE and PeakAmplitude were converted to logarithmic scale. Returns zero for array with less than 4 peaks.
CLAM::SpectralPeakDescriptors::DYN_ATTRIBUTE | ( | 3 | , |
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 | ( | 4 | , |
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 | ( | 5 | , |
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 | ( | 6 | , |
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 | ( | 7 | , |
public | , | ||
TData | , | ||
EvenHarmonics | |||
) |
Energy ratio of even harmonics to the energy of all peaks.
Returns zero for array with less than 2 peaks.
CLAM::SpectralPeakDescriptors::DYN_ATTRIBUTE | ( | 8 | , |
public | , | ||
TData | , | ||
OddToEvenRatio | |||
) |
Ratio of "OddHarmonics" to "EvenHarmonics".
Returns zero if both values are zero.
Range: [0, 1]
Formula:
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 | ) |
Definition at line 75 of file SpectralPeakDescriptors.cxx.
References CLAM_ASSERT, CLAM::EScale::eLinear, CLAM::DescriptorTmpl< abs >::InitStats(), and CLAM::BaseMemOp::Reset().