Advertisement
Guest User

Untitled

a guest
Nov 29th, 2015
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.55 KB | None | 0 0
  1. public List<Double> shortTermZeroCrossingRate(List<Double> window, List<Double> scaledSamples){
  2. List<Double> temp = new ArrayList<Double>();
  3. List<Double> zcr = new ArrayList<Double>();
  4. List<Double> horzAxisCrosses = new ArrayList<Double>();
  5. for(int i=1; i<scaledSamples.size(); i++){
  6. horzAxisCrosses.add( Math.abs( Math.signum(scaledSamples.get(i)) - Math.signum(scaledSamples.get(i-1)) ));
  7. }
  8. temp = convolution(window, horzAxisCrosses);
  9. for(int i=0; i<temp.size();i++){
  10. zcr.add(temp.get(i)/ (2*window.size()) );
  11. }
  12. return zcr;
  13. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement