vDSP

Perform basic arithmetic operations and common digital signal processing routines on large vectors.

Overview

The vDSP framework contains a collection of highly optimized functions for digital signal processing and general purpose arithmetic on large arrays. On the digital signal processing side, for example, vDSP includes Fourier transform and biquadratic filtering operations. On the arithmetic side, for example, vDSP includes functions such as multiply-add and reduction functions such as sum, mean, and maximum.

The following sequence of images illustrates vDSP's capabilities. For example, you can use `vDSP_vtmerg`to combine two waveforms (at top) to produce a vector (at bottom) that you use to create a smooth transition between two signals.

The majority of vDSP operations are single-threaded and run on a single core. However, the following functions may be multithreaded depending on the size of the data they are operating on:

Topics

Fundamentals

Controlling vDSP Operations with Stride

Operate selectively on the elements of a vector at regular intervals.

Using vDSP for Vector-based Arithmetic

Increase the performance of common mathematical tasks with vDSP vector-vector and vector-scalar operations.

Vector Generation, Filling, and Clearing

Vector Generation

Populate vectors with ramps, values from lookup tables, and window functions.

Vector Clear and Fill Functions

Populate vectors with zeros or a scalar value.

Vector Reduction

Vector Extrema Calculation

Calculate the minimum and maximum values in a vector.

Vector Average Calculation

Calculate the average value in a vector.

Vector Summation

Sum the values in a vector.

Vector Geometry Functions

Vector-to-Vector Distance and Pythagorean Computation

Calculate distance and hypotenuse of vectors.

Dot Product Calculation

Calculate the scalar product of two vectors.

Vector-Scalar Arithmetic

Basic Arithmetic Functions

Perform operations on scalar values and vectors.

Vector-Vector Arithmetic

Real Basic Arithmetic

Perform elementwise operations on vectors of real values.

Complex Basic Arithmetic

Perform elementwise operations on vectors of complex values.

Integer Arithmetic

Perform elementwise operations on vectors of integer values.

Vector and Matrix Fourier Transforms

Fast Fourier Transforms

Transform vectors and matrices of temporal and spatial domain complex values to the frequency domain and vice versa.

Discrete Fourier Transforms

Transform vectors of temporal and spatial domain complex values to the frequency domain and vice versa.

Discrete Cosine Transforms

Transform vectors of temporal and spatial domain real values to the frequency domain and vice versa.

Data Types

`vDSP_Length`

Used for numbers of elements in arrays and indices of elements in arrays. It is also used for the base-two logarithm of numbers of elements.

`vDSP_Stride`

Used to hold differences between indices of elements, including the lengths of strides.

`DSPComplex`

Used to hold a complex value.

`DSPSplitComplex`

A structure that represents a single-precision complex number with the real and imaginary parts stored in separate arrays.

`DSPDoubleComplex`

Used to hold a double-precision complex value.

`DSPDoubleSplitComplex`

A structure that represents a double-precision complex number with the real and imaginary parts stored in separate arrays.

Constants

vDSP Compile-Time Version Information

The version of vDSP (at compile time).

Signal Processing Essentials

Controlling vDSP Operations with Stride

Operate selectively on the elements of a vector at regular intervals.

Use Linear Interpolation to Construct New Data Points

Fill the gaps in arrays of numerical data using linear interpolation.

Using vDSP for Vector-based Arithmetic

Increase the performance of common mathematical tasks with vDSP vector-vector and vector-scalar operations.

Resampling a Signal with Decimation

Reduce the sample rate of a signal, by specifying a decimation factor and applying a custom antialiasing filter.