zeroCrossRate.m
资源名称:10_11.rar [点击查看]
上传用户:abcwxk
上传日期:2016-05-20
资源大小:434k
文件大小:0k
源码类别:
midi
开发平台:
Visual C++
- function zcr = zeroCrossRate(data, fs, w_ms, shift_ms);
- n_inOneFrame = fs*w_ms/1000;
- n_shift = fs*shift_ms/1000;
- N = floor(length(data)/n_shift);
- zcr=zeros(1,N);
- for i=1:N
- start = (i-1)*n_shift+1; final = i*n_shift;
- data_in_window =data(start :final );
- zcr(i)=sum([data_in_window;0].*[0;data_in_window]<0);
- end