# can MFCC coefficients alone be used to do voice detection?

Aim of my project is to differentiate between cases of silence, single active speaker and multiple ( simultaneous ) active speakers using as basic ( but effective ) logic as possible. Is it possible to achieve this without use of extensive machine learning algorithms ??

Actually, i don't need to do speaker "identification". An audio stream will be taken as an input and I have to just say whether that audio consists of a single speaker, multiple speakers or silence... I have to implement this in C (real time), hence machine learning (unsupervised) would increase the computational complexity.

In essence, yes.

You would have to use something like Dynamic time warping to measure the similarities between two given signals, as long as they vary in time or speed.

From what I can remember, you can use DTW for speaking identification. BUT it is important to note that for single word recognition and single speaker identification this method would work but would not be suitable for commercial or large scale applications.

The DTW algorithm calculates the distances from the two signals, based on the Euclidean distances.. Whilst studying for my undergraduate degree, I did a simple word recognition system (In C++) and the machine learning algorithms (for instance, Hidden Markov Models) provided a much higher success rate than DTW.

Feel free to take a look at some of the code that I wrote for this project. Here

double Euclidean_distance(const vector<double> &actual, const vector<double> &training) {

double distance = 0.0;

for(unsigned i=0; (i < actual.size()); i++)
{
distance = pow((actual[i] - training[i]), 2);
}

return sqrt(distance);
}

double Distance(const std::vector< std::vector<double> > &actual, const std::vector< std::vector<double> > &training)
{
int m = actual.size();
int n = training.size();

double cost[m][n];

cost[0][0] = Euclidean_distance(actual[0], training[0]);

for(int i = 1; i < m; i++)
cost[i][0] = cost[i-1][0] + Euclidean_distance(actual[i], training[0]);
for(int j = 1; j < n; j++)
cost[0][j] = cost[0][j-1] + Euclidean::Euclidean_distance(actual[0], training[j]);

for(int i = 1; i < m; i++)
for(int j = 1; j < n; j++)
cost[i][j] = std::min(cost[i-1][j], std::min(cost[i][j-1], cost[i-1][j-1]))
+ Euclidean_distance(actual[i],training[j]);

return cost[m-1][n-1];

}


(Note this is Academic code, not tested and just illustrate the algorithm)

• @downvoter - If you're going to downvote, at least have the manners or respect to explain why the downvote instead of just downvoting without any reason. Stupid Feb 27, 2015 at 16:39

From what I understand you want to do a Voice Activity Detector (VAD) (in a first stage). For this there are several implementations with distinct complexity. Here you can find some algorithms: