libmfcc.c
double GetCoefficient(double* spectralData, unsigned int samplingRate, unsigned int NumFilters, unsigned int binSize, unsigned int m)
{
	double result = 0.0f;
	double outerSum = 0.0f;
	double innerSum = 0.0f;
	unsigned int k, l;

	// 0 <= m < L
	if(m >= NumFilters)
	{
		// This represents an error condition - the specified coefficient is greater than or equal to the number of filters. The behavior in this case is undefined.
		return 0.0f;
	}

	result = NormalizationFactor(NumFilters, m);

	
	for(l = 1; l <= NumFilters; l++)
	{
		// Compute inner sum
		innerSum = 0.0f;
		for(k = 0; k < binSize - 1; k++)
		{
			innerSum += fabs(spectralData[k] * GetFilterParameter(samplingRate, binSize, k, l));
		}

		if(innerSum > 0.0f)
		{
			innerSum = log(innerSum); // The log of 0 is undefined, so don't use it
		}

		innerSum = innerSum * cos(((m * PI) / NumFilters) * (l - 0.5f));

		outerSum += innerSum;
	}

	result *= outerSum;

	return result;
}
/* 
 * Computes the specified (mth) MFCC
 *
 * spectralData - array of doubles containing the results of FFT computation. This data is already assumed to be purely real
 * samplingRate - the rate that the original time-series data was sampled at (i.e 44100)
 * NumFilters - the number of filters to use in the computation. Recommended value = 48
 * binSize - the size of the spectralData array, usually a power of 2
 * m - The mth MFCC coefficient to compute
 *
 */
Computes the specified (mth) MFCC

array of doubles containing the results of FFT computation. This data is already assumed to be purely real
samplingRate - the rate that the original time-series data was sampled at
NumFilters - the number of filters to use in the computation. Recommended value = 48
binSize - the size of the spectralData array, usually a power of 2
m - The mth MFCC coefficient to compute
Computes the specified ( mth ) MFCC array of doubles containing the results of FFT computation . This data is already assumed to be purely real samplingRate - the rate that the original time - series data was sampled at NumFilters - the number of filters to use in the computation . Recommended value = 48 binSize - the size of the spectralData array usually a power of 2 m - The mth MFCC coefficient to compute
double GetCoefficient(double* spectralData, unsigned int samplingRate, unsigned int NumFilters, unsigned int binSize, unsigned int m)
{
	double result = 0.0f;
	double outerSum = 0.0f;
	double innerSum = 0.0f;
	unsigned int k, l;
	if(m >= NumFilters)
	{
		return 0.0f;
	}
	result = NormalizationFactor(NumFilters, m);
	for(l = 1; l <= NumFilters; l++)
	{
		innerSum = 0.0f;
		for(k = 0; k < binSize - 1; k++)
		{
			innerSum += fabs(spectralData[k] * GetFilterParameter(samplingRate, binSize, k, l));
		}
		if(innerSum > 0.0f)
		{
			innerSum = log(innerSum); 
		}
		innerSum = innerSum * cos(((m * PI) / NumFilters) * (l - 0.5f));
		outerSum += innerSum;
	}
	result *= outerSum;
	return result;
}
double GetCoefficient ( double * spectralData , unsigned int samplingRate , unsigned int NumFilters , unsigned int binSize , unsigned int m ) { double result = 0.0f ; double outerSum = 0.0f ; double innerSum = 0.0f ; unsigned int k , l ; if ( m >= NumFilters ) { return 0.0f ; } result = NormalizationFactor ( NumFilters , m ) ; for ( l = 1 ; l <= NumFilters ; l ++ ) { innerSum = 0.0f ; for ( k = 0 ; k < binSize - 1 ; k ++ ) { innerSum += fabs ( spectralData [ k ] * GetFilterParameter ( samplingRate , binSize , k , l ) ) ; } if ( innerSum > 0.0f ) { innerSum = log ( innerSum ) ; } innerSum = innerSum * cos ( ( ( m * PI ) / NumFilters ) * ( l - 0.5f ) ) ; outerSum += innerSum ; } result *= outerSum ; return result ; }
Computes the specified (mth) MFCC
Computes the specified ( mth ) MFCC
// 0 <= m < L
 // This represents an error condition - the specified coefficient is greater than or equal to the number of filters. The behavior in this case is undefined.
 // Compute inner sum
 // The log of 0 is undefined, so don't use it
