zcr {seewave} | R Documentation |
This functions computes the zero-crossing rate of a time function, i. e. the average number the sign of a time wave changes.
zcr(wave, f, channel = 1, wl = 512, ovlp = 0, plot = TRUE, type = "o", xlab = "Time (s)", ylab = "Zero crossing rate", ...)
wave |
an R object. |
f |
sampling frequency of |
channel |
channel of the R object, by default left channel (1). |
wl |
length of the window for the analysis (even number of
points, by default = 512). If |
ovlp |
overlap between two successive analysis windows (in %) if
|
plot |
a logical, if |
type |
if |
xlab |
if |
ylab |
if |
... |
other |
The zero-crossing rate is computed according to:
zcr = 0.5 * mean(abs(sign(x(t+1)) - sign(x(t))))
with:
N the length of the signal x
and where:
sgn(x(t)) = 1
if
x(t) >= 0
and
sgn(x(t)) = -1
if
x(t) < 0.
The are two possibilities:
a numeric vector of length 1 if wl
is NULL
,
a numeric two-column matrix is returned with the first columnn being
time (s) and the second colum being the zero-crossing rate (no scale) if wl
is not NULL
.
The are two possibilities:
if wl
is NULL
then the zero-crossing rate is
computed for the complete signal.
if wl
is not NULL
the the zero-crossing rate is
computed for for a window sliding along the time wave.
The ZCR is supposed to help in detection of voiced/unvoiced sound sections.
Jerome Sueur
http://en.wikipedia.org/wiki/Zero-crossing_rate
data(tico) ## a single value for the complete signal, no plot zcr(tico, wl=NULL) ## a series of values computed for a sliding window of 512 samples, plot zcr(tico)