Gist
Public Member Functions | List of all members
CoreFrequencyDomainFeatures< T > Class Template Reference

#include <CoreFrequencyDomainFeatures.h>

Public Member Functions

 CoreFrequencyDomainFeatures ()
 
spectralCentroid (const std::vector< T > &magnitudeSpectrum)
 
spectralFlatness (const std::vector< T > &magnitudeSpectrum)
 
spectralCrest (const std::vector< T > &magnitudeSpectrum)
 
spectralRolloff (const std::vector< T > &magnitudeSpectrum, T percentile=0.85)
 
spectralKurtosis (const std::vector< T > &magnitudeSpectrum)
 

Detailed Description

template<class T>
class CoreFrequencyDomainFeatures< T >

template class for calculating common frequency domain audio features. Instantiations of the class should be of either 'float' or 'double' types and no others

Constructor & Destructor Documentation

◆ CoreFrequencyDomainFeatures()

constructor

Member Function Documentation

◆ spectralCentroid()

template<class T >
T CoreFrequencyDomainFeatures< T >::spectralCentroid ( const std::vector< T > &  magnitudeSpectrum)

calculates the spectral centroid given the first half of the magnitude spectrum of an audio signal. Do not pass the whole (i.e. mirrored) magnitude spectrum into this function or you will always get the middle index as the spectral centroid

Parameters
magnitudeSpectrumthe first half of the magnitude spectrum (i.e. not mirrored)
Returns
the spectral centroid as an index value

◆ spectralCrest()

template<class T >
T CoreFrequencyDomainFeatures< T >::spectralCrest ( const std::vector< T > &  magnitudeSpectrum)

calculates the spectral crest given the first half of the magnitude spectrum of an audio signal.

Parameters
magnitudeSpectrumthe first half of the magnitude spectrum (i.e. not mirrored)
Returns
the spectral crest

◆ spectralFlatness()

template<class T >
T CoreFrequencyDomainFeatures< T >::spectralFlatness ( const std::vector< T > &  magnitudeSpectrum)

calculates the spectral flatness given the first half of the magnitude spectrum of an audio signal.

Parameters
magnitudeSpectrumthe first half of the magnitude spectrum (i.e. not mirrored)
Returns
the spectral flatness

◆ spectralKurtosis()

template<class T >
T CoreFrequencyDomainFeatures< T >::spectralKurtosis ( const std::vector< T > &  magnitudeSpectrum)

calculates the spectral kurtosis given the first half of the magnitude spectrum of an audio signal.

Parameters
magnitudeSpectrumthe first half of the magnitude spectrum (i.e. not mirrored)
Returns
the spectral kurtosis

◆ spectralRolloff()

template<class T >
T CoreFrequencyDomainFeatures< T >::spectralRolloff ( const std::vector< T > &  magnitudeSpectrum,
percentile = 0.85 
)

calculates the spectral rolloff given the first half of the magnitude spectrum of an audio signal.

Parameters
magnitudeSpectrumthe first half of the magnitude spectrum (i.e. not mirrored)
percentilethe rolloff threshold
Returns
the spectral rolloff

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