libmfcc.c
double GetFilterParameter(unsigned int samplingRate, unsigned int binSize, unsigned int frequencyBand, unsigned int filterBand)
{
	double filterParameter = 0.0f;

	double boundary = (frequencyBand * samplingRate) / binSize;		// k * Fs / N
	double prevCenterFrequency = GetCenterFrequency(filterBand - 1);		// fc(l - 1) etc.
	double thisCenterFrequency = GetCenterFrequency(filterBand);
	double nextCenterFrequency = GetCenterFrequency(filterBand + 1);

	if(boundary >= 0 && boundary < prevCenterFrequency)
	{
		filterParameter = 0.0f;
	}
	else if(boundary >= prevCenterFrequency && boundary < thisCenterFrequency)
	{
		filterParameter = (boundary - prevCenterFrequency) / (thisCenterFrequency - prevCenterFrequency);
		filterParameter *= GetMagnitudeFactor(filterBand);
	}
	else if(boundary >= thisCenterFrequency && boundary < nextCenterFrequency)
	{
		filterParameter = (boundary - nextCenterFrequency) / (thisCenterFrequency - nextCenterFrequency);
		filterParameter *= GetMagnitudeFactor(filterBand);
	}
	else if(boundary >= nextCenterFrequency && boundary < samplingRate)
	{
		filterParameter = 0.0f;
	}

	return filterParameter;
}
/* 
 * Compute the filter parameter for the specified frequency and filter bands (Eq. 2)
 * Used for internal computation only - not the be called directly
 */
Compute the filter parameter for the specified frequency and filter bands (Eq. 2)
Used for internal computation only - not the be called directly
Compute the filter parameter for the specified frequency and filter bands ( Eq . 2 ) Used for internal computation only - not the be called directly
double GetFilterParameter(unsigned int samplingRate, unsigned int binSize, unsigned int frequencyBand, unsigned int filterBand)
{
	double filterParameter = 0.0f;
	double boundary = (frequencyBand * samplingRate) / binSize;		
	double prevCenterFrequency = GetCenterFrequency(filterBand - 1);		
	double thisCenterFrequency = GetCenterFrequency(filterBand);
	double nextCenterFrequency = GetCenterFrequency(filterBand + 1);
	if(boundary >= 0 && boundary < prevCenterFrequency)
	{
		filterParameter = 0.0f;
	}
	else if(boundary >= prevCenterFrequency && boundary < thisCenterFrequency)
	{
		filterParameter = (boundary - prevCenterFrequency) / (thisCenterFrequency - prevCenterFrequency);
		filterParameter *= GetMagnitudeFactor(filterBand);
	}
	else if(boundary >= thisCenterFrequency && boundary < nextCenterFrequency)
	{
		filterParameter = (boundary - nextCenterFrequency) / (thisCenterFrequency - nextCenterFrequency);
		filterParameter *= GetMagnitudeFactor(filterBand);
	}
	else if(boundary >= nextCenterFrequency && boundary < samplingRate)
	{
		filterParameter = 0.0f;
	}
	return filterParameter;
}
double GetFilterParameter ( unsigned int samplingRate , unsigned int binSize , unsigned int frequencyBand , unsigned int filterBand ) { double filterParameter = 0.0f ; double boundary = ( frequencyBand * samplingRate ) / binSize ; double prevCenterFrequency = GetCenterFrequency ( filterBand - 1 ) ; double thisCenterFrequency = GetCenterFrequency ( filterBand ) ; double nextCenterFrequency = GetCenterFrequency ( filterBand + 1 ) ; if ( boundary >= 0 && boundary < prevCenterFrequency ) { filterParameter = 0.0f ; } else if ( boundary >= prevCenterFrequency && boundary < thisCenterFrequency ) { filterParameter = ( boundary - prevCenterFrequency ) / ( thisCenterFrequency - prevCenterFrequency ) ; filterParameter *= GetMagnitudeFactor ( filterBand ) ; } else if ( boundary >= thisCenterFrequency && boundary < nextCenterFrequency ) { filterParameter = ( boundary - nextCenterFrequency ) / ( thisCenterFrequency - nextCenterFrequency ) ; filterParameter *= GetMagnitudeFactor ( filterBand ) ; } else if ( boundary >= nextCenterFrequency && boundary < samplingRate ) { filterParameter = 0.0f ; } return filterParameter ; }
Compute the filter parameter for the specified frequency and filter bands (Eq.
Compute the filter parameter for the specified frequency and filter bands ( Eq .
// k * Fs / N
 // fc(l - 1) etc.
