Zero-crossing rate

The zero-crossing rate (ZCR) is the rate at which a signal changes from positive to zero to negative or from negative to zero to positive. Its value has been widely used in both speech recognition and music information retrieval, being a key feature to classify percussive sounds.

ZCR is defined formally as


 * $$zcr = \frac{1}{T-1} \sum_{t=1}^{T-1} \mathbb{1}_{ \mathbb{R}_{< 0} } (s_t s_{t-1}) $$

where $$s$$ is a signal of length $$T$$ and $$ \mathbb{1}_{ \mathbb{R}_{< 0} } $$ is an indicator function.

In some cases only the "positive-going" or "negative-going" crossings are counted, rather than all the crossings, since between a pair of adjacent positive zero-crossings there must be a single negative zero-crossing.

For monophonic tonal signals, the zero-crossing rate can be used as a primitive pitch detection algorithm. Zero crossing rates are also used for Voice activity detection (VAD), which determines whether human speech is present in an audio segment or not.