<!--
{
  "documentType" : "article",
  "framework" : "Accelerate",
  "identifier" : "/documentation/Accelerate/zero-crossing-search",
  "metadataVersion" : "0.1.0",
  "role" : "collectionGroup",
  "title" : "Zero crossing search"
}
-->

# Zero crossing search

Count and find the zero crossings in a vector.

## Topics

### Single-Vector Zero Crossing Search

The functions in this group find a specified number of zero crossings, returning the last crossing found and the number of crossings found.

[`static func countZeroCrossings<U>(U) -> UInt`](/documentation/Accelerate/vDSP/countZeroCrossings(_:)-3vfmd)

Returns the number of zero crossings in a double-precision vector.

[`static func countZeroCrossings<U>(U) -> UInt`](/documentation/Accelerate/vDSP/countZeroCrossings(_:)-3btsl)

Returns the number of zero crossings in a single-precision vector.

[`extern void vDSP_nzcros(const float *__A, vDSP_Stride __IA, vDSP_Length __B, vDSP_Length *__C, vDSP_Length *__D, vDSP_Length __N);`](/documentation/Accelerate/vDSP_nzcros)

Counts and finds the zero crossings in a single-precision vector.

[`extern void vDSP_nzcrosD(const double *__A, vDSP_Stride __IA, vDSP_Length __B, vDSP_Length *__C, vDSP_Length *__D, vDSP_Length __N);`](/documentation/Accelerate/vDSP_nzcrosD)

Counts and finds the zero crossings in a double-precision vector.



---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)