#include <SpectralDescriptors.hxx>
Definition at line 38 of file SpectralDescriptors.hxx.
Public Member Functions | |
DYNAMIC_TYPE_USING_INTERFACE (SpectralDescriptors, 21, Descriptor) | |
DYN_ATTRIBUTE (0, public, TData, Mean) | |
The spectral power mean value. | |
DYN_ATTRIBUTE (1, public, TData, GeometricMean) | |
The geometric mean for the spectral power values sequence. | |
DYN_ATTRIBUTE (2, public, TData, Energy) | |
The squared sum of spectral power distribution values. | |
DYN_ATTRIBUTE (3, public, TData, Centroid) | |
The frequency where the center of mass of the spectral power distribution lies. | |
DYN_ATTRIBUTE (4, public, TData, Moment2) | |
DYN_ATTRIBUTE (5, public, TData, Moment3) | |
DYN_ATTRIBUTE (6, public, TData, Moment4) | |
DYN_ATTRIBUTE (7, public, TData, Moment5) | |
DYN_ATTRIBUTE (8, public, TData, Moment6) | |
DYN_ATTRIBUTE (9, public, TData, Flatness) | |
DYN_ATTRIBUTE (10, public, TData, MagnitudeKurtosis) | |
DYN_ATTRIBUTE (11, public, Array< TData >, MFCC) | |
DYN_ATTRIBUTE (12, public, TData, MaxMagFreq) | |
Frequency of the maximum magnitude of the spectrum normalized by the spectral range. | |
DYN_ATTRIBUTE (13, public, TData, LowFreqEnergyRelation) | |
The ratio between the energy over 0-100 Hz band and the whole spectrum energy. | |
DYN_ATTRIBUTE (14, public, TData, Spread) | |
The spectral spread is the variation of the spectrum around its mean value. | |
DYN_ATTRIBUTE (15, public, TData, MagnitudeSkewness) | |
DYN_ATTRIBUTE (16, public, TData, Rolloff) | |
The spectral roll-off point is the frequency value so that the 85% of the spectral energy is contained below it. | |
DYN_ATTRIBUTE (17, public, TData, Slope) | |
The spectral slope represents the amount of decreasing of the spectral magnitude. | |
DYN_ATTRIBUTE (18, public, TData, HighFrequencyContent) | |
Sum of the squared spectrum magnitude multiplied by the wave number of the bin. | |
DYN_ATTRIBUTE (19, public, Array< SpectralDescriptors >, BandDescriptors) | |
DYN_ATTRIBUTE (20, public, Array< TData >, PCP) | |
SpectralDescriptors (Spectrum *pSpectrum) | |
SpectralDescriptors (TData initVal) | |
const Spectrum * | GetpSpectrum () const |
void | SetpSpectrum (Spectrum *pSpectrum) |
void | ConcreteCompute () |
void | DefaultInit () |
The concrete dynamic type constructor calls DefaultInit(). | |
void | CopyInit (const SpectralDescriptors &copied) |
TData | ComputeSpectralFlatness () |
TData | ComputeHighFrequencyContent () |
TData | ComputeMaxMagFreq () |
It computes the frequency where the spectrum has its maximum value. | |
TData | ComputeLowFreqEnergyRelation () |
TData | ComputeRolloff () |
TData | ComputeSpread () |
TData | ComputeSlope () |
CLAM::SpectralDescriptors::SpectralDescriptors | ( | Spectrum * | pSpectrum | ) |
Definition at line 101 of file SpectralDescriptors.cxx.
References CLAM_ASSERT, and CLAM::EScale::eLinear.
CLAM::SpectralDescriptors::SpectralDescriptors | ( | TData | initVal | ) |
CLAM::SpectralDescriptors::DYNAMIC_TYPE_USING_INTERFACE | ( | SpectralDescriptors | , | |
21 | , | |||
Descriptor | ||||
) |
The spectral power mean value.
The unit of this measure can be dB or none, depending on the scale set for the measured Spectrum object.
CLAM::SpectralDescriptors::DYN_ATTRIBUTE | ( | 1 | , | |
public | , | |||
TData | , | |||
GeometricMean | ||||
) |
The geometric mean for the spectral power values sequence.
See this for a definition of this pythagorean mean. Note that computing this measurement over long sequences of small real numbers ( as the ones one usually founds in spectral power distributions derived of audio windowed with a normalized window function ) pose a numerical problem. To avoid this, computation of Geometric mean is restricted to Log scale Spectral Power Distributions since this allows to change the product for a summation.
This measure is expressed in dBs.
The squared sum of spectral power distribution values.
This measure comes in the same units as the distribution values.
The frequency where the center of mass of the spectral power distribution lies.
This measure is expressed in Hz.
CLAM::SpectralDescriptors::DYN_ATTRIBUTE | ( | 4 | , | |
public | , | |||
TData | , | |||
Moment2 | ||||
) |
CLAM::SpectralDescriptors::DYN_ATTRIBUTE | ( | 5 | , | |
public | , | |||
TData | , | |||
Moment3 | ||||
) |
CLAM::SpectralDescriptors::DYN_ATTRIBUTE | ( | 6 | , | |
public | , | |||
TData | , | |||
Moment4 | ||||
) |
CLAM::SpectralDescriptors::DYN_ATTRIBUTE | ( | 7 | , | |
public | , | |||
TData | , | |||
Moment5 | ||||
) |
CLAM::SpectralDescriptors::DYN_ATTRIBUTE | ( | 8 | , | |
public | , | |||
TData | , | |||
Moment6 | ||||
) |
CLAM::SpectralDescriptors::DYN_ATTRIBUTE | ( | 9 | , | |
public | , | |||
TData | , | |||
Flatness | ||||
) |
CLAM::SpectralDescriptors::DYN_ATTRIBUTE | ( | 10 | , | |
public | , | |||
TData | , | |||
MagnitudeKurtosis | ||||
) |
CLAM::SpectralDescriptors::DYN_ATTRIBUTE | ( | 12 | , | |
public | , | |||
TData | , | |||
MaxMagFreq | ||||
) |
Frequency of the maximum magnitude of the spectrum normalized by the spectral range.
CLAM::SpectralDescriptors::DYN_ATTRIBUTE | ( | 13 | , | |
public | , | |||
TData | , | |||
LowFreqEnergyRelation | ||||
) |
The ratio between the energy over 0-100 Hz band and the whole spectrum energy.
To avoid singularities while keeping descriptor continuity, when the whole spectrum energy drops bellow $10^{-4}$, such value is considered as whole spectrum energy.
CLAM::SpectralDescriptors::DYN_ATTRIBUTE | ( | 14 | , | |
public | , | |||
TData | , | |||
Spread | ||||
) |
The spectral spread is the variation of the spectrum around its mean value.
It's computed from the second order moment.
CLAM::SpectralDescriptors::DYN_ATTRIBUTE | ( | 15 | , | |
public | , | |||
TData | , | |||
MagnitudeSkewness | ||||
) |
CLAM::SpectralDescriptors::DYN_ATTRIBUTE | ( | 16 | , | |
public | , | |||
TData | , | |||
Rolloff | ||||
) |
The spectral roll-off point is the frequency value so that the 85% of the spectral energy is contained below it.
For silences this is 0Hz. Measured in Hz.
CLAM::SpectralDescriptors::DYN_ATTRIBUTE | ( | 17 | , | |
public | , | |||
TData | , | |||
Slope | ||||
) |
The spectral slope represents the amount of decreasing of the spectral magnitude.
Measured in ??.
CLAM::SpectralDescriptors::DYN_ATTRIBUTE | ( | 18 | , | |
public | , | |||
TData | , | |||
HighFrequencyContent | ||||
) |
Sum of the squared spectrum magnitude multiplied by the wave number of the bin.
It could be considered the energy derivative, a high pass filter, which gives higher values for high frequency content.
CLAM::SpectralDescriptors::DYN_ATTRIBUTE | ( | 19 | , | |
public | , | |||
Array< SpectralDescriptors > | , | |||
BandDescriptors | ||||
) |
const Spectrum * CLAM::SpectralDescriptors::GetpSpectrum | ( | ) | const |
Definition at line 146 of file SpectralDescriptors.cxx.
void CLAM::SpectralDescriptors::SetpSpectrum | ( | Spectrum * | pSpectrum | ) |
Definition at line 151 of file SpectralDescriptors.cxx.
References CLAM_ASSERT, CLAM::EScale::eLinear, and CLAM::DescriptorTmpl< abs >::InitStats().
void CLAM::SpectralDescriptors::ConcreteCompute | ( | ) | [virtual] |
Implements CLAM::DescriptorTmpl< abs >.
Definition at line 165 of file SpectralDescriptors.cxx.
References CLAM_ASSERT, ComputeHighFrequencyContent(), ComputeLowFreqEnergyRelation(), ComputeMaxMagFreq(), ComputeRolloff(), ComputeSpectralFlatness(), CLAM::EScale::eLinear, CLAM::FifthOrder, CLAM::FourthOrder, CLAM::StatsTmpl< abs, T, U, initOrder >::GetCentroid(), CLAM::StatsTmpl< abs, T, U, initOrder >::GetEnergy(), CLAM::StatsTmpl< abs, T, U, initOrder >::GetGeometricMean(), CLAM::StatsTmpl< abs, T, U, initOrder >::GetKurtosis(), CLAM::StatsTmpl< abs, T, U, initOrder >::GetMean(), CLAM::StatsTmpl< abs, T, U, initOrder >::GetMoment(), CLAM::StatsTmpl< abs, T, U, initOrder >::GetSkew(), CLAM::StatsTmpl< abs, T, U, initOrder >::GetSlope(), CLAM::StatsTmpl< abs, T, U, initOrder >::GetSpread(), CLAM::DescriptorTmpl< abs >::mpStats, CLAM::SecondOrder, and CLAM::ThirdOrder.
void CLAM::SpectralDescriptors::DefaultInit | ( | void | ) |
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().
Reimplemented from CLAM::DynamicType.
Definition at line 134 of file SpectralDescriptors.cxx.
References CLAM::DescriptorTmpl< abs >::mpStats.
void CLAM::SpectralDescriptors::CopyInit | ( | const SpectralDescriptors & | copied | ) |
Definition at line 140 of file SpectralDescriptors.cxx.
References mpSpectrum, and CLAM::DescriptorTmpl< abs >::mpStats.
TData CLAM::SpectralDescriptors::ComputeSpectralFlatness | ( | ) |
Definition at line 213 of file SpectralDescriptors.cxx.
References CLAM::StatsTmpl< abs, T, U, initOrder >::GetFlatness(), and CLAM::DescriptorTmpl< abs >::mpStats.
Referenced by ConcreteCompute().
TData CLAM::SpectralDescriptors::ComputeHighFrequencyContent | ( | ) |
Definition at line 220 of file SpectralDescriptors.cxx.
References CLAM::Spectrum::GetSize().
Referenced by ConcreteCompute().
TData CLAM::SpectralDescriptors::ComputeMaxMagFreq | ( | ) |
It computes the frequency where the spectrum has its maximum value.
It there are more than one frequency with the same magnitude, it takes the lower one.
Definition at line 241 of file SpectralDescriptors.cxx.
References CLAM::DynamicType::data, and CLAM::Spectrum::GetSize().
Referenced by ConcreteCompute().
TData CLAM::SpectralDescriptors::ComputeLowFreqEnergyRelation | ( | ) |
Definition at line 262 of file SpectralDescriptors.cxx.
References CLAM::DynamicType::data, CLAM::StatsTmpl< abs, T, U, initOrder >::GetEnergy(), CLAM::DescriptorTmpl< abs >::mpStats, and Round().
Referenced by ConcreteCompute().
TData CLAM::SpectralDescriptors::ComputeRolloff | ( | ) |
Definition at line 277 of file SpectralDescriptors.cxx.
References CLAM::StatsTmpl< abs, T, U, initOrder >::GetEnergy(), CLAM::Spectrum::GetSize(), and CLAM::DescriptorTmpl< abs >::mpStats.
Referenced by ConcreteCompute().
TData CLAM::SpectralDescriptors::ComputeSpread | ( | ) |
TData CLAM::SpectralDescriptors::ComputeSlope | ( | ) |