Definitionintro
Zero-crossing rate
Also called ZCR, zero-crossing count.
The fraction of adjacent samples in a frame whose signs differ, high for unvoiced fricatives and low for voiced speech.
The zero-crossing rate of a frame of audio is the fraction of pairs of adjacent samples whose signs differ. It is a cheap measure of how much of the energy of the frame lies at high frequencies: hiss such as "s" or "f" crosses zero often, and voiced speech, whose energy is mostly below 1 kHz, crosses rarely. It is a measurement of one frame, not a decision; a voice activity detector or the Rabiner-Sambur endpoint detector uses it, together with the energy, to decide which frames are speech, and a likelihood ratio VAD uses a model of the spectrum in its place.
Definition
Let be one frame with , and let for and for , so that 0 counts as positive. The zero-crossing count of the frame is
and the zero-crossing rate is , a number between 0 and 1. Some texts divide by in place of , some report itself per frame of fixed length, as Rabiner and Sambur do per 10 ms, and some report crossings per second, . Some count a crossing only when the product is negative, so that samples equal to 0 never count. All these variants are proportional to each other for frames of a fixed length, except for the treatment of zeros.
Facts that follow from the definition.
- Gain invariant (theorem). Multiplying the frame by any does not change . Multiplying by does not change it either when no sample is 0.
- Sinusoid (theorem, up to the frame edges). The sampled sinusoid with changes sign times per sample on average, so a frame of samples has about crossings.
- Gaussian noise (theorem). For a stationary zero-mean Gaussian sequence with normalized first autocorrelation , the probability that two adjacent samples differ in sign is , so the expected ZCR is . This is the cosine formula used by Kedem: .
- Not offset invariant. Adding a constant to the frame can change a lot. A DC offset larger than the signal makes .
Examples and non-examples
- A short frame. For the signs are , since 0.0 counts as positive. The sign changes between samples 2 and 3, 4 and 5, 6 and 7, and 7 and 8, so and .
- White noise. Independent zero-mean Gaussian samples have and .
- Low-pass noise. A first order autoregressive sequence with has an expected ZCR of 0.1436, and one with of 0.0638, about 10 crossings in a frame of 160 samples.
- A tone. At 16 kHz a 300 Hz tone has a ZCR of , about 6 crossings per 10 ms frame, and a 4 kHz tone has 0.5.
- Speech. Voiced frames have a low ZCR because their energy is mostly below 1 kHz, and unvoiced fricatives have a high one because their energy is mostly above 3 kHz. In the example of the Rabiner-Sambur endpoint detector, background frames have about 9 crossings per 160 samples and fricative frames between 62 and 96 (measurement on synthetic signals).
- Non-example: pitch. The ZCR of a voiced frame is not twice its fundamental frequency. Strong harmonics, such as a first formant at 700 Hz on a voice at 120 Hz, add crossings between the pitch periods. Pitch detection uses the autocorrelation or similar methods.
- Non-example: frequency of a mixture. For a sum of tones, the ZCR is not a weighted mean of their frequencies; a small high tone added to a large low one adds no crossings until its amplitude is large enough to make the sum change sign.
Related definitions
- Short-time energy. The energy , or the sum of magnitudes, of a frame. Together with the ZCR it separates silence, voiced and unvoiced frames in simple detectors.
- Autocorrelation. By the cosine formula, the ZCR of a Gaussian sequence determines its normalized first autocorrelation and back.
- Higher order crossings. Kedem's higher order crossings are the zero-crossing counts of the sequence after it has been differenced times. They describe the spectrum in more detail than the single count.
- Level-crossing rate. The rate at which the signal crosses a level , or a band of around 0, which makes the count less sensitive to low-level noise.
- Spectral centroid. The mean frequency of the power spectrum, a spectral measure that rises and falls with the ZCR on many signals, but needs an FFT.
References
- Benjamin Kedem, Spectral analysis and discrimination by zero-crossings, Proceedings of the IEEE 74(11), 1986, 1477 to 1493, the cosine formula that links the expected number of zero crossings of a stationary Gaussian sequence to its first autocorrelation, and the higher order crossings
- L. R. Rabiner and M. R. Sambur, An algorithm for determining the endpoints of isolated utterances, The Bell System Technical Journal 54(2), 1975, 297 to 315, the zero-crossing count of 10 ms frames and its use to find weak fricatives
- L. R. Rabiner and R. W. Schafer, Digital Processing of Speech Signals, Prentice Hall, 1978, Chapter 4 (time domain processing of speech), the short-time average zero-crossing rate
Where this leads
About this page
The build computes these levels from the evidence in the repository. Each row says what the next level needs. Read what the levels mean.
| Ladder | Level | What the next level needs |
|---|---|---|
| Human proof | H0 no proof |
|
| Lean | L0 no Lean part |
|
| Visual | V0 none |
|
| Writing | W4 complete |
|
Tag A1QYXM Edit this page History Report an error Markdown