Possible Duplicate:
C programming division
I am trying to convert values into the Mel Filter but, every time I output the result, it is always "0" even though it is a double. Should it be a float? Here is an article on the equation: http://en.wikipedia.org/wiki/Mel_scale
Here is the functions:
double MFCC::mel_filter(int val)
{
double tmp;
tmp = 2595 * log10(1 + val / 700);
cout << tmp << endl;
return tmp;
}
vector<double> MFCC::mel_frame(int size)
{
vector<double> mel_Frame;
for(int i=1; (i < size); i++)
{
this->mel_filter(i);
}
return mel_Frame;
}
In main, I will pass values such as.. (1, 2, 3, 4, 5, 6, 7 ......)
And if "1" was entered then the equation would be:
m = 2595 * log10(1 + 1 / 700) = 1.6
Any help or suggestions?