# Zero-crossing rate

The zero-crossing rate is the rate of sign-changes along a signal, i.e., the rate at which the signal changes from positive to negative or back.[1] This feature has been used heavily in both speech recognition and music information retrieval, being a key feature to classify percussive sounds.[2]

ZCR is defined formally as

${\displaystyle zcr={\frac {1}{T-1}}\sum _{t=1}^{T-1}{{\mathbb {I} }\left\{{s_{t}s_{t-1}<0}\right\}}}$

where ${\displaystyle s}$ is a signal of length ${\displaystyle T}$ and the indicator function ${\displaystyle {{\mathbb {I} }\left\{{A}\right\}}}$ is 1 if its argument ${\displaystyle A}$ is true and 0 otherwise.

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

For monophonic tonal signals, the zero-crossing rate can be used as a primitive pitch detection algorithm.

## Applications

Zero crossing rates are used for Voice activity detection(VAD), i.e., finding whether a segment of speech is voiced or unvoiced.