I am trying to identify a sound region of a word from a wav file (44100Hz). My research gave me the idea that I must use "Short-Time Energy" and "zero crossing rate". But the problem is I am not clear with the formulas to code. So if someone can guide me to a much clear Pseudo code I will greatly appreciate it. And also if someone can tell me the order of using this I will highly appreciate that too. Thanks in advance.


1 Answer 1


Audio processing FFT of chunks of audio This will give you the short term energy as a function of time and frequency.

The zero crossing in itself is easy to code (the example is conceptual, but very inefficient)

x0 = x(1); 
for i = 2:length(x)
  x1 = x(i);
  if (x0 > 0 && x1 < 0) || (x0 < 0 && x1 > 0)
     % you have a zero crossing
  x0 = x1; 

However, zero crossings are fairly sensitive to benign and typically irrelevant changes in the audio signal, so zero crossings have only limited usefulness. In particular

  1. even small amounts of noise can generate lots of extra zero crossings and "jitter" the existing ones
  2. Fluctuations in DC offset or very low frequency noise (like an Air conditioner or a heating fan picked up my a microphone) move the zero crossings all over the place
  • $\begingroup$ thanks for the answer. So seperating the frame using only the "short term energy" is enough? $\endgroup$ Jan 20, 2012 at 15:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.