# Speech Analysis - Zero-Crossing

Basically, (I know I've asked a simular question, but I have been away and really thought about it this time)!

Let me try and explain this in the best way possible:

Basically, I'm attempting to create an algorithm that takes a voice sample (.wav) of someone saying either "Yes", or "No". Now, in order to do this I am attempting to split the sample into equal blocks in order to get the Phones.

I don't need to technically analise all of Phones, I can identify if the the sample is either "Yes" or "No" by just looking for a "Y" Phone. Because if a "Y" doesn't exist then the sample is "No". So, I can handle this by implementing a decision tree.

Ok, so to my question. I know that this can be achieved using Zero-Crossing, but, I don't have any experience in this (Ok, people are going to tell me to stop doing it then) but, we all had to learn somewhere, right?

If someone could possibly link me to a website or a book where I can learn about the Zero-crossing method? Then it would be great.

The main thing I don't understand about it is, how can Zero-crossing determine whether the Phone is a "Y"? Or, will I need to have some samples of "Y" in order to match through Correlation?, or something.

I hope someone can advise me.

Thanks :)

• In spite of my detailed answer to your previous question, you are still not providing any information regarding whether you want to build a system with or without prior training, and single or multi- speaker, which are the very first thing to specify before building a speech recognition system, not matter how complex. – pichenettes Aug 16 '12 at 7:21
• You should go back and improve the original question rather than just posting what is essentially a re-worded duplicate question. – Paul R Aug 16 '12 at 19:43
• Instead of listening for the Y or the N, which are both voiced sounds, listen for the S, which is unvoiced noise. Check the RMS amplitude for each chunk, and when it's above some threshold (there's sound there), check its spectral flatness. Low spectral flatness is voiced sounds, high spectral flatness is noisy unvoiced sounds. – endolith Aug 23 '12 at 18:34
• To add to endolith's comments regarding spectral-flatness for voiced versus unvoiced discrimination, looking at the LPC residual will also reveal latent discriminable structure that could be of use. – ruoho ruotsi Dec 17 '14 at 3:53

Zero-crossing rate (ZCR) might be useful for voiced/unvoiced frame discrimination, speech/music discrimination, but it is of much lesser importance in speech recognition. One reason is that it is pitch-dependent and not robust to background noise or hum. It is not difficult to craft very different signals (say a female voice saying a phone and a male voice saying another phone) that have the exact same ZCR; or to add some noise to a signal in a way that will half or double its ZCR.

Using zero-crossing rate might work in the single-speaker + prior training case. Collect a handful of samples of each words, compute the zero crossing rate, and train a naive bayesian classifier for this two-class problem. Be prepared to poor performances, and don't expect your system to generalize to other speakers.

The only plausible reason one would use such a feature would be on embedded systems with very limited computational power. Otherwise, there's no reason not to use "proven" features like MFCC or AR coefficients.

I believe that zero-crossing rate is not going to help you to distinguish between "Yes/no". However you can try and discover this by yourself. I don't know what programming language you are using... A typical method would be (considering that your data is in a vector named "x" ):

temp1 = x > 0;
temp2 = diff(temp1);


in "temp2" you will have -1, 0 and 1 values that show when your signal goes from pos to neg and from neg to pos. You can count/sum all the 1's for example, depending on want type of "rate" you want to calculate.

(If you evaluate only the rightmost 1/3 of the signal you might get it to work since the "s" will containt much more zero-crosses than the "o")