CLAM::SpectralDescriptors Class Reference

#include <SpectralDescriptors.hxx>

List of all members.

Public Member Functions

 SpectralDescriptors ()
 SpectralDescriptors (const SpectralDescriptors &prototype, const bool shareData=false, const bool deep=true)
 __COMMON_DYNAMIC_TYPE (SpectralDescriptors, 21)
 __COMMON_DYN_ATTRIBUTE (0, public, TData, Mean) protected
 The spectral power mean value.
bool LoadMean (CLAM::Storage &s)
 __COMMON_DYN_ATTRIBUTE (1, public, TData, GeometricMean) protected
 The geometric mean for the spectral power values sequence.
bool LoadGeometricMean (CLAM::Storage &s)
 __COMMON_DYN_ATTRIBUTE (2, public, TData, Energy) protected
 The squared sum of spectral power distribution values.
bool LoadEnergy (CLAM::Storage &s)
 __COMMON_DYN_ATTRIBUTE (3, public, TData, Centroid) protected
 The frequency where the center of mass of the spectral power distribution lies.
bool LoadCentroid (CLAM::Storage &s)
 __COMMON_DYN_ATTRIBUTE (4, public, TData, Moment2) protected
bool LoadMoment2 (CLAM::Storage &s)
 __COMMON_DYN_ATTRIBUTE (5, public, TData, Moment3) protected
bool LoadMoment3 (CLAM::Storage &s)
 __COMMON_DYN_ATTRIBUTE (6, public, TData, Moment4) protected
bool LoadMoment4 (CLAM::Storage &s)
 __COMMON_DYN_ATTRIBUTE (7, public, TData, Moment5) protected
bool LoadMoment5 (CLAM::Storage &s)
 __COMMON_DYN_ATTRIBUTE (8, public, TData, Moment6) protected
bool LoadMoment6 (CLAM::Storage &s)
 __COMMON_DYN_ATTRIBUTE (9, public, TData, Flatness) protected
bool LoadFlatness (CLAM::Storage &s)
 __COMMON_DYN_ATTRIBUTE (10, public, TData, MagnitudeKurtosis) protected
bool LoadMagnitudeKurtosis (CLAM::Storage &s)
 __COMMON_DYN_ATTRIBUTE (11, public, Array< TData >, MFCC) protected
bool LoadMFCC (CLAM::Storage &s)
 __COMMON_DYN_ATTRIBUTE (12, public, TData, MaxMagFreq) protected
 Frequency of the maximum magnitude of the spectrum normalized by the spectral range.
bool LoadMaxMagFreq (CLAM::Storage &s)
 __COMMON_DYN_ATTRIBUTE (13, public, TData, LowFreqEnergyRelation) protected
 The ratio between the energy over 0-100 Hz band and the whole spectrum energy.
bool LoadLowFreqEnergyRelation (CLAM::Storage &s)
 __COMMON_DYN_ATTRIBUTE (14, public, TData, Spread) protected
 The spectral spread is the variation of the spectrum around its mean value.
bool LoadSpread (CLAM::Storage &s)
 __COMMON_DYN_ATTRIBUTE (15, public, TData, MagnitudeSkewness) protected
bool LoadMagnitudeSkewness (CLAM::Storage &s)
 __COMMON_DYN_ATTRIBUTE (16, public, TData, Rolloff) protected
 The spectral roll-off point is the frequency value so that the 85% of the spectral energy is contained below it.
bool LoadRolloff (CLAM::Storage &s)
 __COMMON_DYN_ATTRIBUTE (17, public, TData, Slope) protected
 The spectral slope represents the amount of decreasing of the spectral magnitude.
bool LoadSlope (CLAM::Storage &s)
 __COMMON_DYN_ATTRIBUTE (18, public, TData, HighFrequencyContent) protected
 Sum of the squared spectrum magnitude multiplied by the wave number of the bin.
bool LoadHighFrequencyContent (CLAM::Storage &s)
 __COMMON_DYN_ATTRIBUTE (19, public, Array< SpectralDescriptors >, BandDescriptors) protected
bool LoadBandDescriptors (CLAM::Storage &s)
 __COMMON_DYN_ATTRIBUTE (20, public, Array< TData >, PCP) protected
bool LoadPCP (CLAM::Storage &s)
 SpectralDescriptors (Spectrum *pSpectrum)
 SpectralDescriptors (TData initVal)
const SpectrumGetpSpectrum () 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 ()

Detailed Description

Definition at line 38 of file SpectralDescriptors.hxx.


Constructor & Destructor Documentation

CLAM::SpectralDescriptors::SpectralDescriptors (  )  [inline]

Definition at line 40 of file SpectralDescriptors.hxx.

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

Definition at line 40 of file SpectralDescriptors.hxx.

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  ) 

Definition at line 109 of file SpectralDescriptors.cxx.

References CLAM::DynamicType::UpdateData().


Member Function Documentation

CLAM::SpectralDescriptors::__COMMON_DYN_ATTRIBUTE ( 20  ,
public  ,
Array< TData ,
PCP   
) [inline]

Definition at line 134 of file SpectralDescriptors.hxx.

CLAM::SpectralDescriptors::__COMMON_DYN_ATTRIBUTE ( 19  ,
public  ,
Array< SpectralDescriptors ,
BandDescriptors   
) [inline]

Definition at line 132 of file SpectralDescriptors.hxx.

CLAM::SpectralDescriptors::__COMMON_DYN_ATTRIBUTE ( 18  ,
public  ,
TData  ,
HighFrequencyContent   
) [inline]

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.

\[ HighFrequencyContent = \sum_{i=0}^{nBins} i magnitude_i^2 \]

Definition at line 131 of file SpectralDescriptors.hxx.

CLAM::SpectralDescriptors::__COMMON_DYN_ATTRIBUTE ( 17  ,
public  ,
TData  ,
Slope   
) [inline]

The spectral slope represents the amount of decreasing of the spectral magnitude.

Measured in ??.

See also:
Stats::Slope

Definition at line 121 of file SpectralDescriptors.hxx.

CLAM::SpectralDescriptors::__COMMON_DYN_ATTRIBUTE ( 16  ,
public  ,
TData  ,
Rolloff   
) [inline]

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.

\[ Rolloff / \sum_{f=0}^{RollOff} {a_f^2} = 0.85 \times \sum_{f=0}^{SpectralRange} {a_f^2} \]

Definition at line 115 of file SpectralDescriptors.hxx.

CLAM::SpectralDescriptors::__COMMON_DYN_ATTRIBUTE ( 15  ,
public  ,
TData  ,
MagnitudeSkewness   
) [inline]

Definition at line 105 of file SpectralDescriptors.hxx.

CLAM::SpectralDescriptors::__COMMON_DYN_ATTRIBUTE ( 14  ,
public  ,
TData  ,
Spread   
) [inline]

The spectral spread is the variation of the spectrum around its mean value.

It's computed from the second order moment.

Definition at line 104 of file SpectralDescriptors.hxx.

CLAM::SpectralDescriptors::__COMMON_DYN_ATTRIBUTE ( 13  ,
public  ,
TData  ,
LowFreqEnergyRelation   
) [inline]

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.

Definition at line 98 of file SpectralDescriptors.hxx.

CLAM::SpectralDescriptors::__COMMON_DYN_ATTRIBUTE ( 12  ,
public  ,
TData  ,
MaxMagFreq   
) [inline]

Frequency of the maximum magnitude of the spectrum normalized by the spectral range.

Definition at line 91 of file SpectralDescriptors.hxx.

CLAM::SpectralDescriptors::__COMMON_DYN_ATTRIBUTE ( 11  ,
public  ,
Array< TData ,
MFCC   
) [inline]

Definition at line 86 of file SpectralDescriptors.hxx.

CLAM::SpectralDescriptors::__COMMON_DYN_ATTRIBUTE ( 10  ,
public  ,
TData  ,
MagnitudeKurtosis   
) [inline]

Definition at line 85 of file SpectralDescriptors.hxx.

CLAM::SpectralDescriptors::__COMMON_DYN_ATTRIBUTE ( ,
public  ,
TData  ,
Flatness   
) [inline]

Definition at line 84 of file SpectralDescriptors.hxx.

CLAM::SpectralDescriptors::__COMMON_DYN_ATTRIBUTE ( ,
public  ,
TData  ,
Moment6   
) [inline]

Definition at line 83 of file SpectralDescriptors.hxx.

CLAM::SpectralDescriptors::__COMMON_DYN_ATTRIBUTE ( ,
public  ,
TData  ,
Moment5   
) [inline]

Definition at line 82 of file SpectralDescriptors.hxx.

CLAM::SpectralDescriptors::__COMMON_DYN_ATTRIBUTE ( ,
public  ,
TData  ,
Moment4   
) [inline]

Definition at line 81 of file SpectralDescriptors.hxx.

CLAM::SpectralDescriptors::__COMMON_DYN_ATTRIBUTE ( ,
public  ,
TData  ,
Moment3   
) [inline]

Definition at line 80 of file SpectralDescriptors.hxx.

CLAM::SpectralDescriptors::__COMMON_DYN_ATTRIBUTE ( ,
public  ,
TData  ,
Moment2   
) [inline]

Definition at line 79 of file SpectralDescriptors.hxx.

CLAM::SpectralDescriptors::__COMMON_DYN_ATTRIBUTE ( ,
public  ,
TData  ,
Centroid   
) [inline]

The frequency where the center of mass of the spectral power distribution lies.

This measure is expressed in Hz.

See also:
Stats::GetCentroid

Definition at line 78 of file SpectralDescriptors.hxx.

CLAM::SpectralDescriptors::__COMMON_DYN_ATTRIBUTE ( ,
public  ,
TData  ,
Energy   
) [inline]

The squared sum of spectral power distribution values.

This measure comes in the same units as the distribution values.

See also:
Stats::GetEnergy

Definition at line 70 of file SpectralDescriptors.hxx.

CLAM::SpectralDescriptors::__COMMON_DYN_ATTRIBUTE ( ,
public  ,
TData  ,
GeometricMean   
) [inline]

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.

See also:
Stats::GetGeometricMean

Definition at line 63 of file SpectralDescriptors.hxx.

CLAM::SpectralDescriptors::__COMMON_DYN_ATTRIBUTE ( ,
public  ,
TData  ,
Mean   
) [inline]

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.

See also:
Spectrum::SetScale
EScale
Stats::GetMean

Definition at line 50 of file SpectralDescriptors.hxx.

CLAM::SpectralDescriptors::__COMMON_DYNAMIC_TYPE ( SpectralDescriptors  ,
21   
)
TData CLAM::SpectralDescriptors::ComputeHighFrequencyContent (  ) 

Definition at line 220 of file SpectralDescriptors.cxx.

References CLAM::Spectrum::GetSize().

Referenced by ConcreteCompute().

TData CLAM::SpectralDescriptors::ComputeLowFreqEnergyRelation (  ) 
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.

Todo:
Promote MaxPosition to Stats

Definition at line 241 of file SpectralDescriptors.cxx.

References CLAM::DynamicType::data, and CLAM::Spectrum::GetSize().

Referenced by ConcreteCompute().

TData CLAM::SpectralDescriptors::ComputeRolloff (  ) 
TData CLAM::SpectralDescriptors::ComputeSlope (  ) 
TData CLAM::SpectralDescriptors::ComputeSpectralFlatness (  ) 
TData CLAM::SpectralDescriptors::ComputeSpread (  ) 
void CLAM::SpectralDescriptors::ConcreteCompute (  )  [virtual]
void CLAM::SpectralDescriptors::CopyInit ( const SpectralDescriptors copied  ) 

Definition at line 140 of file SpectralDescriptors.cxx.

References CLAM::DescriptorTmpl< abs >::mpStats.

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().

See also:
CopyInit()

Reimplemented from CLAM::DynamicType.

Definition at line 134 of file SpectralDescriptors.cxx.

References CLAM::DescriptorTmpl< abs >::mpStats.

const Spectrum * CLAM::SpectralDescriptors::GetpSpectrum (  )  const

Definition at line 146 of file SpectralDescriptors.cxx.

bool CLAM::SpectralDescriptors::LoadBandDescriptors ( CLAM::Storage s  )  [inline]

Definition at line 132 of file SpectralDescriptors.hxx.

bool CLAM::SpectralDescriptors::LoadCentroid ( CLAM::Storage s  )  [inline]

Definition at line 78 of file SpectralDescriptors.hxx.

bool CLAM::SpectralDescriptors::LoadEnergy ( CLAM::Storage s  )  [inline]

Definition at line 70 of file SpectralDescriptors.hxx.

bool CLAM::SpectralDescriptors::LoadFlatness ( CLAM::Storage s  )  [inline]

Definition at line 84 of file SpectralDescriptors.hxx.

bool CLAM::SpectralDescriptors::LoadGeometricMean ( CLAM::Storage s  )  [inline]

Definition at line 63 of file SpectralDescriptors.hxx.

bool CLAM::SpectralDescriptors::LoadHighFrequencyContent ( CLAM::Storage s  )  [inline]

Definition at line 131 of file SpectralDescriptors.hxx.

bool CLAM::SpectralDescriptors::LoadLowFreqEnergyRelation ( CLAM::Storage s  )  [inline]

Definition at line 98 of file SpectralDescriptors.hxx.

bool CLAM::SpectralDescriptors::LoadMagnitudeKurtosis ( CLAM::Storage s  )  [inline]

Definition at line 85 of file SpectralDescriptors.hxx.

bool CLAM::SpectralDescriptors::LoadMagnitudeSkewness ( CLAM::Storage s  )  [inline]

Definition at line 105 of file SpectralDescriptors.hxx.

bool CLAM::SpectralDescriptors::LoadMaxMagFreq ( CLAM::Storage s  )  [inline]

Definition at line 91 of file SpectralDescriptors.hxx.

bool CLAM::SpectralDescriptors::LoadMean ( CLAM::Storage s  )  [inline]

Definition at line 50 of file SpectralDescriptors.hxx.

bool CLAM::SpectralDescriptors::LoadMFCC ( CLAM::Storage s  )  [inline]

Definition at line 86 of file SpectralDescriptors.hxx.

bool CLAM::SpectralDescriptors::LoadMoment2 ( CLAM::Storage s  )  [inline]

Definition at line 79 of file SpectralDescriptors.hxx.

bool CLAM::SpectralDescriptors::LoadMoment3 ( CLAM::Storage s  )  [inline]

Definition at line 80 of file SpectralDescriptors.hxx.

bool CLAM::SpectralDescriptors::LoadMoment4 ( CLAM::Storage s  )  [inline]

Definition at line 81 of file SpectralDescriptors.hxx.

bool CLAM::SpectralDescriptors::LoadMoment5 ( CLAM::Storage s  )  [inline]

Definition at line 82 of file SpectralDescriptors.hxx.

bool CLAM::SpectralDescriptors::LoadMoment6 ( CLAM::Storage s  )  [inline]

Definition at line 83 of file SpectralDescriptors.hxx.

bool CLAM::SpectralDescriptors::LoadPCP ( CLAM::Storage s  )  [inline]

Definition at line 134 of file SpectralDescriptors.hxx.

bool CLAM::SpectralDescriptors::LoadRolloff ( CLAM::Storage s  )  [inline]

Definition at line 115 of file SpectralDescriptors.hxx.

bool CLAM::SpectralDescriptors::LoadSlope ( CLAM::Storage s  )  [inline]

Definition at line 121 of file SpectralDescriptors.hxx.

bool CLAM::SpectralDescriptors::LoadSpread ( CLAM::Storage s  )  [inline]

Definition at line 104 of file SpectralDescriptors.hxx.

void CLAM::SpectralDescriptors::SetpSpectrum ( Spectrum pSpectrum  ) 

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