librosax.feature.zero_crossing_rate

zero_crossing_rate(y: Array, *, frame_length: int = 2048, hop_length: int = 512, center: bool = True, **kwargs) Array[source]

Compute the zero-crossing rate of an audio time series.

Parameters:
  • y

    Audio time series. The last axis must be time.

    • (T,) - single waveform

    • (B, T) - batch of waveforms

  • frame_length – Length of the frame over which to compute zero crossing rates

  • hop_length – Number of samples to advance for each frame

  • center – If True, frames are centered by padding the edges of y. Uses edge-value copies instead of zero-padding.

  • **kwargs – Additional keyword arguments to pass to zero_crossings

Returns:

Zero crossing rate with shape (..., 1, N).

  • (T,)(1, N)

  • (B, T)(B, 1, N)