title: Distinguishing voiced/ unvoiced speech using zero-crossing rate
body: <p>The zero-crossing rate is the rate of sign-changes along a signal, i.e., the rate at which the signal changes from positive to negative or back.</p>
  
  <p>The zero-crossing rate Zn can be used to:</p>
  
  <p>1-Distinguish voiced/unvoiced speech
  2-Seperate unvoiced speech from static background noise.</p>
  
  <p>It is a simple (yet effective) way to distinguish between 
  voiced and unvoiced speech regions: </p>
  
  <pre><code> • Voiced region:  lower zero-crossing rate 
   • Unvoiced region:  higher zero-crossing rate 
  </code></pre>
  
  <p>and here is the code i am using: </p>
  
  <pre><code>        public double evaluate(){
              int numZC=0;
              int size=signals.length;
  
              for (int i=0; i&lt;size-1; i++){
                      if((signals[i]&gt;=0 &amp;&amp; signals[i+1]&lt;0) || (signals[i]&lt;0 &amp;&amp; signals[i+1]&gt;=0)){
                              numZC++;
                      }
              }                       
  
              return numZC/lengthInSecond;
          }
  </code></pre>
  
  <p>MY questions are: </p>
  
  <p>1- My goal of using zero crossing is to eliminate the unvoiced part of the signal,,, and this code gives back the ZERO-CROSSING RATE. SO how will i do that?!</p>
  
  <p>2- How will i know how much is a "low" zero-crossing rate and how much is a "high" zero-crossing rate??? </p>