Krotos Modules 3
Loading...
Searching...
No Matches
krotos::FrequencyDomainAnalysisFramework Class Reference

#include <FrequencyDomainAnalysisFramework.h>

Public Member Functions

 FrequencyDomainAnalysisFramework (int analysisFrameSize, int sampleRate)
 
void setSamplingFrequency (int fs)
 
void setNumberOfMelFrequencyCoefficients (int numCoeffs)
 
void setNumberOfMelFrequencyCepstralCoefficients (int numCoeffs)
 
void setFrequencyVector (const std::vector< float > &freqVector)
 
int getSamplingFrequency ()
 
int getNumberOfMelFrequencyCepstralCoefficients ()
 
void setSpectralFrame (std::vector< float > spectralFrame)
 
float getFreqOfLoudestPartial ()
 
std::vector< float > getMelSpectrum ()
 
std::vector< float > getMFCC ()
 
float getSpectralCentroid ()
 
float getSpectralFlatness ()
 
float getSpectralRolloff ()
 
float getSpectralSpread ()
 
float getSpectralSlope ()
 
float getSpectralFlux ()
 
float getSpectralKurtosis ()
 
float getFrameEnergy ()
 
float getHighFreqencyContentOnsetDectionFunction ()
 
float getComplexSpectralDifference ()
 

Private Member Functions

void initialiseSpectralAnalysisAlgorithms ()
 
float calculateSpectralMoment (int n)
 

Private Attributes

int m_samplingFrequency {-1}
 
std::vector< float > m_spectralFrame
 
int m_spectralFrameSize {-1}
 
std::vector< float > m_freqVector
 
std::vector< float > m_prevMagSpecSpectralFlux
 
std::vector< float > m_prevMagSpecCSD
 
std::vector< float > m_prevPhase1CSD
 
std::vector< float > m_prevPhase2CSD
 
MelFrequencySpectrum m_melFrequencySpectrum
 
DiscreteCosineTransform m_dct
 
int m_numMelCoefficients
 
int m_numMelCepstralCoefficients
 
std::vector< float > m_windowing
 

Constructor & Destructor Documentation

◆ FrequencyDomainAnalysisFramework()

krotos::FrequencyDomainAnalysisFramework::FrequencyDomainAnalysisFramework ( int analysisFrameSize,
int sampleRate )

Constructor. Initialises the audio analysis framework

Parameters
inputFrameIncrementthe distance moved between analysed frames
analysisBufferSizethe audio analysis buffer size
fsthe sampling frequency

Copyright Krotos LTD 2015

All rights reserved.

Member Function Documentation

◆ calculateSpectralMoment()

float krotos::FrequencyDomainAnalysisFramework::calculateSpectralMoment ( int n)
private

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ NEED COMPLEX FFT HERE ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

◆ getComplexSpectralDifference()

float krotos::FrequencyDomainAnalysisFramework::getComplexSpectralDifference ( )

@Returns the complex spectral difference onset detection function

◆ getFrameEnergy()

float krotos::FrequencyDomainAnalysisFramework::getFrameEnergy ( )

@Returns the frame energy of the frame

◆ getFreqOfLoudestPartial()

float krotos::FrequencyDomainAnalysisFramework::getFreqOfLoudestPartial ( )

@Returns the frequency in Hz of the largest magnitude FFT bin

◆ getHighFreqencyContentOnsetDectionFunction()

float krotos::FrequencyDomainAnalysisFramework::getHighFreqencyContentOnsetDectionFunction ( )

@Returns the high frequency content onset detection function

◆ getMelSpectrum()

std::vector< float > krotos::FrequencyDomainAnalysisFramework::getMelSpectrum ( )

@Returns the mel spectrum as a vector

◆ getMFCC()

std::vector< float > krotos::FrequencyDomainAnalysisFramework::getMFCC ( )

@Returns the mel-frequency cepstral coefficients as a vector

◆ getNumberOfMelFrequencyCepstralCoefficients()

int krotos::FrequencyDomainAnalysisFramework::getNumberOfMelFrequencyCepstralCoefficients ( )

Sets the number of Mel-frequency Cepstral Coefficients to be calculated

◆ getSamplingFrequency()

int krotos::FrequencyDomainAnalysisFramework::getSamplingFrequency ( )

@Returns the sampling frequency

◆ getSpectralCentroid()

float krotos::FrequencyDomainAnalysisFramework::getSpectralCentroid ( )

@Returns the spectral centroid

◆ getSpectralFlatness()

float krotos::FrequencyDomainAnalysisFramework::getSpectralFlatness ( )

@Returns the spectral flatness

◆ getSpectralFlux()

float krotos::FrequencyDomainAnalysisFramework::getSpectralFlux ( )

@Returns the spectral flux of the signal

◆ getSpectralKurtosis()

float krotos::FrequencyDomainAnalysisFramework::getSpectralKurtosis ( )

@Returns the spectral kurtosis of the signal

◆ getSpectralRolloff()

float krotos::FrequencyDomainAnalysisFramework::getSpectralRolloff ( )

@Returns the spectral rolloff

◆ getSpectralSlope()

float krotos::FrequencyDomainAnalysisFramework::getSpectralSlope ( )

@Returns the spectral slope

◆ getSpectralSpread()

float krotos::FrequencyDomainAnalysisFramework::getSpectralSpread ( )

@Returns the spectral spread

◆ initialiseSpectralAnalysisAlgorithms()

void krotos::FrequencyDomainAnalysisFramework::initialiseSpectralAnalysisAlgorithms ( )
private

Sets spectral frame and the spectral frame Size

◆ setFrequencyVector()

void krotos::FrequencyDomainAnalysisFramework::setFrequencyVector ( const std::vector< float > & freqVector)

Sets the frequencyVector to calculate spectral features on.

◆ setNumberOfMelFrequencyCepstralCoefficients()

void krotos::FrequencyDomainAnalysisFramework::setNumberOfMelFrequencyCepstralCoefficients ( int numCoeffs)

Sets the number of Mel-frequency Cepstral Coefficients to be calculated

◆ setNumberOfMelFrequencyCoefficients()

void krotos::FrequencyDomainAnalysisFramework::setNumberOfMelFrequencyCoefficients ( int numCoeffs)

Sets the number of Mel-frequency Coefficients to be used for the Mel-frequency Spectrum

◆ setSamplingFrequency()

void krotos::FrequencyDomainAnalysisFramework::setSamplingFrequency ( int fs)

Sets the sampling frequency to be used for audio analysis

Parameters
fsthe sampling frequency to be used

◆ setSpectralFrame()

void krotos::FrequencyDomainAnalysisFramework::setSpectralFrame ( std::vector< float > spectralFrame)

Receives a spectral frame to perform some analysis calculations and analysis features upon.

Member Data Documentation

◆ m_dct

DiscreteCosineTransform krotos::FrequencyDomainAnalysisFramework::m_dct
private

◆ m_freqVector

std::vector<float> krotos::FrequencyDomainAnalysisFramework::m_freqVector
private

◆ m_melFrequencySpectrum

MelFrequencySpectrum krotos::FrequencyDomainAnalysisFramework::m_melFrequencySpectrum
private

◆ m_numMelCepstralCoefficients

int krotos::FrequencyDomainAnalysisFramework::m_numMelCepstralCoefficients
private

◆ m_numMelCoefficients

int krotos::FrequencyDomainAnalysisFramework::m_numMelCoefficients
private

◆ m_prevMagSpecCSD

std::vector<float> krotos::FrequencyDomainAnalysisFramework::m_prevMagSpecCSD
private

◆ m_prevMagSpecSpectralFlux

std::vector<float> krotos::FrequencyDomainAnalysisFramework::m_prevMagSpecSpectralFlux
private

◆ m_prevPhase1CSD

std::vector<float> krotos::FrequencyDomainAnalysisFramework::m_prevPhase1CSD
private

◆ m_prevPhase2CSD

std::vector<float> krotos::FrequencyDomainAnalysisFramework::m_prevPhase2CSD
private

◆ m_samplingFrequency

int krotos::FrequencyDomainAnalysisFramework::m_samplingFrequency {-1}
private

◆ m_spectralFrame

std::vector<float> krotos::FrequencyDomainAnalysisFramework::m_spectralFrame
private

◆ m_spectralFrameSize

int krotos::FrequencyDomainAnalysisFramework::m_spectralFrameSize {-1}
private

◆ m_windowing

std::vector<float> krotos::FrequencyDomainAnalysisFramework::m_windowing
private

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