Use these functions for digital signal processing.
Framework
- Accelerate
Overview
This section describes the C and Swift APIs for performing common routines on a single vector in vDSP. These functions perform tasks such as finding the absolute value of a vector, compressing the values of a vector, or converting between single and double precision vectors.
This document describes the vDSP portion of the Accelerate framework. The vDSP header provides a number of functions related to digital signal processing, including:
Vector and matrix arithmetic
Fourier transforms
Convolution, correlation, and window generation
Biquadratic filtering
Note on Strides
Many functions in vDSP allow you to specify a stride for a particular vector. If the elements of the vector are consecutive in memory, the stride is 1.
Other strides may be used to operate along a column of a matrix (the stride is the number of elements per row), to use a vector in reverse order (the stride is −1, common when convolving with a filter), or use only some elements from a vector (the stride is n to use every nth element.
With interleaved complex data, alternating real and imaginary components are stored consecutively. vDSP uses a stride of 2 for interleaved complex data, counting the individual component elements rather than counting complex numbers.
Performance and Energy Efficiency
For most of these functions, best performance is obtained when the stride is 1. Any other stride value generally prevents the use of vectorized code, greatly reducing both performance and energy efficiency.
The major exception to this limitation is in functions that support the use of interleaved complex data, such as vDSP_ctoz and vDSP_ztoc. In these, the stride should be 2 for best performance and energy effciency.
Other exceptions may be noted in the function descriptions.
For an overview that describes how to use these routines, read vDSP Programming Guide.