?? zerocross.m
字號:
function zc = zerocross(x,wintype,winamp,winlen)
%ENERGY Short-time energy computation.
% y = ZEROCROSS(X,WINTYPE,WINAMP,WINLEN) computes the short-time enery of
% the sequence X.
%
% WINTYPE defines the window type. RECTWIN, HAMMING, HANNING, and
% BLACKAMN are the possible choices. WINAMP sets the amplitude of the
% window and the length of the window is WINLEN.
%
% See also RECTWIN, HAMMING, HANNING, BARTLETT, BLACKMAN.
%
% Author: Nabin Sharma
% Date: 2009/03/15
error(nargchk(1,4,nargin,'struct'));
% generate x[n] and x[n-1]
x1 = x;
x2 = [0, x(1:end-1)];
% generate the first difference
firstDiff = sgn(x1)-sgn(x2);
% magnitude only
absFirstDiff = abs(firstDiff);
% lowpass filtering with window
zc = winconv(absFirstDiff,wintype,winamp,winlen);
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -