Gist
|
#include <CoreFrequencyDomainFeatures.h>
Public Member Functions | |
CoreFrequencyDomainFeatures () | |
T | spectralCentroid (const std::vector< T > &magnitudeSpectrum) |
T | spectralFlatness (const std::vector< T > &magnitudeSpectrum) |
T | spectralCrest (const std::vector< T > &magnitudeSpectrum) |
T | spectralRolloff (const std::vector< T > &magnitudeSpectrum, T percentile=0.85) |
T | spectralKurtosis (const std::vector< T > &magnitudeSpectrum) |
template class for calculating common frequency domain audio features. Instantiations of the class should be of either 'float' or 'double' types and no others
CoreFrequencyDomainFeatures< T >::CoreFrequencyDomainFeatures |
constructor
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
magnitudeSpectrum | the first half of the magnitude spectrum (i.e. not mirrored) |
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.
magnitudeSpectrum | the first half of the magnitude spectrum (i.e. not mirrored) |
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.
magnitudeSpectrum | the first half of the magnitude spectrum (i.e. not mirrored) |
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.
magnitudeSpectrum | the first half of the magnitude spectrum (i.e. not mirrored) |
T CoreFrequencyDomainFeatures< T >::spectralRolloff | ( | const std::vector< T > & | magnitudeSpectrum, |
T | percentile = 0.85 |
||
) |
calculates the spectral rolloff given the first half of the magnitude spectrum of an audio signal.
magnitudeSpectrum | the first half of the magnitude spectrum (i.e. not mirrored) |
percentile | the rolloff threshold |