iOS Developer Library

Developer

Accelerate Framework Reference vDSP Reference

Options
Deployment Target:

On This Page
Language:

vDSP Reference

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

For an overview that describes how to use these routines, read vDSP Programming Guide.

Functions

The functions in this group compute the absolute value of each element in a vector.

  • Vector absolute values; single precision.

    Declaration

    Swift

    func vDSP_vabs(_ __vDSP_A: UnsafePointer<Float>, _ __vDSP_I: vDSP_Stride, _ __vDSP_C: UnsafeMutablePointer<Float>, _ __vDSP_K: vDSP_Stride, _ __vDSP_N: vDSP_Length)

    Objective-C

    void vDSP_vabs ( const float *__vDSP_A, vDSP_Stride __vDSP_IA, float *__vDSP_C, vDSP_Stride __vDSP_IC, vDSP_Length __vDSP_N );

    Parameters

    __vDSP_A

    Single-precision real input vector. Maps to A in the discussion.

    __vDSP_I

    Stride size for __vDSP_A. Maps to I in the discussion.

    __vDSP_C

    Single-precision real output vector. Maps to C in the discussion.

    __vDSP_K

    Address stride for __vDSP_C. Maps to K in the discussion.

    __vDSP_N

    The number of elements to process. Maps to N in the discussion.

    Discussion

    This performs the following operation:

    image: ../art/vdsp_81.eps

    Writes the absolute values of the elements of A into corresponding elements of C.

    Import Statement

    Objective-C

    @import Accelerate;

    Swift

    import Accelerate

    Availability

    Available in iOS 4.0 and later.

  • Vector absolute values; double precision.

    Declaration

    Swift

    func vDSP_vabsD(_ __vDSP_A: UnsafePointer<Double>, _ __vDSP_I: vDSP_Stride, _ __vDSP_C: UnsafeMutablePointer<Double>, _ __vDSP_K: vDSP_Stride, _ __vDSP_N: vDSP_Length)

    Objective-C

    void vDSP_vabsD ( const double *__vDSP_A, vDSP_Stride __vDSP_IA, double *__vDSP_C, vDSP_Stride __vDSP_IC, vDSP_Length __vDSP_N );

    Parameters

    __vDSP_A

    Double-precision real input vector. Maps to A in the discussion.

    __vDSP_I

    Address stride for __vDSP_A. Maps to I in the discussion.

    __vDSP_C

    Double-precision real output vector. Maps to C in the discussion.

    __vDSP_K

    Address stride for __vDSP_C. Maps to K in the discussion.

    __vDSP_N

    The number of elements to process. Maps to N in the discussion.

    Discussion

    This performs the following operation:

    image: ../art/vdsp_81.eps

    Writes the absolute values of the elements of __vDSP_A into corresponding elements of __vDSP_C.

    Import Statement

    Objective-C

    @import Accelerate;

    Swift

    import Accelerate

    Availability

    Available in iOS 4.0 and later.

  • Integer vector absolute values.

    Declaration

    Swift

    func vDSP_vabsi(_ __vDSP_A: UnsafePointer<Int32>, _ __vDSP_I: vDSP_Stride, _ __vDSP_C: UnsafeMutablePointer<Int32>, _ __vDSP_K: vDSP_Stride, _ __vDSP_N: vDSP_Length)

    Objective-C

    void vDSP_vabsi ( const int *__vDSP_A, vDSP_Stride __vDSP_IA, int *__vDSP_C, vDSP_Stride __vDSP_IC, vDSP_Length __vDSP_N );

    Parameters

    __vDSP_A

    Integer input vector. Maps to A in the discussion.

    __vDSP_I

    Address stride for __vDSP_A. Maps to I in the discussion.

    __vDSP_C

    Integer output vector. Maps to C in the discussion.

    __vDSP_K

    Address stride for __vDSP_C. Maps to K in the discussion.

    __vDSP_N

    The number of elements to process. Maps to N in the discussion.

    Discussion

    This performs the following operation:

    image: ../art/vdsp_81.eps

    Writes the absolute values of the elements of __vDSP_A into corresponding elements of __vDSP_C.

    Import Statement

    Objective-C

    @import Accelerate;

    Swift

    import Accelerate

    Availability

    Available in iOS 4.0 and later.

  • Complex vector absolute values; single precision.

    Declaration

    Swift

    func vDSP_zvabs(_ __vDSP_A: UnsafePointer<DSPSplitComplex>, _ __vDSP_I: vDSP_Stride, _ __vDSP_C: UnsafeMutablePointer<Float>, _ __vDSP_K: vDSP_Stride, _ __vDSP_N: vDSP_Length)

    Objective-C

    void vDSP_zvabs ( const DSPSplitComplex *__vDSP_A, vDSP_Stride __vDSP_IA, float *__vDSP_C, vDSP_Stride __vDSP_IC, vDSP_Length __vDSP_N );

    Parameters

    __vDSP_A

    Single-precision complex input vector. Maps to A in the discussion.

    __vDSP_I

    Address stride for __vDSP_A. Maps to i in the discussion.

    __vDSP_C

    Single-precision real output vector. Maps to C in the discussion.

    __vDSP_K

    Address stride for __vDSP_C. Maps to k in the discussion.

    __vDSP_N

    The number of elements to process. Maps to N in the discussion.

    Discussion

    This performs the following operation:

    image: ../art/vdsp_98.eps

    Import Statement

    Objective-C

    @import Accelerate;

    Swift

    import Accelerate

    Availability

    Available in iOS 4.0 and later.

  • Complex vector absolute values; double precision.

    Declaration

    Swift

    func vDSP_zvabsD(_ __vDSP_A: UnsafePointer<DSPDoubleSplitComplex>, _ __vDSP_I: vDSP_Stride, _ __vDSP_C: UnsafeMutablePointer<Double>, _ __vDSP_K: vDSP_Stride, _ __vDSP_N: vDSP_Length)

    Objective-C

    void vDSP_zvabsD ( const DSPDoubleSplitComplex *__vDSP_A, vDSP_Stride __vDSP_IA, double *__vDSP_C, vDSP_Stride __vDSP_IC, vDSP_Length __vDSP_N );

    Parameters

    __vDSP_A

    Double-precision complex input vector. Maps to A in the discussion.

    __vDSP_I

    Address stride for A. Maps to I in the discussion.

    __vDSP_C

    Double-precision real output vector. Maps to C in the discussion.

    __vDSP_K

    Address stride for __vDSP_C. Maps to K in the discussion.

    __vDSP_N

    The number of elements to process. Maps to N in the discussion.

    Discussion

    This performs the following operation:

    image: ../art/vdsp_98.eps

    Import Statement

    Objective-C

    @import Accelerate;

    Swift

    import Accelerate

    Availability

    Available in iOS 4.0 and later.

  • Vector negative absolute values; single precision.

    Declaration

    Swift

    func vDSP_vnabs(_ __vDSP_A: UnsafePointer<Float>, _ __vDSP_I: vDSP_Stride, _ __vDSP_C: UnsafeMutablePointer<Float>, _ __vDSP_K: vDSP_Stride, _ __vDSP_N: vDSP_Length)

    Objective-C

    void vDSP_vnabs ( const float *__vDSP_A, vDSP_Stride __vDSP_IA, float *__vDSP_C, vDSP_Stride __vDSP_IC, vDSP_Length __vDSP_N );

    Parameters

    __vDSP_A

    Single-precision real input vector. Maps to A in the discussion.

    __vDSP_I

    Address stride for __vDSP_A. Maps to I in the discussion.

    __vDSP_C

    Single-precision real output vector. Maps to C in the discussion.

    __vDSP_K

    Address stride for __vDSP_C. Maps to K in the discussion.

    __vDSP_N

    The number of elements to process. Maps to N in the discussion.

    Discussion

    This performs the following operation:

    image: ../art/vdsp_128.eps

    Each value in __vDSP_C is the negated absolute value of the corresponding element in __vDSP_A.

    Import Statement

    Objective-C

    @import Accelerate;

    Swift

    import Accelerate

    Availability

    Available in iOS 4.0 and later.

  • Vector negative absolute values; double precision.

    Declaration

    Swift

    func vDSP_vnabsD(_ __vDSP_A: UnsafePointer<Double>, _ __vDSP_I: vDSP_Stride, _ __vDSP_C: UnsafeMutablePointer<Double>, _ __vDSP_K: vDSP_Stride, _ __vDSP_N: vDSP_Length)

    Objective-C

    void vDSP_vnabsD ( const double *__vDSP_A, vDSP_Stride __vDSP_IA, double *__vDSP_C, vDSP_Stride __vDSP_IC, vDSP_Length __vDSP_N );

    Parameters

    __vDSP_A

    Double-precision real input vector. Maps to A in the discussion.

    __vDSP_I

    Address stride for __vDSP_A. Maps to I in the discussion.

    __vDSP_C

    Double-precision real output vector. Maps to C in the discussion.

    __vDSP_K

    Address stride for __vDSP_C. Maps to K in the discussion.

    __vDSP_N

    The number of elements to process. Maps to N in the discussion.

    Discussion

    This performs the following operation:

    image: ../art/vdsp_128.eps

    Each value in __vDSP_C is the negated absolute value of the corresponding element in __vDSP_A.

    Import Statement

    Objective-C

    @import Accelerate;

    Swift

    import Accelerate

    Availability

    Available in iOS 4.0 and later.

The functions in this group negates each element in a vector.

  • Vector negative values; single precision.

    Declaration

    Swift

    func vDSP_vneg(_ __vDSP_A: UnsafePointer<Float>, _ __vDSP_I: vDSP_Stride, _ __vDSP_C: UnsafeMutablePointer<Float>, _ __vDSP_K: vDSP_Stride, _ __vDSP_N: vDSP_Length)

    Objective-C

    void vDSP_vneg ( const float *__vDSP_A, vDSP_Stride __vDSP_IA, float *__vDSP_C, vDSP_Stride __vDSP_IC, vDSP_Length __vDSP_N );

    Parameters

    __vDSP_A

    Single-precision real input vector. Maps to A in the discussion.

    __vDSP_I

    Address stride for __vDSP_A. Maps to I in the discussion.

    __vDSP_C

    Single-precision real output vector. Maps to C in the discussion.

    __vDSP_K

    Address stride for __vDSP_C. Maps to K in the discussion.

    __vDSP_N

    The number of elements to process. Maps to N in the discussion.

    Discussion

    This calculates the following:

    • for (n = 0; n < N; ++n)
    • C[n*K] = -A[n*I];

    Each value in __vDSP_C is replaced by the negated value of the corresponding element in __vDSP_A.

    Import Statement

    Objective-C

    @import Accelerate;

    Swift

    import Accelerate

    Availability

    Available in iOS 4.0 and later.

  • Vector negative values; double precision.

    Declaration

    Swift

    func vDSP_vnegD(_ __vDSP_A: UnsafePointer<Double>, _ __vDSP_I: vDSP_Stride, _ __vDSP_C: UnsafeMutablePointer<Double>, _ __vDSP_K: vDSP_Stride, _ __vDSP_N: vDSP_Length)

    Objective-C

    void vDSP_vnegD ( const double *__vDSP_A, vDSP_Stride __vDSP_IA, double *__vDSP_C, vDSP_Stride __vDSP_IC, vDSP_Length __vDSP_N );

    Parameters

    __vDSP_A

    Double-precision real input vector. Maps to A in the discussion.

    __vDSP_I

    Address stride for A. Maps to I in the discussion.

    __vDSP_C

    Double-precision real output vector. Maps to C in the discussion.

    __vDSP_K

    Address stride for C. Maps to K in the discussion.

    __vDSP_N

    The number of elements to process. Maps to N in the discussion.

    Discussion

    This calculates the following:

    • for (n = 0; n < N; ++n)
    • C[n*K] = -A[n*I];

    Each value in C is replaced by the negated value of the corresponding element in A.

    Import Statement

    Objective-C

    @import Accelerate;

    Swift

    import Accelerate

    Availability

    Available in iOS 4.0 and later.

  • Complex vector negate; single precision.

    Declaration

    Swift

    func vDSP_zvneg(_ __vDSP_A: UnsafePointer<DSPSplitComplex>, _ __vDSP_I: vDSP_Stride, _ __vDSP_C: UnsafePointer<DSPSplitComplex>, _ __vDSP_K: vDSP_Stride, _ __vDSP_N: vDSP_Length)

    Objective-C

    void vDSP_zvneg ( const DSPSplitComplex *__vDSP_A, vDSP_Stride __vDSP_IA, const DSPSplitComplex *__vDSP_C, vDSP_Stride __vDSP_IC, vDSP_Length __vDSP_N );

    Parameters

    __vDSP_A

    Single-precision complex input vector. Maps to A in the discussion.

    __vDSP_I

    Address stride for A. Maps to I in the discussion.

    __vDSP_C

    Single-precision complex output vector. Maps to C in the discussion.

    __vDSP_K

    Address stride for C. Maps to K in the discussion.

    __vDSP_N

    The number of elements to process. Maps to N in the discussion.

    Discussion

    Computes the negatives of the values of complex vector A and puts them into complex vector C.

    image: ../art/vdsp_107.eps

    Import Statement

    Objective-C

    @import Accelerate;

    Swift

    import Accelerate

    Availability

    Available in iOS 4.0 and later.

  • Complex vector negate; double precision.

    Declaration

    Swift

    func vDSP_zvnegD(_ __vDSP_A: UnsafePointer<DSPDoubleSplitComplex>, _ __vDSP_I: vDSP_Stride, _ __vDSP_C: UnsafePointer<DSPDoubleSplitComplex>, _ __vDSP_K: vDSP_Stride, _ __vDSP_N: vDSP_Length)

    Objective-C

    void vDSP_zvnegD ( const DSPDoubleSplitComplex *__vDSP_A, vDSP_Stride __vDSP_IA, const DSPDoubleSplitComplex *__vDSP_C, vDSP_Stride __vDSP_IC, vDSP_Length __vDSP_N );

    Parameters

    __vDSP_A

    Double-precision complex input vector. Maps to A in the discussion.

    __vDSP_I

    Address stride for A. Maps to I in the discussion.

    __vDSP_C

    Double-precision complex output vector. Maps to C in the discussion.

    __vDSP_K

    Address stride for C. Maps to K in the discussion.

    __vDSP_N

    The number of elements to process. Maps to N in the discussion.

    Discussion

    Computes the negatives of the values of complex vector A and puts them into complex vector C.

    image: ../art/vdsp_107.eps

    Import Statement

    Objective-C

    @import Accelerate;

    Swift

    import Accelerate

    Availability

    Available in iOS 4.0 and later.

The functions in this group fills each element in a vector with a specific value or clears each element.

  • Vector fill; single precision.

    Declaration

    Swift

    func vDSP_vfill(_ __vDSP_A: UnsafePointer<Float>, _ __vDSP_C: UnsafeMutablePointer<Float>, _ __vDSP_K: vDSP_Stride, _ __vDSP_N: vDSP_Length)

    Objective-C

    void vDSP_vfill ( const float *__vDSP_A, float *__vDSP_C, vDSP_Stride __vDSP_IA, vDSP_Length __vDSP_N );

    Parameters

    __vDSP_A

    Single-precision real input scalar. Maps to A in the discussion.

    __vDSP_C

    Single-precision real output vector. Maps to C in the discussion.

    __vDSP_K

    Address stride for C. Maps to K in the discussion.

    __vDSP_N

    The number of elements to process. Maps to N in the discussion.

    Discussion

    Performs the following operation:

    image: ../art/vdsp_93.eps

    Sets each element of vector C to the value of A.

    Import Statement

    Objective-C

    @import Accelerate;

    Swift

    import Accelerate

    Availability

    Available in iOS 4.0 and later.

  • Vector fill; double precision.

    Declaration

    Swift

    func vDSP_vfillD(_ __vDSP_A: UnsafePointer<Double>, _ __vDSP_C: UnsafeMutablePointer<Double>, _ __vDSP_K: vDSP_Stride, _ __vDSP_N: vDSP_Length)

    Objective-C

    void vDSP_vfillD ( const double *__vDSP_A, double *__vDSP_C, vDSP_Stride __vDSP_IC, vDSP_Length __vDSP_N );

    Parameters

    __vDSP_A

    Double-precision real input scalar. Maps to A in the discussion.

    __vDSP_C

    Double-precision real output vector. Maps to C in the discussion.

    __vDSP_K

    Address stride for C. Maps to K in the discussion.

    __vDSP_N

    The number of elements to process. Maps to N in the discussion.

    Discussion

    Performs the following operation:

    image: ../art/vdsp_93.eps

    Sets each element of vector C to the value of A.

    Import Statement

    Objective-C

    @import Accelerate;

    Swift

    import Accelerate

    Availability

    Available in iOS 4.0 and later.

  • Integer vector fill.

    Declaration

    Swift

    func vDSP_vfilli(_ __vDSP_A: UnsafePointer<Int32>, _ __vDSP_C: UnsafeMutablePointer<Int32>, _ __vDSP_K: vDSP_Stride, _ __vDSP_N: vDSP_Length)

    Objective-C

    void vDSP_vfilli ( const int *__vDSP_A, int *__vDSP_C, vDSP_Stride __vDSP_IC, vDSP_Length __vDSP_N );

    Parameters

    __vDSP_A

    Integer input scalar. Maps to A in the discussion.

    __vDSP_C

    Integer output vector. Maps to C in the discussion.

    __vDSP_K

    Address stride for C. Maps to K in the discussion.

    __vDSP_N

    The number of elements to process. Maps to N in the discussion.

    Discussion

    Performs the following operation:

    image: ../art/vdsp_93.eps

    Sets each element of vector C to the value of A.

    Import Statement

    Objective-C

    @import Accelerate;

    Swift

    import Accelerate

    Availability

    Available in iOS 4.0 and later.

  • Complex vector fill; single precision.

    Declaration

    Swift

    func vDSP_zvfill(_ __vDSP_A: UnsafePointer<DSPSplitComplex>, _ __vDSP_C: UnsafePointer<DSPSplitComplex>, _ __vDSP_K: vDSP_Stride, _ __vDSP_N: vDSP_Length)

    Objective-C

    void vDSP_zvfill ( const DSPSplitComplex *__vDSP_A, const DSPSplitComplex *__vDSP_C, vDSP_Stride __vDSP_IC, vDSP_Length __vDSP_N );

    Parameters

    __vDSP_A

    Single-precision complex input scalar. Maps to A in the discussion.

    __vDSP_C

    Single-precision complex output vector. Maps to C in the discussion.

    __vDSP_K

    Address stride for C. Maps to K in the discussion.

    __vDSP_N

    The number of elements to process. Maps to N in the discussion.

    Discussion

    Sets each element in complex vector C to complex scalar A.

    image: ../art/vdsp_103.eps

    Import Statement

    Objective-C

    @import Accelerate;

    Swift

    import Accelerate

    Availability

    Available in iOS 4.0 and later.

  • Complex vector fill; double precision.

    Declaration

    Swift

    func vDSP_zvfillD(_ __vDSP_A: UnsafePointer<DSPDoubleSplitComplex>, _ __vDSP_C: UnsafePointer<DSPDoubleSplitComplex>, _ __vDSP_K: vDSP_Stride, _ __vDSP_N: vDSP_Length)

    Objective-C

    void vDSP_zvfillD ( const DSPDoubleSplitComplex *__vDSP_A, const DSPDoubleSplitComplex *__vDSP_C, vDSP_Stride __vDSP_IC, vDSP_Length __vDSP_N );

    Parameters

    __vDSP_A

    Double-precision complex input scalar. Maps to A in the discussion.

    __vDSP_C

    Double-precision complex output vector. Maps to C in the discussion.

    __vDSP_K

    Address stride for C. Maps to K in the discussion.

    __vDSP_N

    The number of elements to process. Maps to N in the discussion.

    Discussion

    Sets each element in complex vector C to complex scalar A.

    image: ../art/vdsp_103.eps

    Import Statement

    Objective-C

    @import Accelerate;

    Swift

    import Accelerate

    Availability

    Available in iOS 4.0 and later.

  • Vector clear; single precision.

    Declaration

    Swift

    func vDSP_vclr(_ __vDSP_C: UnsafeMutablePointer<Float>, _ __vDSP_K: vDSP_Stride, _ __vDSP_N: vDSP_Length)

    Objective-C

    void vDSP_vclr ( float *__vDSP_C, vDSP_Stride __vDSP_IC, vDSP_Length __vDSP_N );

    Parameters

    __vDSP_C

    Single-precision real output vector.

    __vDSP_K

    Address stride for C.

    __vDSP_N

    The number of elements to process.

    Discussion

    All elements of vector C are set to zeros.

    Import Statement

    Objective-C

    @import Accelerate;

    Swift

    import Accelerate

    Availability

    Available in iOS 4.0 and later.

  • Vector clear; double precision.

    Declaration

    Swift

    func vDSP_vclrD(_ __vDSP_C: UnsafeMutablePointer<Double>, _ __vDSP_K: vDSP_Stride, _ __vDSP_N: vDSP_Length)

    Objective-C

    void vDSP_vclrD ( double *__vDSP_C, vDSP_Stride __vDSP_IC, vDSP_Length __vDSP_N );

    Parameters

    __vDSP_C

    Double-precision real output vector.

    __vDSP_K

    Address stride for C.

    __vDSP_N

    The number of elements to process.

    Discussion

    All elements of vector C are set to zeros.

    Import Statement

    Objective-C

    @import Accelerate;

    Swift

    import Accelerate

    Availability

    Available in iOS 4.0 and later.

The functions in this group build vectors with specific generator functions.

  • Build ramped vector; single precision.

    Declaration

    Swift

    func vDSP_vramp(_ __vDSP_A: UnsafePointer<Float>, _ __vDSP_B: UnsafePointer<Float>, _ __vDSP_C: UnsafeMutablePointer<Float>, _ __vDSP_K: vDSP_Stride, _ __vDSP_N: vDSP_Length)

    Objective-C

    void vDSP_vramp ( const float *__vDSP_A, const float *__vDSP_B, float *__vDSP_C, vDSP_Stride __vDSP_IC, vDSP_Length __vDSP_N );

    Parameters

    __vDSP_A

    Address of a, a single-precision real input scalar that is the initial value.

    __vDSP_B

    Address of b, a single-precision real input scalar that is the increment (or decrement if negative).

    __vDSP_C

    Single-precision real output vector. Maps to C in the discussion.

    __vDSP_K

    Address stride for C. Maps to k in the discussion.

    __vDSP_N

    The number of elements to process. Maps to N in the discussion.

    Discussion

    Performs the following operation:

    image: ../art/vdsp_132.eps

    Creates a monotonically incrementing or decrementing vector. Scalar A is the initial value written to vector C. Scalar B is the increment or decrement for each succeeding element.

    Import Statement

    Objective-C

    @import Accelerate;

    Swift

    import Accelerate

    Availability

    Available in iOS 4.0 and later.

  • Build ramped vector; double precision.

    Declaration

    Swift

    func vDSP_vrampD(_ __vDSP_A: UnsafePointer<Double>, _ __vDSP_B: UnsafePointer<Double>, _ __vDSP_C: UnsafeMutablePointer<Double>, _ __vDSP_K: vDSP_Stride, _ __vDSP_N: vDSP_Length)

    Objective-C

    void vDSP_vrampD ( const double *__vDSP_A, const double *__vDSP_B, double *__vDSP_C, vDSP_Stride __vDSP_IC, vDSP_Length __vDSP_N );

    Parameters

    __vDSP_A

    Address of a, a double-precision real input scalar that is the initial value.

    __vDSP_B

    Address of b, a double-precision real input scalar that is the increment (or decrement if negative).

    __vDSP_C

    Double-precision real output vector.

    __vDSP_K

    Address stride. for C.

    __vDSP_N

    The number of elements to process

    Discussion

    Performs the following operation:

    image: ../art/vdsp_132.eps

    Creates a monotonically incrementing or decrementing vector. Scalar A is the initial value written to vector C. Scalar B is the increment or decrement for each succeeding element.

    Import Statement

    Objective-C

    @import Accelerate;

    Swift

    import Accelerate

    Availability

    Available in iOS 4.0 and later.

  • Builds a ramped vector and multiplies by a source vector.

    Declaration

    Swift

    func vDSP_vrampmul(_ __vDSP_I: UnsafePointer<Float>, _ __vDSP_IS: vDSP_Stride, _ __vDSP_Start: UnsafeMutablePointer<Float>, _ __vDSP_Step: UnsafePointer<Float>, _ __vDSP_O: UnsafeMutablePointer<Float>, _ __vDSP_OS: vDSP_Stride, _ __vDSP_N: vDSP_Length)

    Objective-C

    void vDSP_vrampmul ( const float *__vDSP_I, vDSP_Stride __vDSP_IS, float *__vDSP_Start, const float *__vDSP_Step, float *__vDSP_O, vDSP_Stride __vDSP_OS, vDSP_Length __vDSP_N );

    Parameters

    __vDSP_I

    Input vector, multiplied by the ramp function.

    __vDSP_IS

    Address stride length in input vector. For example, if __vDSP_IS is 2, every second element is used.

    __vDSP_Start

    The initial value for the ramp function. Modified on return to hold the next value (including accumulated errors) so that the ramp function can be continued smoothly.

    __vDSP_Step

    The value to increment each subsequent value of the ramp function by.

    __vDSP_O

    The output vector.

    __vDSP_OS

    Address stride length in output vector. For example, if __vDSP_IS is 2, every second element is modified.

    __vDSP_N

    The number of elements to modify.

    Discussion

    This routine calculates the following:

    • for (i = 0; i < N; ++i) {
    • O[i*OS] = *Start * I[i*IS];
    • *Start += *Step;
    • }

    Import Statement

    Objective-C

    @import Accelerate;

    Swift

    import Accelerate

    Availability

    Available in iOS 4.0 and later.

  • Vector fixed-point 1.15 format version of vDSP_vrampmul.

    Declaration

    Swift

    func vDSP_vrampmul_s1_15(_ __vDSP_I: UnsafePointer<Int16>, _ __vDSP_IS: vDSP_Stride, _ __vDSP_Start: UnsafeMutablePointer<Int16>, _ __vDSP_Step: UnsafePointer<Int16>, _ __vDSP_O: UnsafeMutablePointer<Int16>, _ __vDSP_OS: vDSP_Stride, _ __vDSP_N: vDSP_Length)

    Objective-C

    void vDSP_vrampmul_s1_15 ( const short *__vDSP_I, vDSP_Stride __vDSP_IS, short *__vDSP_Start, const short *__vDSP_Step, short *__vDSP_O, vDSP_Stride __vDSP_OS, vDSP_Length __vDSP_N );

    Parameters

    __vDSP_I

    Input vector, multiplied by the ramp function.

    __vDSP_IS

    Address stride length in input vector. For example, if __vDSP_IS is 2, every second element is used.

    __vDSP_Start

    The initial value for the ramp function. Modified on return to hold the next value (including accumulated errors) so that the ramp function can be continued smoothly.

    __vDSP_Step

    The value to increment each subsequent value of the ramp function by.

    __vDSP_O

    The output vector.

    __vDSP_OS

    Address stride length in output vector. For example, if __vDSP_IS is 2, every second element is modified.

    __vDSP_N

    The number of elements to modify.

    Discussion

    This routine calculates the following:

    • for (i = 0; i < N; ++i) {
    • O[i*OS] = *Start * I[i*IS];
    • *Start += *Step;
    • }

    The elements are fixed-point numbers, each with one sign bit and 15 fraction bits. A value in this representation can be converted to floating-point by dividing it by 32768.0.

    Import Statement

    Objective-C

    @import Accelerate;

    Swift

    import Accelerate

    Availability

    Available in iOS 4.0 and later.

  • Vector fixed-point 8.24 format version of vDSP_vrampmul.

    Declaration

    Swift

    func vDSP_vrampmul_s8_24(_ __vDSP_I: UnsafePointer<Int32>, _ __vDSP_IS: vDSP_Stride, _ __vDSP_Start: UnsafeMutablePointer<Int32>, _ __vDSP_Step: UnsafePointer<Int32>, _ __vDSP_O: UnsafeMutablePointer<Int32>, _ __vDSP_OS: vDSP_Stride, _ __vDSP_N: vDSP_Length)

    Objective-C

    void vDSP_vrampmul_s8_24 ( const int *__vDSP_I, vDSP_Stride __vDSP_IS, int *__vDSP_Start, const int *__vDSP_Step, int *__vDSP_O, vDSP_Stride __vDSP_OS, vDSP_Length __vDSP_N );

    Parameters

    __vDSP_I

    Input vector, multiplied by the ramp function.

    __vDSP_IS

    Address stride length in input vector. For example, if __vDSP_IS is 2, every second element is used.

    __vDSP_Start

    The initial value for the ramp function. Modified on return to hold the next value (including accumulated errors) so that the ramp function can be continued smoothly.

    __vDSP_Step

    The value to increment each subsequent value of the ramp function by.

    __vDSP_O

    The output vector.

    __vDSP_OS

    Address stride length in output vector. For example, if __vDSP_IS is 2, every second element is modified.

    __vDSP_N

    The number of elements to modify.

    Discussion

    This routine calculates the following:

    • for (i = 0; i < N; ++i) {
    • O[i*OS] = *Start * I[i*IS];
    • *Start += *Step;
    • }

    The elements are fixed-point numbers, each with eight integer bits (including the sign bit) and 24 fraction bits. A value in this representation can be converted to floating-point by dividing it by 16777216.0.

    Import Statement

    Objective-C

    @import Accelerate;

    Swift

    import Accelerate

    Availability

    Available in iOS 4.0 and later.

  • Stereo version of vDSP_vrampmul.

    Declaration

    Swift

    func vDSP_vrampmul2(_ __vDSP_I0: UnsafePointer<Float>, _ __vDSP_I1: UnsafePointer<Float>, _ __vDSP_IS: vDSP_Stride, _ __vDSP_Start: UnsafeMutablePointer<Float>, _ __vDSP_Step: UnsafePointer<Float>, _ __vDSP_O0: UnsafeMutablePointer<Float>, _ __vDSP_O1: UnsafeMutablePointer<Float>, _ __vDSP_OS: vDSP_Stride, _ __vDSP_N: vDSP_Length)

    Objective-C

    void vDSP_vrampmul2 ( const float *__vDSP_I0, const float *__vDSP_I1, vDSP_Stride __vDSP_IS, float *__vDSP_Start, const float *__vDSP_Step, float *__vDSP_O0, float *__vDSP_O1, vDSP_Stride __vDSP_OS, vDSP_Length __vDSP_N );

    Parameters

    __vDSP_I0

    First input vector, multiplied by the ramp function.

    __vDSP_I1

    Second input vector, multiplied by the ramp function.

    __vDSP_IS

    Address stride length in input vectors. For example, if __vDSP_IS is 2, every second element is used.

    __vDSP_Start

    The initial value for the ramp function. Modified on return to hold the next value (including accumulated errors) so that the ramp function can be continued smoothly.

    __vDSP_Step

    The value to increment each subsequent value of the ramp function by.

    __vDSP_O0

    First output vector.

    __vDSP_O1

    Second output vector.

    __vDSP_OS

    Address stride length in output vector. For example, if __vDSP_IS is 2, every second element is modified.

    __vDSP_N

    The number of elements to modify.

    Discussion

    This function calculates the following:

    • for (i = 0; i < N; ++i) {
    • O0[i*OS] = *Start * I0[i*IS];
    • O1[i*OS] = *Start * I1[i*IS];
    • *Start += *Step;
    • }

    Import Statement

    Objective-C

    @import Accelerate;

    Swift

    import Accelerate

    Availability

    Available in iOS 4.0 and later.

  • Vector fixed-point 1.15 format version of vDSP_vrampmul2.

    Declaration

    Swift

    func vDSP_vrampmul2_s1_15(_ __vDSP_I0: UnsafePointer<Int16>, _ __vDSP_I1: UnsafePointer<Int16>, _ __vDSP_IS: vDSP_Stride, _ __vDSP_Start: UnsafeMutablePointer<Int16>, _ __vDSP_Step: UnsafePointer<Int16>, _ __vDSP_O0: UnsafeMutablePointer<Int16>, _ __vDSP_O1: UnsafeMutablePointer<Int16>, _ __vDSP_OS: vDSP_Stride, _ __vDSP_N: vDSP_Length)

    Objective-C

    void vDSP_vrampmul2_s1_15 ( const short *__vDSP_I0, const short *__vDSP_I1, vDSP_Stride __vDSP_IS, short *__vDSP_Start, const short *__vDSP_Step, short *__vDSP_O0, short *__vDSP_O1, vDSP_Stride __vDSP_OS, vDSP_Length __vDSP_N );

    Parameters

    __vDSP_I0

    First input vector, multiplied by the ramp function.

    __vDSP_I1

    Second input vector, multiplied by the ramp function.

    __vDSP_IS

    Address stride length in input vectors. For example, if __vDSP_IS is 2, every second element is used.

    __vDSP_Start

    The initial value for the ramp function. Modified on return to hold the next value (including accumulated errors) so that the ramp function can be continued smoothly.

    __vDSP_Step

    The value to increment each subsequent value of the ramp function by.

    __vDSP_O0

    First output vector.

    __vDSP_O1

    Second output vector.

    __vDSP_OS

    Address stride length in output vector. For example, if __vDSP_IS is 2, every second element is modified.

    __vDSP_N

    The number of elements to modify.

    Discussion

    This function calculates the following:

    • for (i = 0; i < N; ++i) {
    • O0[i*OS] = *Start * I0[i*IS];
    • O1[i*OS] = *Start * I1[i*IS];
    • *Start += *Step;
    • }

    The elements are fixed-point numbers, each with one sign bit and 15 fraction bits. A value in this representation can be converted to floating-point by dividing it by 32768.0.

    Import Statement

    Objective-C

    @import Accelerate;

    Swift

    import Accelerate

    Availability

    Available in iOS 4.0 and later.

  • Vector fixed-point 8.24 format version of vDSP_vrampmul2.

    Declaration

    Swift

    func vDSP_vrampmul2_s8_24(_ __vDSP_I0: UnsafePointer<Int32>, _ __vDSP_I1: UnsafePointer<Int32>, _ __vDSP_IS: vDSP_Stride, _ __vDSP_Start: UnsafeMutablePointer<Int32>, _ __vDSP_Step: UnsafePointer<Int32>, _ __vDSP_O0: UnsafeMutablePointer<Int32>, _ __vDSP_O1: UnsafeMutablePointer<Int32>, _ __vDSP_OS: vDSP_Stride, _ __vDSP_N: vDSP_Length)

    Objective-C

    void vDSP_vrampmul2_s8_24 ( const int *__vDSP_I0, const int *__vDSP_I1, vDSP_Stride __vDSP_IS, int *__vDSP_Start, const int *__vDSP_Step, int *__vDSP_O0, int *__vDSP_O1, vDSP_Stride __vDSP_OS, vDSP_Length __vDSP_N );

    Parameters

    __vDSP_I0

    First input vector, multiplied by the ramp function.

    __vDSP_I1

    Second input vector, multiplied by the ramp function.

    __vDSP_IS

    Address stride length in input vectors. For example, if __vDSP_IS is 2, every second element is used.

    __vDSP_Start

    The initial value for the ramp function. Modified on return to hold the next value (including accumulated errors) so that the ramp function can be continued smoothly.

    __vDSP_Step

    The value to increment each subsequent value of the ramp function by.

    __vDSP_O0

    First output vector.

    __vDSP_O1

    Second output vector.

    __vDSP_OS

    Address stride length in output vector. For example, if __vDSP_IS is 2, every second element is modified.

    __vDSP_N

    The number of elements to modify.

    Discussion

    This function calculates the following:

    • for (i = 0; i < N; ++i) {
    • O0[i*OS] = *Start * I0[i*IS];
    • O1[i*OS] = *Start * I1[i*IS];
    • *Start += *Step;
    • }

    The elements are fixed-point numbers, each with eight integer bits (including the sign bit) and 24 fraction bits. A value in this representation can be converted to floating-point by dividing it by 16777216.0.

    Import Statement

    Objective-C

    @import Accelerate;

    Swift

    import Accelerate

    Availability

    Available in iOS 4.0 and later.

  • Builds a ramped vector, multiplies it by a source vector, and adds the result to the output vector.

    Declaration

    Swift

    func vDSP_vrampmuladd(_ __vDSP_I: UnsafePointer<Float>, _ __vDSP_IS: vDSP_Stride, _ __vDSP_Start: UnsafeMutablePointer<Float>, _ __vDSP_Step: UnsafePointer<Float>, _ __vDSP_O: UnsafeMutablePointer<Float>, _ __vDSP_OS: vDSP_Stride, _ __vDSP_N: vDSP_Length)

    Objective-C

    void vDSP_vrampmuladd ( const float *__vDSP_I, vDSP_Stride __vDSP_IS, float *__vDSP_Start, const float *__vDSP_Step, float *__vDSP_O, vDSP_Stride __vDSP_OS, vDSP_Length __vDSP_N );

    Parameters

    __vDSP_I

    Input vector, multiplied by the ramp function.

    __vDSP_IS

    Address stride length in input vector. For example, if __vDSP_IS is 2, every second element is used.

    __vDSP_Start

    The initial value for the ramp function. Modified on return to hold the next value (including accumulated errors) so that the ramp function can be continued smoothly.

    __vDSP_Step

    The value to increment each subsequent value of the ramp function by.

    __vDSP_O

    The output vector.

    __vDSP_OS

    Address stride length in output vector. For example, if __vDSP_IS is 2, every second element is modified.

    __vDSP_N

    The number of elements to modify.

    Discussion

    This routine calculates the following:

    • for (i = 0; i < N; ++i) {
    • O[i*OS] += *Start * I[i*IS];
    • *Start += *Step;
    • }

    Import Statement

    Objective-C

    @import Accelerate;

    Swift

    import Accelerate

    Availability

    Available in iOS 4.0 and later.

  • Vector fixed-point 1.15 format version of vDSP_vrampmuladd.

    Declaration

    Swift

    func vDSP_vrampmuladd_s1_15(_ __vDSP_I: UnsafePointer<Int16>, _ __vDSP_IS: vDSP_Stride, _ __vDSP_Start: UnsafeMutablePointer<Int16>, _ __vDSP_Step: UnsafePointer<Int16>, _ __vDSP_O: UnsafeMutablePointer<Int16>, _ __vDSP_OS: vDSP_Stride, _ __vDSP_N: vDSP_Length)

    Objective-C

    void vDSP_vrampmuladd_s1_15 ( const short *__vDSP_I, vDSP_Stride __vDSP_IS, short *__vDSP_Start, const short *__vDSP_Step, short *__vDSP_O, vDSP_Stride __vDSP_OS, vDSP_Length __vDSP_N );

    Parameters

    __vDSP_I

    Input vector, multiplied by the ramp function.

    __vDSP_IS

    Address stride length in input vector. For example, if __vDSP_IS is 2, every second element is used.

    __vDSP_Start

    The initial value for the ramp function. Modified on return to hold the next value (including accumulated errors) so that the ramp function can be continued smoothly.

    __vDSP_Step

    The value to increment each subsequent value of the ramp function by.

    __vDSP_O

    The output vector.

    __vDSP_OS

    Address stride length in output vector. For example, if __vDSP_IS is 2, every second element is modified.

    __vDSP_N

    The number of elements to modify.

    Discussion

    This routine calculates the following:

    • for (i = 0; i < N; ++i) {
    • O[i*OS] += *Start * I[i*IS];
    • *Start += *Step;
    • }

    The elements are fixed-point numbers, each with one sign bit and 15 fraction bits. A value in this representation can be converted to floating-point by dividing it by 32768.0.

    Import Statement

    Objective-C

    @import Accelerate;

    Swift

    import Accelerate

    Availability

    Available in iOS 4.0 and later.

  • Vector fixed-point 8.24 format version of vDSP_vrampmuladd.

    Declaration

    Swift

    func vDSP_vrampmuladd_s8_24(_ __vDSP_I: UnsafePointer<Int32>, _ __vDSP_IS: vDSP_Stride, _ __vDSP_Start: UnsafeMutablePointer<Int32>, _ __vDSP_Step: UnsafePointer<Int32>, _ __vDSP_O: UnsafeMutablePointer<Int32>, _ __vDSP_OS: vDSP_Stride, _ __vDSP_N: vDSP_Length)

    Objective-C

    void vDSP_vrampmuladd_s8_24 ( const int *__vDSP_I, vDSP_Stride __vDSP_IS, int *__vDSP_Start, const int *__vDSP_Step, int *__vDSP_O, vDSP_Stride __vDSP_OS, vDSP_Length __vDSP_N );

    Parameters

    __vDSP_I

    Input vector, multiplied by the ramp function.

    __vDSP_IS

    Address stride length in input vector. For example, if __vDSP_IS is 2, every second element is used.

    __vDSP_Start

    The initial value for the ramp function. Modified on return to hold the next value (including accumulated errors) so that the ramp function can be continued smoothly.

    __vDSP_Step

    The value to increment each subsequent value of the ramp function by.

    __vDSP_O

    The output vector.

    __vDSP_OS

    Address stride length in output vector. For example, if __vDSP_IS is 2, every second element is modified.

    __vDSP_N

    The number of elements to modify.

    Discussion

    This routine calculates the following:

    • for (i = 0; i < N; ++i) {
    • O[i*OS] += *Start * I[i*IS];
    • *Start += *Step;
    • }

    The elements are fixed-point numbers, each with eight integer bits (including the sign bit) and 24 fraction bits. A value in this representation can be converted to floating-point by dividing it by 16777216.0.

    Import Statement

    Objective-C

    @import Accelerate;

    Swift

    import Accelerate

    Availability

    Available in iOS 4.0 and later.

  • Stereo version of vDSP_vrampmuladd.

    Declaration

    Swift

    func vDSP_vrampmuladd2(_ __vDSP_I0: UnsafePointer<Float>, _ __vDSP_I1: UnsafePointer<Float>, _ __vDSP_IS: vDSP_Stride, _ __vDSP_Start: UnsafeMutablePointer<Float>, _ __vDSP_Step: UnsafePointer<Float>, _ __vDSP_O0: UnsafeMutablePointer<Float>, _ __vDSP_O1: UnsafeMutablePointer<Float>, _ __vDSP_OS: vDSP_Stride, _ __vDSP_N: vDSP_Length)

    Objective-C

    void vDSP_vrampmuladd2 ( const float *__vDSP_I0, const float *__vDSP_I1, vDSP_Stride __vDSP_IS, float *__vDSP_Start, const float *__vDSP_Step, float *__vDSP_O0, float *__vDSP_O1, vDSP_Stride __vDSP_OS, vDSP_Length __vDSP_N );

    Parameters

    __vDSP_I0

    First input vector, multiplied by the ramp function.

    __vDSP_I1

    Second input vector, multiplied by the ramp function.

    __vDSP_IS

    Address stride length in input vectors. For example, if __vDSP_IS is 2, every second element is used.

    __vDSP_Start

    The initial value for the ramp function. Modified on return to hold the next value (including accumulated errors) so that the ramp function can be continued smoothly.

    __vDSP_Step

    The value to increment each subsequent value of the ramp function by.

    __vDSP_O0

    First output vector.

    __vDSP_O1

    Second output vector.

    __vDSP_OS

    Address stride length in output vector. For example, if __vDSP_IS is 2, every second element is modified.

    __vDSP_N

    The number of elements to modify.

    Discussion

    This function calculates the following:

    • for (i = 0; i < N; ++i) {
    • O0[i*OS] += *Start * I0[i*IS];
    • O1[i*OS] += *Start * I1[i*IS];
    • *Start += *Step;
    • }

    Import Statement

    Objective-C

    @import Accelerate;

    Swift

    import Accelerate

    Availability

    Available in iOS 4.0 and later.

  • Vector fixed-point 1.15 format version of vDSP_vrampmuladd2.

    Declaration

    Swift

    func vDSP_vrampmuladd2_s1_15(_ __vDSP_I0: UnsafePointer<Int16>, _ __vDSP_I1: UnsafePointer<Int16>, _ __vDSP_IS: vDSP_Stride, _ __vDSP_Start: UnsafeMutablePointer<Int16>, _ __vDSP_Step: UnsafePointer<Int16>, _ __vDSP_O0: UnsafeMutablePointer<Int16>, _ __vDSP_O1: UnsafeMutablePointer<Int16>, _ __vDSP_OS: vDSP_Stride, _ __vDSP_N: vDSP_Length)

    Objective-C

    void vDSP_vrampmuladd2_s1_15 ( const short *__vDSP_I0, const short *__vDSP_I1, vDSP_Stride __vDSP_IS, short *__vDSP_Start, const short *__vDSP_Step, short *__vDSP_O0, short *__vDSP_O1, vDSP_Stride __vDSP_OS, vDSP_Length __vDSP_N );

    Parameters

    __vDSP_I0

    First input vector, multiplied by the ramp function.

    __vDSP_I1

    Second input vector, multiplied by the ramp function.

    __vDSP_IS

    Address stride length in input vectors. For example, if __vDSP_IS is 2, every second element is used.

    __vDSP_Start

    The initial value for the ramp function. Modified on return to hold the next value (including accumulated errors) so that the ramp function can be continued smoothly.

    __vDSP_Step

    The value to increment each subsequent value of the ramp function by.

    __vDSP_O0

    First output vector.

    __vDSP_O1

    Second output vector.

    __vDSP_OS

    Address stride length in output vector. For example, if __vDSP_IS is 2, every second element is modified.

    __vDSP_N

    The number of elements to modify.

    Discussion

    This function calculates the following:

    • for (i = 0; i < N; ++i) {
    • O0[i*OS] += *Start * I0[i*IS];
    • O1[i*OS] += *Start * I1[i*IS];
    • *Start += *Step;
    • }

    The elements are fixed-point numbers, each with one sign bit and 15 fraction bits. A value in this representation can be converted to floating-point by dividing it by 32768.0.

    Import Statement

    Objective-C

    @import Accelerate;

    Swift

    import Accelerate

    Availability

    Available in iOS 4.0 and later.

  • Vector fixed-point 8.24 format version of vDSP_vrampmuladd2.

    Declaration

    Swift

    func vDSP_vrampmuladd2_s8_24(_ __vDSP_I0: UnsafePointer<Int32>, _ __vDSP_I1: UnsafePointer<Int32>, _ __vDSP_IS: vDSP_Stride, _ __vDSP_Start: UnsafeMutablePointer<Int32>, _ __vDSP_Step: UnsafePointer<Int32>, _ __vDSP_O0: UnsafeMutablePointer<Int32>, _ __vDSP_O1: UnsafeMutablePointer<Int32>, _ __vDSP_OS: vDSP_Stride, _ __vDSP_N: vDSP_Length)

    Objective-C

    void vDSP_vrampmuladd2_s8_24 ( const int *__vDSP_I0, const int *__vDSP_I1, vDSP_Stride __vDSP_IS, int *__vDSP_Start, const int *__vDSP_Step, int *__vDSP_O0, int *__vDSP_O1, vDSP_Stride __vDSP_OS, vDSP_Length __vDSP_N );

    Parameters

    __vDSP_I0

    First input vector, multiplied by the ramp function.

    __vDSP_I1

    Second input vector, multiplied by the ramp function.

    __vDSP_IS

    Address stride length in input vectors. For example, if __vDSP_IS is 2, every second element is used.

    __vDSP_Start

    The initial value for the ramp function. Modified on return to hold the next value (including accumulated errors) so that the ramp function can be continued smoothly.

    __vDSP_Step

    The value to increment each subsequent value of the ramp function by.

    __vDSP_O0

    First output vector.

    __vDSP_O1

    Second output vector.

    __vDSP_OS

    Address stride length in output vector. For example, if __vDSP_IS is 2, every second element is modified.

    __vDSP_N

    The number of elements to modify.

    Discussion

    This function calculates the following:

    • for (i = 0; i < N; ++i) {
    • O0[i*OS] += *Start * I0[i*IS];
    • O1[i*OS] += *Start * I1[i*IS];
    • *Start += *Step;
    • }

    The elements are fixed-point numbers, each with eight integer bits (including the sign bit) and 24 fraction bits. A value in this representation can be converted to floating-point by dividing it by 16777216.0.

    Import Statement

    Objective-C

    @import Accelerate;

    Swift

    import Accelerate

    Availability

    Available in iOS 4.0 and later.

  • Vector tapered ramp; single precision.

    Declaration

    Swift

    func vDSP_vgen(_ __vDSP_A: UnsafePointer<Float>, _ __vDSP_B: UnsafePointer<Float>, _ __vDSP_C: UnsafeMutablePointer<Float>, _ __vDSP_K: vDSP_Stride, _ __vDSP_N: vDSP_Length)

    Objective-C

    void vDSP_vgen ( const float *__vDSP_A, const float *__vDSP_B, float *__vDSP_C, vDSP_Stride __vDSP_IC, vDSP_Length __vDSP_N );

    Parameters

    __vDSP_A

    Single-precision real input scalar: base value.

    __vDSP_B

    Single-precision real input scalar: end value.

    __vDSP_C

    Single-precision real output vector.

    __vDSP_K

    Address stride for C.

    __vDSP_N

    The number of elements to process.

    Discussion

    Performs the following operation:

    image: ../art/vdsp_114.eps

    Creates ramped vector C with element zero equal to scalar A and element N-1 equal to scalar B. Output values between element zero and element N-1 are evenly spaced and increase or decrease monotonically.

    Import Statement

    Objective-C

    @import Accelerate;

    Swift

    import Accelerate

    Availability

    Available in iOS 4.0 and later.

  • Vector tapered ramp; double precision.

    Declaration

    Swift

    func vDSP_vgenD(_ __vDSP_A: UnsafePointer<Double>, _ __vDSP_B: UnsafePointer<Double>, _ __vDSP_C: UnsafeMutablePointer<Double>, _ __vDSP_K: vDSP_Stride, _ __vDSP_N: vDSP_Length)

    Objective-C

    void vDSP_vgenD ( const double *__vDSP_A, const double *__vDSP_B, double *__vDSP_C, vDSP_Stride __vDSP_IC, vDSP_Length __vDSP_N );

    Parameters

    __vDSP_A

    Double-precision real input scalar: base value

    __vDSP_B

    Double-precision real input scalar: end value.

    __vDSP_C

    Double-precision real output vector.

    __vDSP_K

    Address stride for C.

    __vDSP_N

    The number of elements to process.

    Discussion

    Performs the following operation:

    image: ../art/vdsp_114.eps

    Creates ramped vector C with element zero equal to scalar A and element N-1 equal to scalar B. Output values between element zero and element N-1 are evenly spaced and increase or decrease monotonically.

    Import Statement

    Objective-C

    @import Accelerate;

    Swift

    import Accelerate

    Availability

    Available in iOS 4.0 and later.

  • Vector generate by extrapolation and interpolation; single precision.

    Declaration

    Swift

    func vDSP_vgenp(_ __vDSP_A: UnsafePointer<Float>, _ __vDSP_I: vDSP_Stride, _ __vDSP_B: UnsafePointer<Float>, _ __vDSP_J: vDSP_Stride, _ __vDSP_C: UnsafeMutablePointer<Float>, _ __vDSP_K: vDSP_Stride, _ __vDSP_N: vDSP_Length, _ __vDSP_M: vDSP_Length)

    Objective-C

    void vDSP_vgenp ( const float *__vDSP_A, vDSP_Stride __vDSP_IA, const float *__vDSP_B, vDSP_Stride __vDSP_IB, float *__vDSP_C, vDSP_Stride __vDSP_IC, vDSP_Length __vDSP_N, vDSP_Length __vDSP_M );

    Parameters

    __vDSP_A

    Single-precision real input vector.

    __vDSP_I

    Address stride for A.

    __vDSP_B

    Single-precision real input vector.

    __vDSP_J

    Address stride for B.

    __vDSP_C

    Single-precision real output vector.

    __vDSP_K

    Address stride for C.

    __vDSP_N

    Element count for C.

    __vDSP_M

    Element count for A and B.

    Discussion

    Performs the following operation:

    image: ../art/vdsp_115.eps

    Generates vector C by extrapolation and linear interpolation from the ordered pairs (A,B) provided by corresponding elements in vectors A and B. Vector B provides index values and should increase monotonically. Vector A provides intensities, magnitudes, or some other measurable quantities, one value associated with each value of B. This function can only be done out of place.

    Vectors A and B define a piecewise linear function, f(x):

    • In the interval [-infinity, trunc(B[0*J]], the function is the constant A[0*I].

    • In each interval (trunc(B[m*J]), trunc(B[(m+1)*J])], the function is the line passing through the two points (B[m*J], A[m*I]) and (B[(m+1)*J], A[(m+1)*I]). (This is for each integer m, 0 <= m < M-1.)

    • In the interval (B[(M-1)*J], infinity], the function is the constant A[(M-1)*I].

    • For 0 <= n < N, C[n*K] = f(n).

    This function can only be done out of place.

    Output values are generated for integral indices in the range zero through N - 1, deriving output values by interpolating and extrapolating from vectors A and B. For example, if vectors A and B define velocity and time pairs (v, t), vDSP_vgenp writes one velocity to vector C for every integral unit of time from zero to N - 1.

    Import Statement

    Objective-C

    @import Accelerate;

    Swift

    import Accelerate

    Availability

    Available in iOS 4.0 and later.

  • Vector generate by extrapolation and interpolation; double precision.

    Declaration

    Swift

    func vDSP_vgenpD(_ __vDSP_A: UnsafePointer<Double>, _ __vDSP_I: vDSP_Stride, _ __vDSP_B: UnsafePointer<Double>, _ __vDSP_J: vDSP_Stride, _ __vDSP_C: UnsafeMutablePointer<Double>, _ __vDSP_K: vDSP_Stride, _ __vDSP_N: vDSP_Length, _ __vDSP_M: vDSP_Length)

    Objective-C

    void vDSP_vgenpD ( const double *__vDSP_A, vDSP_Stride __vDSP_IA, const double *__vDSP_B, vDSP_Stride __vDSP_IB, double *__vDSP_C, vDSP_Stride __vDSP_IC, vDSP_Length __vDSP_N, vDSP_Length __vDSP_M );

    Parameters

    __vDSP_A

    Double-precision real input vector.

    __vDSP_I

    Address stride for A.

    __vDSP_B

    Double-precision real input vector.

    __vDSP_J

    Address stride for B.

    __vDSP_C

    Double-precision real output vector.

    __vDSP_K

    Address stride for C.

    __vDSP_N

    Element count for C.

    __vDSP_M

    Element count for A and B.

    Discussion

    Performs the following operation:

    image: ../art/vdsp_115.eps

    Generates vector C by extrapolation and linear interpolation from the ordered pairs (A,B) provided by corresponding elements in vectors A and B. Vector B provides index values and should increase monotonically. Vector A provides intensities, magnitudes, or some other measurable quantities, one value associated with each value of B. This function can only be done out of place.

    Vectors A and B define a piecewise linear function, f(x):

    • In the interval [-infinity, trunc(B[0*J]], the function is the constant A[0*I].

    • In each interval (trunc(B[m*J]), trunc(B[(m+1)*J])], the function is the line passing through the two points (B[m*J], A[m*I]) and (B[(m+1)*J], A[(m+1)*I]). (This is for each integer m, 0 <= m < M-1.)

    • In the interval (B[(M-1)*J], infinity], the function is the constant A[(M-1)*I].

    • For 0 <= n < N, C[n*K] = f(n).

    This function can only be done out of place.

    Output values are generated for integral indices in the range zero through N - 1, deriving output values by interpolating and extrapolating from vectors A and B. For example, if vectors A and B define velocity and time pairs (v, t), vDSP_vgenp writes one velocity to vector C for every integral unit of time from zero to N - 1.

    Import Statement

    Objective-C

    @import Accelerate;

    Swift

    import Accelerate

    Availability

    Available in iOS 4.0 and later.

  • Vector interpolation, table lookup; single precision.

    Declaration

    Swift

    func vDSP_vtabi(_ __vDSP_A: UnsafePointer<Float>, _ __vDSP_I: vDSP_Stride, _ __vDSP_S1: UnsafePointer<Float>, _ __vDSP_S2: UnsafePointer<Float>, _ __vDSP_C: UnsafePointer<Float>, _ __vDSP_M: vDSP_Length, _ __vDSP_D: UnsafeMutablePointer<Float>, _ __vDSP_L: vDSP_Stride, _ __vDSP_N: vDSP_Length)

    Objective-C

    void vDSP_vtabi ( const float *__vDSP_A, vDSP_Stride __vDSP_IA, const float *__vDSP_S1, const float *__vDSP_S2, const float *__vDSP_C, vDSP_Length __vDSP_M, float *__vDSP_D, vDSP_Stride __vDSP_ID, vDSP_Length __vDSP_N );

    Parameters

    __vDSP_A

    Single-precision real input vector.

    __vDSP_I

    Address stride for A.

    __vDSP_S1

    Single-precision real input scalar: scale factor.

    __vDSP_S2

    Single-precision real input scalar: base offset.

    __vDSP_C

    Single-precision real input vector: lookup table.

    __vDSP_M

    Lookup table size.

    __vDSP_D

    Single-precision real output vector.

    __vDSP_L

    Stride for D

    __vDSP_N

    The number of elements to write to D.

    Discussion

    Performs the following operation:

    image: ../art/vdsp_145.eps

    where F is scaling factor __vDSP_S1 and G is scaling factor __vDSP_S2.

    Evaluates elements of vector A for use as offsets into vector C. Vector C is a zero-based lookup table supplied by the caller that generates output values for vector D. Linear interpolation is used to compute output values when an offset is not an integer. Scale factor S1 and base offset S2 map the anticipated range of input values to the range of the lookup table and are typically assigned values such that:

    • floor(F * minimum input value + G) = 0
    • floor(F * maximum input value + G) = M-1

    If an offset is less than zero or greater than M-1, C[0] or C[M-1] is written to the output, respectively. For inputs that evaluate integrally, the table location indexed by the integral is copied as the output value.

    Import Statement

    Objective-C

    @import Accelerate;

    Swift

    import Accelerate

    Availability

    Available in iOS 4.0 and later.

  • Vector interpolation, table lookup; double precision.

    Declaration

    Swift

    func vDSP_vtabiD(_ __vDSP_A: UnsafePointer<Double>, _ __vDSP_I: vDSP_Stride, _ __vDSP_S1: UnsafePointer<Double>, _ __vDSP_S2: UnsafePointer<Double>, _ __vDSP_C: UnsafePointer<Double>, _ __vDSP_M: vDSP_Length, _ __vDSP_D: UnsafeMutablePointer<Double>, _ __vDSP_L: vDSP_Stride, _ __vDSP_N: vDSP_Length)

    Objective-C

    void vDSP_vtabiD ( const double *__vDSP_A, vDSP_Stride __vDSP_IA, const double *__vDSP_S1, const double *__vDSP_S2, const double *__vDSP_C, vDSP_Length __vDSP_M, double *__vDSP_ID, vDSP_Stride __vDSP_L, vDSP_Length __vDSP_N );

    Parameters

    __vDSP_A

    Double-precision real input vector.

    __vDSP_I

    Address stride for A.

    __vDSP_S1

    Double-precision real input scalar: scale factor.

    __vDSP_S2

    Double-precision real input scalar: base offset.

    __vDSP_C

    Double-precision real input vector: lookup table

    __vDSP_M

    Lookup table size.

    __vDSP_D

    Double-precision real output vector.

    __vDSP_L

    Address stride for D.

    __vDSP_N

    The number of elements to write to D.

    Discussion

    Performs the following operation:

    image: ../art/vdsp_145.eps

    Evaluates elements of vector A for use as offsets into vector C. Vector C is a zero-based lookup table supplied by the caller that generates output values for vector D. Linear interpolation is used to compute output values when an offset is not an integer. Scale factor S1 and base offset S2 map the anticipated range of input values to the range of the lookup table and are typically assigned values such that:

    • floor(F * minimum input value + G) = 0
    • floor(F * maximum input value + G) = M-1

    If an offset is less than zero or greater than M-1, C[0] or C[M-1] is written to the output, respectively. For inputs that evaluate integrally, the table location indexed by the integral is copied as the output value.

    Import Statement

    Objective-C

    @import Accelerate;

    Swift

    import Accelerate

    Availability

    Available in iOS 4.0 and later.

The functions in this group computes the square of each element in a vector or the square of the magnitude of each element in a complex vector.

  • Computes the squared values of vector input and leaves the result in vector result; single precision.

    Declaration

    Swift

    func vDSP_vsq(_ __vDSP_input: UnsafePointer<Float>, _ __vDSP_strideInput: vDSP_Stride, _ __vDSP_result: UnsafeMutablePointer<Float>, _ __vDSP_strideResult: vDSP_Stride, _ __vDSP_size: vDSP_Length)

    Objective-C

    void vDSP_vsq ( const float *__vDSP_A, vDSP_Stride __vDSP_IA, float *__vDSP_C, vDSP_Stride __vDSP_IC, vDSP_Length __vDSP_N );

    Parameters

    __vDSP_input

    Single-precision real input vector. Maps to A in discussion.

    __vDSP_strideInput

    Address stride for __vDSP_input. Maps to I in discussion.

    __vDSP_result

    Single-precision real output vector. Maps to C in the discussion.

    __vDSP_strideResult

    Address stride for __vDSP_result. Maps to K in discussion.

    __vDSP_size

    The number of elements to process. Maps to N in discussion.

    Discussion

    This performs the following operation:

    image: ../art/vdsp_34.eps

    where A is __vDSP_input, N is __vDSP_size, I is __vDSP_strideInput, and K is __vDSP_strideResult.

    Import Statement

    Objective-C

    @import Accelerate;

    Swift

    import Accelerate

    Availability

    Available in iOS 4.0 and later.

  • Computes the squared values of vector __vDSP_input and leaves the result in vector result; double precision.

    Declaration

    Swift

    func vDSP_vsqD(_ __vDSP_input: UnsafePointer<Double>, _ __vDSP_strideInput: vDSP_Stride, _ __vDSP_result: UnsafeMutablePointer<Double>, _ __vDSP_strideResult: vDSP_Stride, _ __vDSP_size: vDSP_Length)

    Objective-C

    void vDSP_vsqD ( const double *__vDSP_A, vDSP_Stride __vDSP_IA, double *__vDSP_C, vDSP_Stride __vDSP_IC, vDSP_Length __vDSP_N );

    Parameters

    __vDSP_input

    Double-precision real input vector. Maps to A in discussion.

    __vDSP_strideInput

    Address stride for __vDSP_input. Maps to I in the discussion.

    __vDSP_result

    Double-precision real output vector. Maps to C in the discussion.

    __vDSP_strideResult

    Address stride for __vDSP_result. Maps to K in discussion.

    __vDSP_size

    The number of elements to process. Maps to N in the discussion.

    Discussion

    This performs the following operation:

    image: ../art/vdsp_34.eps

    where A is __vDSP_input, N is __vDSP_size, I is __vDSP_strideInput, and K is __vDSP_strideResult.

    Import Statement

    Objective-C

    @import Accelerate;

    Swift

    import Accelerate

    Availability

    Available in iOS 4.0 and later.

  • Computes the signed squares of vector __vDSP_input and leaves the result in vector result; single precision.

    Declaration

    Swift

    func vDSP_vssq(_ __vDSP_input: UnsafePointer<Float>, _ __vDSP_strideInput: vDSP_Stride, _ __vDSP_result: UnsafeMutablePointer<Float>, _ __vDSP_strideResult: vDSP_Stride, _ __vDSP_size: vDSP_Length)

    Objective-C

    void vDSP_vssq ( const float *__vDSP_A, vDSP_Stride __vDSP_IA, float *__vDSP_C, vDSP_Stride __vDSP_IC, vDSP_Length __vDSP_N );

    Parameters

    __vDSP_input

    Single-precision real input vector. Maps to A in the discussion.

    __vDSP_strideInput

    Address stride for __vDSP_input. Maps to I in the discussion.

    __vDSP_result

    Single-precision real output vector. Maps to C in the discussion.

    __vDSP_strideResult

    Address stride for __vDSP_result. Maps to K in the discussion.

    __vDSP_size

    The number of elements to process. Maps to N in the discussion.

    Discussion

    This performs the following operation:

    image: ../art/vdsp_35.eps

    where A is __vDSP_input, N is __vDSP_size, I is __vDSP_strideInput, and K is __vDSP_strideResult.

    Import Statement

    Objective-C

    @import Accelerate;

    Swift

    import Accelerate

    Availability

    Available in iOS 4.0 and later.

  • Computes the signed squares of vector __vDSP_input and leaves the result in vector result; double precision.

    Declaration

    Swift

    func vDSP_vssqD(_ __vDSP_input: UnsafePointer<Double>, _ __vDSP_strideInput: vDSP_Stride, _ __vDSP_result: UnsafeMutablePointer<Double>, _ __vDSP_strideResult: vDSP_Stride, _ __vDSP_size: vDSP_Length)

    Objective-C

    void vDSP_vssqD ( const double *__vDSP_A, vDSP_Stride __vDSP_IA, double *__vDSP_C, vDSP_Stride __vDSP_IC, vDSP_Length __vDSP_N );

    Parameters

    __vDSP_input

    Double-precision real input vector. Maps to A in the discussion.

    __vDSP_strideInput

    Address stride for __vDSP_input. Maps to I in the discussion.

    __vDSP_result

    Double-precision real output vector. Maps to C in the discussion.

    __vDSP_strideResult

    Address stride for __vDSP_result. Maps to K in the discussion.

    __vDSP_size

    The number of elements to process. Maps to N in the discussion.

    Discussion

    This performs the following operation:

    image: ../art/vdsp_35.eps

    where A is __vDSP_input, N is __vDSP_size, I is __vDSP_strideInput, and K is __vDSP_strideResult.

    Import Statement

    Objective-C

    @import Accelerate;

    Swift

    import Accelerate

    Availability

    Available in iOS 4.0 and later.

  • Complex vector magnitudes squared; single precision.

    Declaration

    Swift

    func vDSP_zvmags(_ __vDSP_A: UnsafePointer<DSPSplitComplex>, _ __vDSP_I: vDSP_Stride, _ __vDSP_C: UnsafeMutablePointer<Float>, _ __vDSP_K: vDSP_Stride, _ __vDSP_N: vDSP_Length)

    Objective-C

    void vDSP_zvmags ( const DSPSplitComplex *__vDSP_A, vDSP_Stride __vDSP_IA, float *__vDSP_C, vDSP_Stride __vDSP_IC, vDSP_Length __vDSP_N );

    Parameters

    __vDSP_A

    Single-precision complex input vector.

    __vDSP_I

    Address stride for A.

    __vDSP_C

    Single-precision real output vector.

    __vDSP_K

    Address stride for C.

    __vDSP_N

    The number of elements to process.

    Discussion

    Calculates the squared magnitudes of complex vector A.

    image: ../art/vdsp_104.eps

    where Re are the real parts of __vDSP_input and Im are the imaginary parts.

    Import Statement

    Objective-C

    @import Accelerate;

    Swift

    import Accelerate

    Availability

    Available in iOS 4.0 and later.

  • Complex vector magnitudes squared; double precision.

    Declaration

    Swift

    func vDSP_zvmagsD(_ __vDSP_A: UnsafePointer<DSPDoubleSplitComplex>, _ __vDSP_I: vDSP_Stride, _ __vDSP_C: UnsafeMutablePointer<Double>, _ __vDSP_K: vDSP_Stride, _ __vDSP_N: vDSP_Length)

    Objective-C

    void vDSP_zvmagsD ( const DSPDoubleSplitComplex *__vDSP_A, vDSP_Stride __vDSP_IA, double *__vDSP_C, vDSP_Stride __vDSP_IC, vDSP_Length __vDSP_N );

    Parameters

    __vDSP_A

    Double-precision complex input vector.

    __vDSP_I

    Address stride for A.

    __vDSP_C

    Double-precision real output vector.

    __vDSP_K

    Stride for C

    __vDSP_N

    The number of elements to process

    Discussion

    Calculates the squared magnitudes of complex vector A.

    image: ../art/vdsp_104.eps

    where Re are the real parts of __vDSP_input and Im are the imaginary parts.

    Import Statement

    Objective-C

    @import Accelerate;

    Swift

    import Accelerate

    Availability

    Available in iOS 4.0 and later.

  • Complex vector magnitudes square and add; single precision.

    Declaration

    Swift

    func vDSP_zvmgsa(_ __vDSP_A: UnsafePointer<DSPSplitComplex>, _ __vDSP_I: vDSP_Stride, _ __vDSP_B: UnsafePointer<Float>, _ __vDSP_J: vDSP_Stride, _ __vDSP_C: UnsafeMutablePointer<Float>, _ __vDSP_K: vDSP_Stride, _ __vDSP_N: vDSP_Length)

    Objective-C

    void vDSP_zvmgsa ( const DSPSplitComplex *__vDSP_A, vDSP_Stride __vDSP_IA, const float *__vDSP_B, vDSP_Stride __vDSP_IB, float *__vDSP_C, vDSP_Stride __vDSP_IC, vDSP_Length __vDSP_N );

    Parameters

    __vDSP_A

    Single-precision complex input vector

    __vDSP_I

    Stride for A

    __vDSP_B

    Single-precision real input vector

    __vDSP_J

    Stride for B

    __vDSP_C

    Single-precision real output vector

    __vDSP_K

    Stride for C

    __vDSP_N

    The number of elements to process

    Discussion

    Adds the squared magnitudes of complex vector A to real vector B and store the results in real vector C.

    image: ../art/vdsp_105.eps

    where Re are the real parts of __vDSP_input and Im are the imaginary parts.

    Import Statement

    Objective-C

    @import Accelerate;

    Swift

    import Accelerate

    Availability

    Available in iOS 4.0 and later.

  • Complex vector magnitudes square and add; double precision.

    Declaration

    Swift

    func vDSP_zvmgsaD(_ __vDSP_A: UnsafePointer<DSPDoubleSplitComplex>, _ __vDSP_I: vDSP_Stride, _ __vDSP_B: UnsafePointer<Double>, _ __vDSP_J: vDSP_Stride, _ __vDSP_C: UnsafeMutablePointer<Double>, _ __vDSP_K: vDSP_Stride, _ __vDSP_N: vDSP_Length)

    Objective-C

    void vDSP_zvmgsaD ( const DSPDoubleSplitComplex *__vDSP_A, vDSP_Stride __vDSP_IA, const double *__vDSP_B, vDSP_Stride __vDSP_IB, double *__vDSP_C, vDSP_Stride __vDSP_IC, vDSP_Length __vDSP_N );

    Parameters

    __vDSP_A

    Double-precision complex input vector

    __vDSP_I

    Stride for A

    __vDSP_B

    Double-precision real input vector

    __vDSP_J

    Stride for B

    __vDSP_C

    Double-precision real output vector

    __vDSP_K

    Stride for C

    __vDSP_N

    The number of elements to process

    Discussion

    Adds the squared magnitudes of complex vector A to real vector B and store the results in real vector C.

    image: ../art/vdsp_105.eps

    Import Statement

    Objective-C

    @import Accelerate;

    Swift

    import Accelerate

    Availability

    Available in iOS 4.0 and later.

The functions in this group convert each element in a vector between rectangular and polar coordinates.

  • Rectangular to polar conversion; single precision.

    Declaration

    Swift

    func vDSP_polar(_ __vDSP_A: UnsafePointer<Float>, _ __vDSP_I: vDSP_Stride, _ __vDSP_C: UnsafeMutablePointer<Float>, _ __vDSP_K: vDSP_Stride, _ __vDSP_N: vDSP_Length)

    Objective-C

    void vDSP_polar ( const float *__vDSP_A, vDSP_Stride __vDSP_IA, float *__vDSP_C, vDSP_Stride __vDSP_IC, vDSP_Length __vDSP_N );

    Parameters

    __vDSP_A

    Single-precision real input vector

    __vDSP_I

    Stride for A, must be even

    __vDSP_C

    Single-precision output vector

    __vDSP_K

    Stride for C, must be even

    __vDSP_N

    Number of ordered pairs processed

    Discussion

    This performs the following operation:

    image: ../art/vdsp_72.eps

    Converts rectangular coordinates to polar coordinates. Cartesian (x,y) pairs are read from vector A. Polar (rho, theta) pairs, where rho is the radius and theta is the angle in the range [-pi, pi] are written to vector C. N specifies the number of coordinate pairs in A and C.

    Coordinate pairs are adjacent elements in the array, regardless of stride; stride is the distance from one coordinate pair to the next.

    This function performs the inverse operation of vDSP_rect, which converts polar to rectangular coordinates.

    Import Statement

    Objective-C

    @import Accelerate;

    Swift

    import Accelerate

    Availability

    Available in iOS 4.0 and later.

  • Rectangular to polar conversion; double precision.

    Declaration

    Swift

    func vDSP_polarD(_ __vDSP_A: UnsafePointer<Double>, _ __vDSP_I: vDSP_Stride, _ __vDSP_C: UnsafeMutablePointer<Double>, _ __vDSP_K: vDSP_Stride, _ __vDSP_N: vDSP_Length)

    Objective-C

    void vDSP_polarD ( const double *__vDSP_A, vDSP_Stride __vDSP_IA, double *__vDSP_C, vDSP_Stride __vDSP_IC, vDSP_Length __vDSP_N );

    Parameters

    __vDSP_A

    Double-precision real input vector

    __vDSP_I

    Stride for A, must be even

    __vDSP_C

    Double-precision output vector

    __vDSP_K

    Stride for C, must be even

    __vDSP_N

    Number of ordered pairs processed

    Discussion

    This performs the following operation:

    image: ../art/vdsp_72.eps

    Converts rectangular coordinates to polar coordinates. Cartesian (x,y) pairs are read from vector A. Polar (rho, theta) pairs, where rho is the radius and theta is the angle in the range [-pi, pi] are written to vector C. N specifies the number of coordinate pairs in A and C.

    Coordinate pairs are adjacent elements in the array, regardless of stride; stride is the distance from one coordinate pair to the next.

    This function performs the inverse operation of vDSP_rectD, which converts polar to rectangular coordinates.

    Import Statement

    Objective-C

    @import Accelerate;

    Swift

    import Accelerate

    Availability

    Available in iOS 4.0 and later.

  • Polar to rectangular conversion; single precision.

    Declaration

    Swift

    func vDSP_rect(_ __vDSP_A: UnsafePointer<Float>, _ __vDSP_I: vDSP_Stride, _ __vDSP_C: UnsafeMutablePointer<Float>, _ __vDSP_K: vDSP_Stride, _ __vDSP_N: vDSP_Length)

    Objective-C

    void vDSP_rect ( const float *__vDSP_A, vDSP_Stride __vDSP_IA, float *__vDSP_C, vDSP_Stride __vDSP_IC, vDSP_Length __vDSP_N );

    Parameters

    __vDSP_A

    Single-precision real input vector

    __vDSP_I

    Stride for A, must be even

    __vDSP_C

    Single-precision real output vector

    __vDSP_K

    Stride for C, must be even

    __vDSP_N

    Number of ordered pairs processed

    Discussion

    This performs the following operation:

    image: ../art/vdsp_73.eps

    Converts polar coordinates to rectangular coordinates. Polar (rho, theta) pairs, where rho is the radius and theta is the angle in the range [-pi, pi] are read from vector A. Cartesian (x,y) pairs are written to vector C. N specifies the number of coordinate pairs in A and C.

    Coordinate pairs are adjacent elements in the array, regardless of stride; stride is the distance from one coordinate pair to the next.

    This function performs the inverse operation of vDSP_polar, which converts rectangular to polar coordinates.

    Import Statement

    Objective-C

    @import Accelerate;

    Swift

    import Accelerate

    Availability

    Available in iOS 4.0 and later.

  • Polar to rectangular conversion; double precision.

    Declaration

    Swift

    func vDSP_rectD(_ __vDSP_A: UnsafePointer<Double>, _ __vDSP_I: vDSP_Stride, _ __vDSP_C: UnsafeMutablePointer<Double>, _ __vDSP_K: vDSP_Stride, _ __vDSP_N: vDSP_Length)

    Objective-C

    void vDSP_rectD ( const double *__vDSP_A, vDSP_Stride __vDSP_IA, double *__vDSP_C, vDSP_Stride __vDSP_IC, vDSP_Length __vDSP_N );

    Parameters

    __vDSP_A

    Double-precision real input vector

    __vDSP_I

    Stride for A, must be even

    __vDSP_C

    Double-precision real output vector

    __vDSP_K

    Stride for C, must be even

    __vDSP_N

    Number of ordered pairs processed

    Discussion

    This performs the following operation:

    image: ../art/vdsp_73.eps

    Converts polar coordinates to rectangular coordinates. Polar (rho, theta) pairs, where rho is the radius and theta is the angle in the range [-pi, pi] are read from vector A. Cartesian (x,y) pairs are written to vector C. N specifies the number of coordinate pairs in A and C.

    Coordinate pairs are adjacent elements in the array, regardless of stride; stride is the distance from one coordinate pair to the next.

    This function performs the inverse operation of vDSP_polarD, which converts rectangular to polar coordinates.

    Import Statement

    Objective-C

    @import Accelerate;

    Swift

    import Accelerate

    Availability

    Available in iOS 4.0 and later.

The functions in this group convert power or amplitude values to decibel values.

  • Vector convert power or amplitude to decibels; single precision.

    Declaration

    Swift

    func vDSP_vdbcon(_ __vDSP_A: UnsafePointer<Float>, _ __vDSP_I: vDSP_Stride, _ __vDSP_B: UnsafePointer<Float>, _ __vDSP_C: UnsafeMutablePointer<Float>, _ __vDSP_K: vDSP_Stride, _ __vDSP_N: vDSP_Length, _ __vDSP_F: UInt32)

    Objective-C

    void vDSP_vdbcon ( const float *__vDSP_A, vDSP_Stride __vDSP_IA, const float *__vDSP_B, float *__vDSP_C, vDSP_Stride __vDSP_IC, vDSP_Length __vDSP_N, unsigned int __vDSP_F );

    Parameters

    __vDSP_A

    Single-precision real input vector

    __vDSP_I

    Stride for A

    __vDSP_B

    Single-precision real input scalar: zero reference

    __vDSP_C

    Single-precision real output vector

    __vDSP_K

    Stride for C

    __vDSP_N

    The number of elements to process

    __vDSP_F

    Power (0) or amplitude (1) flag

    Discussion

    Performs the following operation. α is 20 if F is 1, or 10 if F is 0.

    image: ../art/vdsp_87.eps

    Converts inputs from vector A to their decibel equivalents, calculated in terms of power or amplitude according to flag F. As a relative reference point, the value of input scalar B is considered to be zero decibels.

    Import Statement

    Objective-C

    @import Accelerate;

    Swift

    import Accelerate

    Availability

    Available in iOS 4.0 and later.

  • Vector convert power or amplitude to decibels; double precision.

    Declaration

    Swift

    func vDSP_vdbconD(_ __vDSP_A: UnsafePointer<Double>, _ __vDSP_I: vDSP_Stride, _ __vDSP_B: UnsafePointer<Double>, _ __vDSP_C: UnsafeMutablePointer<Double>, _ __vDSP_K: vDSP_Stride, _ __vDSP_N: vDSP_Length, _ __vDSP_F: UInt32)

    Objective-C

    void vDSP_vdbconD ( const double *__vDSP_A, vDSP_Stride __vDSP_IA, const double *__vDSP_B, double *__vDSP_C, vDSP_Stride __vDSP_IC, vDSP_Length __vDSP_N, unsigned int __vDSP_F );

    Parameters

    __vDSP_A

    Double-precision real input vector

    __vDSP_I

    Stride for A

    __vDSP_B

    Double-precision real input scalar: zero reference

    __vDSP_C

    Double-precision real output vector

    __vDSP_K

    Stride for C

    __vDSP_N

    The number of elements to process

    __vDSP_F

    Power (0) or amplitude (1) flag

    Discussion

    Performs the following operation:

    image: ../art/vdsp_87.eps

    The Greek letter alpha equals 20 if F = 1, and 10 if F = 0.

    Converts inputs from vector A to their decibel equivalents, calculated in terms of power or amplitude according to flag F. As a relative reference point, the value of input scalar B is considered to be zero decibels.

    Import Statement

    Objective-C

    @import Accelerate;

    Swift

    import Accelerate

    Availability

    Available in iOS 4.0 and later.

The functions in this group remove the whole-number part of each element in a vector, leaving the fractional part.

  • Vector truncate to fraction; single precision.

    Declaration

    Swift

    func vDSP_vfrac(_ __vDSP_A: UnsafePointer<Float>, _ __vDSP_I: vDSP_Stride, _ __vDSP_C: UnsafeMutablePointer<Float>, _ __vDSP_K: vDSP_Stride, _ __vDSP_N: vDSP_Length)

    Objective-C

    void vDSP_vfrac ( const float *__vDSP_A, vDSP_Stride __vDSP_IA, float *__vDSP_C, vDSP_Stride __vDSP_IC, vDSP_Length __vDSP_N );

    Parameters

    __vDSP_A

    Single-precision real input vector

    __vDSP_I

    Stride for A

    __vDSP_C

    Single-precision real output vector

    __vDSP_K

    Stride for C

    __vDSP_N

    The number of elements to process

    Discussion

    Performs the following operation:

    image: ../art/vdsp_111.eps

    The "function" truncate(x) is the integer farthest from 0 but not farther than x. Thus, for example, vDSP_vFrac(-3.25) produces the result -0.25.

    Sets each element of vector C to the signed fractional part of the corresponding element of A.

    Import Statement

    Objective-C

    @import Accelerate;

    Swift

    import Accelerate

    Availability

    Available in iOS 4.0 and later.

  • Vector truncate to fraction; double precision.

    Declaration

    Swift

    func vDSP_vfracD(_ __vDSP_A: UnsafePointer<Double>, _ __vDSP_I: vDSP_Stride, _ __vDSP_C: UnsafeMutablePointer<Double>, _ __vDSP_K: vDSP_Stride, _ __vDSP_N: vDSP_Length)

    Objective-C

    void vDSP_vfracD ( const double *__vDSP_A, vDSP_Stride __vDSP_IA, double *__vDSP_C, vDSP_Stride __vDSP_IC, vDSP_Length __vDSP_N );

    Parameters

    __vDSP_A

    Double-precision real input vector

    __vDSP_I

    Stride for A

    __vDSP_C

    Double-precision real output vector

    __vDSP_K

    Stride for C

    __vDSP_N

    The number of elements to process

    Discussion

    Performs the following operation:

    image: ../art/vdsp_111.eps

    The "function" truncate(x) is the integer farthest from 0 but not farther than x. Thus, for example, vDSP_vFrac(-3.25) produces the result -0.25.

    Sets each element of vector C to the signed fractional part of the corresponding element of A.

    Import Statement

    Objective-C

    @import Accelerate;

    Swift

    import Accelerate

    Availability

    Available in iOS 4.0 and later.

The functions in this group find the complex conjugate of values in a vector.

  • Complex vector conjugate; single precision.

    Declaration

    Swift

    func vDSP_zvconj(_ __vDSP_A: UnsafePointer<DSPSplitComplex>, _ __vDSP_I: vDSP_Stride, _ __vDSP_C: UnsafePointer<DSPSplitComplex>, _ __vDSP_K: vDSP_Stride, _ __vDSP_N: vDSP_Length)

    Objective-C

    void vDSP_zvconj ( const DSPSplitComplex *__vDSP_A, vDSP_Stride __vDSP_IA, const DSPSplitComplex *__vDSP_C, vDSP_Stride __vDSP_IC, vDSP_Length __vDSP_N );

    Parameters

    __vDSP_A

    Single-precision complex input vector

    __vDSP_I

    Stride for A

    __vDSP_C

    Single-precision complex output vector

    __vDSP_K

    Stride for C

    __vDSP_N

    The number of elements to process

    Discussion

    Conjugates vector A.

    image: ../art/vdsp_100.eps

    Import Statement

    Objective-C

    @import Accelerate;

    Swift

    import Accelerate

    Availability

    Available in iOS 4.0 and later.

  • Complex vector conjugate; double precision.

    Declaration

    Swift

    func vDSP_zvconjD(_ __vDSP_A: UnsafePointer<DSPDoubleSplitComplex>, _ __vDSP_I: vDSP_Stride, _ __vDSP_C: UnsafePointer<DSPDoubleSplitComplex>, _ __vDSP_K: vDSP_Stride, _ __vDSP_N: vDSP_Length)

    Objective-C

    void vDSP_zvconjD ( const DSPDoubleSplitComplex *__vDSP_A, vDSP_Stride __vDSP_IA, const DSPDoubleSplitComplex *__vDSP_C, vDSP_Stride __vDSP_IC, vDSP_Length __vDSP_N );

    Parameters

    __vDSP_A

    Double-precision complex input vector

    __vDSP_I

    Stride for A

    __vDSP_C

    Double-precision complex output vector

    __vDSP_K

    Stride for C

    __vDSP_N

    The number of elements to process

    Discussion

    Conjugates vector A.

    image: ../art/vdsp_100.eps

    Import Statement

    Objective-C

    @import Accelerate;

    Swift

    import Accelerate

    Availability

    Available in iOS 4.0 and later.

The functions in this group compute the phase values of each element in a complex vector.

  • Complex vector phase; single precision.

    Declaration

    Swift

    func vDSP_zvphas(_ __vDSP_A: UnsafePointer<DSPSplitComplex>, _ __vDSP_I: vDSP_Stride, _ __vDSP_C: UnsafeMutablePointer<Float>, _ __vDSP_K: vDSP_Stride, _ __vDSP_N: vDSP_Length)

    Objective-C

    void vDSP_zvphas ( const DSPSplitComplex *__vDSP_A, vDSP_Stride __vDSP_IA, float *__vDSP_C, vDSP_Stride __vDSP_IC, vDSP_Length __vDSP_N );

    Parameters

    __vDSP_A

    Single-precision complex input vector.

    __vDSP_I

    Stride for A.

    __vDSP_C

    Single-precision real output vector.

    __vDSP_K

    Stride for C.

    __vDSP_N

    The number of elements to process.

    Discussion

    Finds the phase values, in radians, of complex vector A and store the results in real vector C. The results are between -pi and +pi. The sign of the result is the sign of the second coordinate in the input vector, except that the vDSP_zvphas function does not necessarily respect the sign of a zero input.

    This performs the following operation:

    • for (n = 0; n < N; ++n)
    • C[n] = atan2(Im(A[n]), Re(A[n]));

    Import Statement

    Objective-C

    @import Accelerate;

    Swift

    import Accelerate

    Availability

    Available in iOS 4.0 and later.

  • Complex vector phase; double precision.

    Declaration

    Swift

    func vDSP_zvphasD(_ __vDSP_A: UnsafePointer<DSPDoubleSplitComplex>, _ __vDSP_I: vDSP_Stride, _ __vDSP_C: UnsafeMutablePointer<Double>, _ __vDSP_K: vDSP_Stride, _ __vDSP_N: vDSP_Length)

    Objective-C

    void vDSP_zvphasD ( const DSPDoubleSplitComplex *__vDSP_A, vDSP_Stride __vDSP_IA, double *__vDSP_C, vDSP_Stride __vDSP_IC, vDSP_Length __vDSP_N );

    Parameters

    __vDSP_A

    Double-precision complex input vector.

    __vDSP_I

    Stride for A.

    __vDSP_C

    Double-precision real output vector.

    __vDSP_K

    Stride for C.

    __vDSP_N

    The number of elements to process.

    Discussion

    Finds the phase values, in radians, of complex vector A and store the results in real vector C. The results are between -pi and +pi. The sign of the result is the sign of the second coordinate in the input vector, except that the vDSP_zvphasD function does not necessarily respect the sign of a zero input.

    This performs the following operation:

    • for (n = 0; n < N; ++n)
    • C[n] = atan2(Im(A[n]), Re(A[n]));

    Import Statement

    Objective-C

    @import Accelerate;

    Swift

    import Accelerate

    Availability

    Available in iOS 4.0 and later.

The functions in this group restrict the values in a vector so that they fall within a given range or invert values outside a given range.

  • Vector clip; single precision.

    Declaration

    Swift

    func vDSP_vclip(_ __vDSP_A: UnsafePointer<Float>, _ __vDSP_I: vDSP_Stride, _ __vDSP_B: UnsafePointer<Float>, _ __vDSP_C: UnsafePointer<Float>, _ __vDSP_D: UnsafeMutablePointer<Float>, _ __vDSP_L: vDSP_Stride, _ __vDSP_N: vDSP_Length)

    Objective-C

    void vDSP_vclip ( const float *__vDSP_A, vDSP_Stride __vDSP_IA, const float *__vDSP_B, const float *__vDSP_C, float *__vDSP_D, vDSP_Stride __vDSP_ID, vDSP_Length __vDSP_N );

    Parameters

    __vDSP_A

    Single-precision real input vector

    __vDSP_I

    Stride for A

    __vDSP_B

    Single-precision real input scalar: low clipping threshold

    __vDSP_C

    Single-precision real input scalar: high clipping threshold

    __vDSP_D

    Single-precision real output vector

    __vDSP_L

    Stride for D

    __vDSP_N

    The number of elements to process

    Discussion

    This performs the following operation:

    image: ../art/vdsp_85.eps

    Elements of A are copied to D while clipping elements that are outside the interval [B, C] to the endpoints.

    Import Statement

    Objective-C

    @import Accelerate;

    Swift

    import Accelerate

    Availability

    Available in iOS 4.0 and later.

  • Vector clip; double precision.

    Declaration

    Swift

    func vDSP_vclipD(_ __vDSP_A: UnsafePointer<Double>, _ __vDSP_I: vDSP_Stride, _ __vDSP_B: UnsafePointer<Double>, _ __vDSP_C: UnsafePointer<Double>, _ __vDSP_D: UnsafeMutablePointer<Double>, _ __vDSP_L: vDSP_Stride, _ __vDSP_N: vDSP_Length)

    Objective-C

    void vDSP_vclipD ( const double *__vDSP_A, vDSP_Stride __vDSP_IA, const double *__vDSP_B, const double *__vDSP_C, double *__vDSP_D, vDSP_Stride __vDSP_ID, vDSP_Length __vDSP_N );

    Parameters

    __vDSP_A

    Double-precision real input vector

    __vDSP_I

    Stride for A

    __vDSP_B

    Double-precision real input scalar: low clipping threshold

    __vDSP_C

    Double-precision real input scalar: high clipping threshold

    __vDSP_D

    Double-precision real output vector

    __vDSP_L

    Stride for D

    __vDSP_N

    The number of elements to process

    Discussion

    This performs the following operation:

    image: ../art/vdsp_85.eps

    Elements of A are copied to D while clipping elements that are outside the interval [B, C] to the endpoints.

    Import Statement

    Objective-C

    @import Accelerate;

    Swift

    import Accelerate

    Availability

    Available in iOS 4.0 and later.

  • Vector clip and count; single precision.

    Declaration

    Swift

    func vDSP_vclipc(_ __vDSP_A: UnsafePointer<Float>, _ __vDSP_I: vDSP_Stride, _ __vDSP_B: UnsafePointer<Float>, _ __vDSP_C: UnsafePointer<Float>, _ __vDSP_D: UnsafeMutablePointer<Float>, _ __vDSP_L: vDSP_Stride, _ __vDSP_N: vDSP_Length, _ __vDSP_NLOW: UnsafeMutablePointer<vDSP_Length>, _ __vDSP_NHI: UnsafeMutablePointer<vDSP_Length>)

    Objective-C

    void vDSP_vclipc ( const float *__vDSP_A, vDSP_Stride __vDSP_IA, const float *__vDSP_B, const float *__vDSP_C, float *__vDSP_D, vDSP_Stride __vDSP_ID, vDSP_Length __vDSP_N, vDSP_Length *__vDSP_NLow, vDSP_Length *__vDSP_NHigh );

    Parameters

    __vDSP_A

    Single-precision real input vector

    __vDSP_I

    Stride for A

    __vDSP_B

    Single-precision real input scalar: low clipping threshold

    __vDSP_C

    Single-precision real input scalar: high clipping threshold

    __vDSP_D

    Single-precision real output vector

    __vDSP_L

    Stride for D

    __vDSP_N

    Number of elements in A and D

    __vDSP_NLOW

    Number of elements that were clipped to B

    __vDSP_NHI

    Number of elements that were clipped to C

    Discussion

    This performs the following operation:

    image: ../art/vdsp_85.eps

    Elements of A are copied to D while clipping elements that are outside the interval [B, C] to the endpoints.

    The count of elements clipped to B is returned in *NLOW, and the count of elements clipped to C is returned in *NHI

    Import Statement

    Objective-C

    @import Accelerate;

    Swift

    import Accelerate

    Availability

    Available in iOS 4.0 and later.

  • Vector clip and count; double precision.

    Declaration

    Swift

    func vDSP_vclipcD(_ __vDSP_A: UnsafePointer<Double>, _ __vDSP_I: vDSP_Stride, _ __vDSP_B: UnsafePointer<Double>, _ __vDSP_C: UnsafePointer<Double>, _ __vDSP_D: UnsafeMutablePointer<Double>, _ __vDSP_L: vDSP_Stride, _ __vDSP_N: vDSP_Length, _ __vDSP_NLOW: UnsafeMutablePointer<vDSP_Length>, _ __vDSP_NHI: UnsafeMutablePointer<vDSP_Length>)

    Objective-C

    void vDSP_vclipcD ( const double *__vDSP_A, vDSP_Stride __vDSP_IA, const double *__vDSP_B, const double *__vDSP_C, double *__vDSP_D, vDSP_Stride __vDSP_ID, vDSP_Length __vDSP_N, vDSP_Length *__vDSP_NLow, vDSP_Length *__vDSP_NHigh );

    Parameters

    __vDSP_A

    Double-precision real input vector

    __vDSP_I

    Stride for A

    __vDSP_B

    Double-precision real input scalar: low clipping threshold

    __vDSP_C

    Double-precision real input scalar: high clipping threshold

    __vDSP_D

    Double-precision real output vector

    __vDSP_L

    Stride for D

    __vDSP_N

    Number of elements in A and D

    __vDSP_NLOW

    Number of elements that were clipped to B

    __vDSP_NHI

    Number of elements that were clipped to C

    Discussion

    This performs the following operation:

    image: ../art/vdsp_85.eps

    Elements of A are copied to D while clipping elements that are outside the interval [B, C] to the endpoints.

    The count of elements clipped to B is returned in *NLOW, and the count of elements clipped to C is returned in *NHI

    Import Statement

    Objective-C

    @import Accelerate;

    Swift

    import Accelerate

    Availability

    Available in iOS 4.0 and later.

  • Vector inverted clip; single precision.

    Declaration

    Swift

    func vDSP_viclip(_ __vDSP_A: UnsafePointer<Float>, _ __vDSP_I: vDSP_Stride, _ __vDSP_B: UnsafePointer<Float>, _ __vDSP_C: UnsafePointer<Float>, _ __vDSP_D: UnsafeMutablePointer<Float>, _ __vDSP_L: vDSP_Stride, _ __vDSP_N: vDSP_Length)

    Objective-C

    void vDSP_viclip ( const float *__vDSP_A, vDSP_Stride __vDSP_IA, const float *__vDSP_B, const float *__vDSP_C, float *__vDSP_D, vDSP_Stride __vDSP_ID, vDSP_Length __vDSP_N );

    Parameters

    __vDSP_A

    Single-precision real input vector

    __vDSP_I

    Stride for A

    __vDSP_B

    Single-precision real input scalar: lower threshold

    __vDSP_C

    Single-precision real input scalar: upper threshold

    __vDSP_D

    Single-precision real output vector

    __vDSP_L

    Stride for D

    __vDSP_N

    The number of elements to process

    Discussion

    Performs the following operation:

    image: ../art/vdsp_152.eps

    Performs an inverted clip of vector A using lower-threshold and upper-threshold input scalars B and C.

    Import Statement

    Objective-C

    @import Accelerate;

    Swift

    import Accelerate

    Availability

    Available in iOS 4.0 and later.

  • Vector inverted clip; double precision.

    Declaration

    Swift

    func vDSP_viclipD(_ __vDSP_A: UnsafePointer<Double>, _ __vDSP_I: vDSP_Stride, _ __vDSP_B: UnsafePointer<Double>, _ __vDSP_C: UnsafePointer<Double>, _ __vDSP_D: UnsafeMutablePointer<Double>, _ __vDSP_L: vDSP_Stride, _ __vDSP_N: vDSP_Length)

    Objective-C

    void vDSP_viclipD ( const double *__vDSP_A, vDSP_Stride __vDSP_IA, const double *__vDSP_B, const double *__vDSP_C, double *__vDSP_D, vDSP_Stride __vDSP_ID, vDSP_Length __vDSP_N );

    Parameters

    __vDSP_A

    Double-precision real input vector

    __vDSP_I

    Stride for A

    __vDSP_B

    Double-precision real input scalar: lower threshold

    __vDSP_C

    Double-precision real input scalar: upper threshold

    __vDSP_D

    Double-precision real output vector

    __vDSP_L

    Stride for D

    __vDSP_N

    The number of elements to process

    Discussion

    Performs the following operation:

    image: ../art/vdsp_152.eps

    Performs an inverted clip of vector A using lower-threshold and upper-threshold input scalars B and C.

    Import Statement

    Objective-C

    @import Accelerate;

    Swift

    import Accelerate

    Availability

    Available in iOS 4.0 and later.

  • Vector test limit; single precision.

    Declaration

    Swift

    func vDSP_vlim(_ __vDSP_A: UnsafePointer<Float>, _ __vDSP_I: vDSP_Stride, _ __vDSP_B: UnsafePointer<Float>, _ __vDSP_C: UnsafePointer<Float>, _ __vDSP_D: UnsafeMutablePointer<Float>, _ __vDSP_L: vDSP_Stride, _ __vDSP_N: vDSP_Length)

    Objective-C

    void vDSP_vlim ( const float *__vDSP_A, vDSP_Stride __vDSP_IA, const float *__vDSP_B, const float *__vDSP_C, float *__vDSP_D, vDSP_Stride __vDSP_ID, vDSP_Length __vDSP_N );

    Parameters

    __vDSP_A

    Single-precision real input vector

    __vDSP_I

    Stride for A

    __vDSP_B

    Single-precision real input scalar: limit

    __vDSP_C

    Single-precision real input scalar

    __vDSP_D

    Single-precision real output vector

    __vDSP_L

    Stride for D

    __vDSP_N

    The number of elements to process

    Discussion

    Compares values from vector A to limit scalar B. For inputs greater than or equal to B, scalar C is written to D . For inputs less than B, the negated value of scalar C is written to vector D.

    This calculates the following:

    • for (n = 0; n < N; ++n)
    • if (*B <= A[n*I])
    • D[n*L] = *C;
    • else
    • D[n*L] = -(*C);

    Import Statement

    Objective-C

    @import Accelerate;

    Swift

    import Accelerate

    Availability

    Available in iOS 4.0 and later.

  • Vector test limit; double precision.

    Declaration

    Swift

    func vDSP_vlimD(_ __vDSP_A: UnsafePointer<Double>, _ __vDSP_I: vDSP_Stride, _ __vDSP_B: UnsafePointer<Double>, _ __vDSP_C: UnsafePointer<Double>, _ __vDSP_D: UnsafeMutablePointer<Double>, _ __vDSP_L: vDSP_Stride, _ __vDSP_N: vDSP_Length)

    Objective-C

    void vDSP_vlimD ( const double *__vDSP_A, vDSP_Stride __vDSP_IA, const double *__vDSP_B, const double *__vDSP_C, double *__vDSP_D, vDSP_Stride __vDSP_ID, vDSP_Length __vDSP_N );

    Parameters

    __vDSP_A

    Double-precision real input vector

    __vDSP_I

    Stride for A

    __vDSP_B

    Double-precision real input scalar: limit

    __vDSP_C

    Double-precision real input scalar

    __vDSP_D

    Double-precision real output vector

    __vDSP_L

    Stride for D

    __vDSP_N

    The number of elements to process

    Discussion

    Compares values from vector A to limit scalar B. For inputs greater than or equal to B, scalar C is written to D . For inputs less than B, the negated value of scalar C is written to vector D.

    This calculates the following:

    • for (n = 0; n < N; ++n)
    • if (*B <= A[n*I])
    • D[n*L] = *C;
    • else
    • D[n*L] = -(*C);

    Import Statement

    Objective-C

    @import Accelerate;

    Swift

    import Accelerate

    Availability

    Available in iOS 4.0 and later.

  • Vector threshold; single precision.

    Declaration

    Swift

    func vDSP_vthr(_ __vDSP_A: UnsafePointer<Float>, _ __vDSP_I: vDSP_Stride, _ __vDSP_B: UnsafePointer<Float>, _ __vDSP_C: UnsafeMutablePointer<Float>, _ __vDSP_K: vDSP_Stride, _ __vDSP_N: vDSP_Length)

    Objective-C

    void vDSP_vthr ( const float *__vDSP_A, vDSP_Stride __vDSP_IA, const float *__vDSP_B, float *__vDSP_C, vDSP_Stride __vDSP_IC, vDSP_Length __vDSP_N );

    Parameters

    __vDSP_A

    Single-precision real input vector

    __vDSP_I

    Stride for A

    __vDSP_B

    Single-precision real input scalar: lower threshold

    __vDSP_C

    Single-precision real output vector

    __vDSP_K

    Stride for C

    __vDSP_N

    The number of elements to process

    Discussion

    Performs the following operation:

    image: ../art/vdsp_146.eps

    Creates vector C by comparing each input from vector A with scalar B. If an input value is less than B, B is copied to C; otherwise, the input value from A is copied to C.

    Import Statement

    Objective-C

    @import Accelerate;

    Swift

    import Accelerate

    Availability

    Available in iOS 4.0 and later.

  • Vector threshold; double precision.

    Declaration

    Swift

    func vDSP_vthrD(_ __vDSP_A: UnsafePointer<Double>, _ __vDSP_I: vDSP_Stride, _ __vDSP_B: UnsafePointer<Double>, _ __vDSP_C: UnsafeMutablePointer<Double>, _ __vDSP_K: vDSP_Stride, _ __vDSP_N: vDSP_Length)

    Objective-C

    void vDSP_vthrD ( const double *__vDSP_A, vDSP_Stride __vDSP_IA, const double *__vDSP_B, double *__vDSP_C, vDSP_Stride __vDSP_IC, vDSP_Length __vDSP_N );

    Parameters

    __vDSP_A

    Double-precision real input vector

    __vDSP_I

    Stride for A

    __vDSP_B

    Double-precision real input scalar: lower threshold

    __vDSP_C

    Double-precision real output vector

    __vDSP_K

    Stride for C

    __vDSP_N

    The number of elements to process

    Discussion

    Performs the following operation:

    image: ../art/vdsp_146.eps

    Creates vector C by comparing each input from vector A with scalar B. If an input value is less than B, B is copied to C; otherwise, the input value from A is copied to C.

    Import Statement

    Objective-C

    @import Accelerate;

    Swift

    import Accelerate

    Availability

    Available in iOS 4.0 and later.

  • Vector threshold with zero fill; single precision.

    Declaration

    Swift

    func vDSP_vthres(_ __vDSP_A: UnsafePointer<Float>, _ __vDSP_I: vDSP_Stride, _ __vDSP_B: UnsafePointer<Float>, _ __vDSP_C: UnsafeMutablePointer<Float>, _ __vDSP_K: vDSP_Stride, _ __vDSP_N: vDSP_Length)

    Objective-C

    void vDSP_vthres ( const float *__vDSP_A, vDSP_Stride __vDSP_IA, const float *__vDSP_B, float *__vDSP_C, vDSP_Stride __vDSP_IC, vDSP_Length __vDSP_N );

    Parameters

    __vDSP_A

    Single-precision real input vector

    __vDSP_I

    Stride for A

    __vDSP_B

    Single-precision real input scalar: lower threshold

    __vDSP_C

    Single-precision real output vector

    __vDSP_K

    Stride for C

    __vDSP_N

    The number of elements to process

    Discussion

    Performs the following operation:

    image: ../art/vdsp_150.eps

    Creates vector C by comparing each input from vector A with scalar B. If an input value is less than B, zero is written to C; otherwise, the input value from A is copied to C.

    Import Statement

    Objective-C

    @import Accelerate;

    Swift

    import Accelerate

    Availability

    Available in iOS 4.0 and later.

  • Vector threshold with zero fill; double precision.

    Declaration

    Swift

    func vDSP_vthresD(_ __vDSP_A: UnsafePointer<Double>, _ __vDSP_I: vDSP_Stride, _ __vDSP_B: UnsafePointer<Double>, _ __vDSP_C: UnsafeMutablePointer<Double>, _ __vDSP_K: vDSP_Stride, _ __vDSP_N: vDSP_Length)

    Objective-C

    void vDSP_vthresD ( const double *__vDSP_A, vDSP_Stride __vDSP_IA, const double *__vDSP_B, double *__vDSP_C, vDSP_Stride __vDSP_IC, vDSP_Length __vDSP_N );

    Parameters

    __vDSP_A

    Double-precision real input vector

    __vDSP_I

    Stride for A

    __vDSP_B

    Double-precision real input scalar: lower threshold

    __vDSP_C

    Double-precision real output vector

    __vDSP_K

    Stride for C

    __vDSP_N

    The number of elements to process

    Discussion

    Performs the following operation:

    image: ../art/vdsp_150.eps

    Creates vector C by comparing each input from vector A with scalar B. If an input value is less than B, zero is written to C; otherwise, the input value from A is copied to C.

    Import Statement

    Objective-C

    @import Accelerate;

    Swift

    import Accelerate

    Availability

    Available in iOS 4.0 and later.

  • Vector threshold with signed constant; single precision.

    Declaration

    Swift

    func vDSP_vthrsc(_ __vDSP_A: UnsafePointer<Float>, _ __vDSP_I: vDSP_Stride, _ __vDSP_B: UnsafePointer<Float>, _ __vDSP_C: UnsafePointer<Float>, _ __vDSP_D: UnsafeMutablePointer<Float>, _ __vDSP_L: vDSP_Stride, _ __vDSP_N: vDSP_Length)

    Objective-C

    void vDSP_vthrsc ( const float *__vDSP_A, vDSP_Stride __vDSP_IA, const float *__vDSP_B, const float *__vDSP_C, float *__vDSP_D, vDSP_Stride __vDSP_ID, vDSP_Length __vDSP_N );

    Parameters

    __vDSP_A

    Single-precision real input vector

    __vDSP_I

    Stride for A

    __vDSP_B

    Single-precision real input scalar: lower threshold

    __vDSP_C

    Single-precision real input scalar

    __vDSP_D

    Single-precision real output vector

    __vDSP_L

    Stride for D

    __vDSP_N

    The number of elements to process

    Discussion

    Performs the following operation:

    image: ../art/vdsp_147.eps

    Creates vector D using the plus or minus value of scalar C. The sign of the output element is determined by comparing input from vector A with threshold scalar B. For input values less than B, the negated value of C is written to vector D. For input values greater than or equal to B, C is copied to vector D.

    Import Statement

    Objective-C

    @import Accelerate;

    Swift

    import Accelerate

    Availability

    Available in iOS 4.0 and later.

  • Vector threshold with signed constant; double precision.

    Declaration

    Swift

    func vDSP_vthrscD(_ __vDSP_A: UnsafePointer<Double>, _ __vDSP_I: vDSP_Stride, _ __vDSP_B: UnsafePointer<Double>, _ __vDSP_C: UnsafePointer<Double>, _ __vDSP_D: UnsafeMutablePointer<Double>, _ __vDSP_L: vDSP_Stride, _ __vDSP_N: vDSP_Length)

    Objective-C

    void vDSP_vthrscD ( const double *__vDSP_A, vDSP_Stride __vDSP_IA, const double *__vDSP_B, const double *__vDSP_C, double *__vDSP_D, vDSP_Stride __vDSP_ID, vDSP_Length __vDSP_N );

    Parameters

    __vDSP_A

    Double-precision real input vector

    __vDSP_I

    Stride for A

    __vDSP_B

    Double-precision real input scalar: lower threshold

    __vDSP_C

    Double-precision real input scalar

    __vDSP_D

    Double-precision real output vector

    __vDSP_L

    Stride for D

    __vDSP_N

    The number of elements to process

    Discussion

    Performs the following operation:

    image: ../art/vdsp_147.eps

    Creates vector D using the plus or minus value of scalar C. The sign of the output element is determined by comparing input from vector A with threshold scalar B. For input values less than B, the negotiated value of C is written to vector D. For input values greater than or equal to B, C is copied to vector D.

    Import Statement

    Objective-C

    @import Accelerate;

    Swift

    import Accelerate

    Availability

    Available in iOS 4.0 and later.

The functions in this group compress the values of a vector.

  • Vector compress; single precision.

    Declaration

    Swift

    func vDSP_vcmprs(_ __vDSP_A: UnsafePointer<Float>, _ __vDSP_I: vDSP_Stride, _ __vDSP_B: UnsafePointer<Float>, _ __vDSP_J: vDSP_Stride, _ __vDSP_C: UnsafeMutablePointer<Float>, _ __vDSP_K: vDSP_Stride, _ __vDSP_N: vDSP_Length)

    Objective-C

    void vDSP_vcmprs ( const float *__vDSP_A, vDSP_Stride __vDSP_IA, const float *__vDSP_B, vDSP_Stride __vDSP_IB, float *__vDSP_C, vDSP_Stride __vDSP_IC, vDSP_Length __vDSP_N );

    Parameters

    __vDSP_A

    Single-precision real input vector

    __vDSP_I

    Stride for A

    __vDSP_B

    Single-precision real input vector

    __vDSP_J

    Stride for B

    __vDSP_C

    Single-precision real output vector

    __vDSP_K

    Stride for C

    __vDSP_N

    The number of elements to process

    Discussion

    Performs the following operation:

    image: ../art/vdsp_86.eps

    Compresses vector A based on the nonzero values of gating vector B. For nonzero elements of B, corresponding elements of A are sequentially copied to output vector C.

    Import Statement

    Objective-C

    @import Accelerate;

    Swift

    import Accelerate

    Availability

    Available in iOS 4.0 and later.

  • Vector compress; double precision.

    Declaration

    Swift

    func vDSP_vcmprsD(_ __vDSP_A: UnsafePointer<Double>, _ __vDSP_I: vDSP_Stride, _ __vDSP_B: UnsafePointer<Double>, _ __vDSP_J: vDSP_Stride, _ __vDSP_C: UnsafeMutablePointer<Double>, _ __vDSP_K: vDSP_Stride, _ __vDSP_N: vDSP_Length)

    Objective-C

    void vDSP_vcmprsD ( const double *__vDSP_A, vDSP_Stride __vDSP_IA, const double *__vDSP_B, vDSP_Stride __vDSP_IB, double *__vDSP_C, vDSP_Stride __vDSP_IC, vDSP_Length __vDSP_N );

    Parameters

    __vDSP_A

    Double-precision real input vector

    __vDSP_I

    Stride for A

    __vDSP_B

    Double-precision real input vector

    __vDSP_J

    Stride for B

    __vDSP_C

    Double-precision real output vector

    __vDSP_K

    Stride for C

    __vDSP_N

    The number of elements to process

    Discussion

    Performs the following operation:

    image: ../art/vdsp_86.eps

    Compresses vector A based on the nonzero values of gating vector B. For nonzero elements of B, corresponding elements of A are sequentially copied to output vector C.

    Import Statement

    Objective-C

    @import Accelerate;

    Swift

    import Accelerate

    Availability

    Available in iOS 4.0 and later.

The functions in this group use either indices or pointers stored within one source vector to generate a new vector containing the chosen elements from either a second source vector or from memory.

  • Vector gather; single precision.

    Declaration

    Swift

    func vDSP_vgathr(_ __vDSP_A: UnsafePointer<Float>, _ __vDSP_B: UnsafePointer<vDSP_Length>, _ __vDSP_J: vDSP_Stride, _ __vDSP_C: UnsafeMutablePointer<Float>, _ __vDSP_K: vDSP_Stride, _ __vDSP_N: vDSP_Length)

    Objective-C

    void vDSP_vgathr ( const float *__vDSP_A, const vDSP_Length *__vDSP_B, vDSP_Stride __vDSP_IB, float *__vDSP_C, vDSP_Stride __vDSP_IC, vDSP_Length __vDSP_N );

    Parameters

    __vDSP_A

    Single-precision real input vector

    __vDSP_B

    Integer vector containing indices

    __vDSP_J

    Stride for B

    __vDSP_C

    Single-precision real output vector

    __vDSP_K

    Stride for C

    __vDSP_N

    The number of elements to process

    Discussion

    Performs the following operation:

    image: ../art/vdsp_112.eps

    Uses elements of vector B as indices to copy selected elements of vector A to sequential locations in vector C. Note that 1, not zero, is treated as the first location in the input vector when evaluating indices. This function can only be done out of place.

    Import Statement

    Objective-C

    @import Accelerate;

    Swift

    import Accelerate

    Availability

    Available in iOS 4.0 and later.

  • Vector gather; double precision.

    Declaration

    Swift

    func vDSP_vgathrD(_ __vDSP_A: UnsafePointer<Double>, _ __vDSP_B: UnsafePointer<vDSP_Length>, _ __vDSP_J: vDSP_Stride, _ __vDSP_C: UnsafeMutablePointer<Double>, _ __vDSP_K: vDSP_Stride, _ __vDSP_N: vDSP_Length)

    Objective-C

    void vDSP_vgathrD ( const double *__vDSP_A, const vDSP_Length *__vDSP_B, vDSP_Stride __vDSP_IB, double *__vDSP_C, vDSP_Stride __vDSP_IC, vDSP_Length __vDSP_N );

    Parameters

    __vDSP_A

    Double-precision real input vector.

    __vDSP_B

    Integer vector containing indices.

    __vDSP_J

    Address stride for B.

    __vDSP_C

    Double-precision real output vector.

    __vDSP_K

    Address stride for C.

    __vDSP_N

    The number of elements to process

    Discussion

    Performs the following operation:

    image: ../art/vdsp_112.eps

    Uses elements of vector B as indices to copy selected elements of vector A to sequential locations in vector C. Note that 1, not zero, is treated as the first location in the input vector when evaluating indices. This function can only be done out of place.

    Import Statement

    Objective-C

    @import Accelerate;

    Swift

    import Accelerate

    Availability

    Available in iOS 4.0 and later.

  • Vector gather, absolute pointers; single precision.

    Declaration

    Swift

    func vDSP_vgathra(_ __vDSP_A: UnsafeMutablePointer<UnsafePointer<Float>>, _ __vDSP_I: vDSP_Stride, _ __vDSP_C: UnsafeMutablePointer<Float>, _ __vDSP_K: vDSP_Stride, _ __vDSP_N: vDSP_Length)

    Objective-C

    void vDSP_vgathra ( const float **__vDSP_A, vDSP_Stride __vDSP_IA, float *__vDSP_C, vDSP_Stride __vDSP_IC, vDSP_Length __vDSP_N );

    Parameters

    __vDSP_A

    Pointer input vector.

    __vDSP_I

    Address stride for A.

    __vDSP_C

    Single-precision real output vector.

    __vDSP_K

    Address stride for C.

    __vDSP_N

    The number of elements to process.

    Discussion

    Performs the following operation:

    image: ../art/vdsp_113.eps

    Uses elements of vector A as pointers to copy selected single-precision values from memory to sequential locations in vector C. This function can only be done out of place.

    Import Statement

    Objective-C

    @import Accelerate;

    Swift

    import Accelerate

    Availability

    Available in iOS 4.0 and later.

  • Vector gather, absolute pointers; double precision.

    Declaration

    Swift

    func vDSP_vgathraD(_ __vDSP_A: UnsafeMutablePointer<UnsafePointer<Double>>, _ __vDSP_I: vDSP_Stride, _ __vDSP_C: UnsafeMutablePointer<Double>, _ __vDSP_K: vDSP_Stride, _ __vDSP_N: vDSP_Length)

    Objective-C

    void vDSP_vgathraD ( const double **__vDSP_A, vDSP_Stride __vDSP_IA, double *__vDSP_C, vDSP_Stride __vDSP_IC, vDSP_Length __vDSP_N );

    Parameters

    __vDSP_A

    Pointer input vector.

    __vDSP_I

    Address stride for A.

    __vDSP_C

    Double-precision real output vector.

    __vDSP_K

    Address stride for C.

    __vDSP_N

    The number of elements to process.

    Discussion

    Performs the following operation:

    image: ../art/vdsp_113.eps

    Uses elements of vector A as pointers to copy selected double-precision values from memory to sequential locations in vector C. This function can only be done out of place.

    Import Statement

    Objective-C

    @import Accelerate;

    Swift

    import Accelerate

    Availability

    Available in iOS 4.0 and later.

  • Vector index; single precision.

    Declaration

    Swift

    func vDSP_vindex(_ __vDSP_A: UnsafePointer<Float>, _ __vDSP_B: UnsafePointer<Float>, _ __vDSP_J: vDSP_Stride, _ __vDSP_C: UnsafeMutablePointer<Float>, _ __vDSP_K: vDSP_Stride, _ __vDSP_N: vDSP_Length)

    Objective-C

    void vDSP_vindex ( const float *__vDSP_A, const float *__vDSP_B, vDSP_Stride __vDSP_IB, float *__vDSP_C, vDSP_Stride __vDSP_IC, vDSP_Length __vDSP_N );

    Parameters

    __vDSP_A

    Single-precision real input vector.

    __vDSP_B

    Single-precision real input vector: indices.

    __vDSP_J

    Address stride for B.

    __vDSP_C

    Single-precision real output vector.

    __vDSP_K

    Address stride for C.

    __vDSP_N

    The number of elements to process.

    Discussion

    Performs the following operation:

    image: ../art/vdsp_116.eps

    Uses vector B as zero-based subscripts to copy selected elements of vector A to vector C. Fractional parts of vector B are ignored.

    Import Statement

    Objective-C

    @import Accelerate;

    Swift

    import Accelerate

    Availability

    Available in iOS 4.0 and later.

  • Vector index; double precision.

    Declaration

    Swift

    func vDSP_vindexD(_ __vDSP_A: UnsafePointer<Double>, _ __vDSP_B: UnsafePointer<Double>, _ __vDSP_J: vDSP_Stride, _ __vDSP_C: UnsafeMutablePointer<Double>, _ __vDSP_K: vDSP_Stride, _ __vDSP_N: vDSP_Length)

    Objective-C

    void vDSP_vindexD ( const double *__vDSP_A, const double *__vDSP_B, vDSP_Stride __vDSP_IB, double *__vDSP_C, vDSP_Stride __vDSP_IC, vDSP_Length __vDSP_N );

    Parameters

    __vDSP_A

    Double-precision real input vector.

    __vDSP_B

    Double-precision real input vector: indices.

    __vDSP_J

    Address stride for B.

    __vDSP_C

    Double-precision real output vector.

    __vDSP_K

    Address stride for C.

    __vDSP_N

    The number of elements to process.

    Discussion

    Performs the following operation:

    image: ../art/vdsp_116.eps

    Uses vector B as zero-based subscripts to copy selected elements of vector A to vector C. Fractional parts of vector B are ignored.

    Import Statement

    Objective-C

    @import Accelerate;

    Swift

    import Accelerate

    Availability

    Available in iOS 4.0 and later.

The functions in this group reverse the order of the elements in a vector.

  • Vector reverse order, in place; single precision.

    Declaration

    Swift

    func vDSP_vrvrs(_ __vDSP_C: UnsafeMutablePointer<Float>, _ __vDSP_K: vDSP_Stride, _ __vDSP_N: vDSP_Length)

    Objective-C

    void vDSP_vrvrs ( float *__vDSP_C, vDSP_Stride __vDSP_IC, vDSP_Length __vDSP_N );

    Parameters

    __vDSP_C

    Single-precision real input-output vector.

    __vDSP_K

    Address stride for C.

    __vDSP_N

    The number of elements to process.

    Discussion

    Performs the following operation:

    image: ../art/vdsp_133.eps

    Reverses the order of vector C in place.

    Import Statement

    Objective-C

    @import Accelerate;

    Swift

    import Accelerate

    Availability

    Available in iOS 4.0 and later.

  • Vector reverse order, in place; double precision.

    Declaration

    Swift

    func vDSP_vrvrsD(_ __vDSP_C: UnsafeMutablePointer<Double>, _ __vDSP_K: vDSP_Stride, _ __vDSP_N: vDSP_Length)

    Objective-C

    void vDSP_vrvrsD ( double *__vDSP_C, vDSP_Stride __vDSP_IC, vDSP_Length __vDSP_N );

    Parameters

    __vDSP_C

    Double-precision real input-output vector.

    __vDSP_K

    Address stride for C.

    __vDSP_N

    The number of elements to process.

    Discussion

    Performs the following operation:

    image: ../art/vdsp_133.eps

    Reverses the order of vector C in place.

    Import Statement

    Objective-C

    @import Accelerate;

    Swift

    import Accelerate

    Availability

    Available in iOS 4.0 and later.

The functions in this group copy one vector to another vector.

  • Complex vector copy; single precision.

    Declaration

    Swift

    func vDSP_zvmov(_ __vDSP_A: UnsafePointer<DSPSplitComplex>, _ __vDSP_I: vDSP_Stride, _ __vDSP_C: UnsafePointer<DSPSplitComplex>, _ __vDSP_K: vDSP_Stride, _ __vDSP_N: vDSP_Length)

    Objective-C

    void vDSP_zvmov ( const DSPSplitComplex *__vDSP_A, vDSP_Stride __vDSP_IA, const DSPSplitComplex *__vDSP_C, vDSP_Stride __vDSP_IC, vDSP_Length __vDSP_N );

    Parameters

    __vDSP_A

    Single-precision complex input vector.

    __vDSP_I

    Address stride for A.

    __vDSP_C

    Single-precision complex output vector.

    __vDSP_K

    Address stride for C.

    __vDSP_N

    The number of elements to process.

    Discussion

    Copies complex vector A to complex vector C.

    image: ../art/vdsp_106.eps

    Import Statement

    Objective-C

    @import Accelerate;

    Swift

    import Accelerate

    Availability

    Available in iOS 4.0 and later.

  • Complex vector copy; double precision.

    Declaration

    Swift

    func vDSP_zvmovD(_ __vDSP_A: UnsafePointer<DSPDoubleSplitComplex>, _ __vDSP_I: vDSP_Stride, _ __vDSP_C: UnsafePointer<DSPDoubleSplitComplex>, _ __vDSP_K: vDSP_Stride, _ __vDSP_N: vDSP_Length)

    Objective-C

    void vDSP_zvmovD ( const DSPDoubleSplitComplex *__vDSP_A, vDSP_Stride __vDSP_IA, const DSPDoubleSplitComplex *__vDSP_C, vDSP_Stride __vDSP_IC, vDSP_Length __vDSP_N );

    Parameters

    __vDSP_A

    Double-precision complex input vector.

    __vDSP_I

    Address stride for A.

    __vDSP_C

    Double-precision complex output vector.

    __vDSP_K

    Address stride for C.

    __vDSP_N

    The number of elements to process

    Discussion

    Copies complex vector A to complex vector C.

    image: ../art/vdsp_106.eps

    Import Statement

    Objective-C

    @import Accelerate;

    Swift

    import Accelerate

    Availability

    Available in iOS 4.0 and later.

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

  • Find zero crossings; single precision.

    Declaration

    Swift

    func vDSP_nzcros(_ __vDSP_A: UnsafePointer<Float>, _ __vDSP_I: vDSP_Stride, _ __vDSP_B: vDSP_Length, _ __vDSP_C: UnsafeMutablePointer<vDSP_Length>, _ __vDSP_D: UnsafeMutablePointer<vDSP_Length>, _ __vDSP_N: vDSP_Length)

    Objective-C

    void vDSP_nzcros ( const float *__vDSP_A, vDSP_Stride __vDSP_IA, vDSP_Length __vDSP_B, vDSP_Length *__vDSP_C, vDSP_Length *__vDSP_D, vDSP_Length __vDSP_N );

    Parameters

    __vDSP_A

    Single-precision real input vector.

    __vDSP_I

    Address stride for A.

    __vDSP_B

    Maximum number of crossings to find.

    __vDSP_C

    Index of last crossing found.

    __vDSP_D

    Total number of zero crossings found

    __vDSP_N

    Number of elements in A.

    Discussion

    This performs the following operation:

    • *D = *C = 0; for(n = 1; n < N; n++) { if( sign(A[n * I]) != sign(A[(n - 1) * I]) ) { *D = *D + 1; if( *D == B) { *C = n * I; break; } } }

    The "function" sign(x) above has the value -1 if the sign bit of x is 1 (x is negative or -0), and +1 if the sign bit is 0 (x is positive or +0).

    Scans vector A to locate transitions from positive to negative values and from negative to positive values. The scan terminates when the number of crossings specified by B is found, or the end of the vector is reached. The zero-based index of the last crossing is returned in C. C is the actual array index, not the pre-stride index. If the zero crossing that B specifies is not found, zero is returned in C. The total number of zero crossings found is returned in D.

    Note that a transition from -0 to +0 or from +0 to -0 is counted as a zero crossing.

    Import Statement

    Objective-C

    @import Accelerate;

    Swift

    import Accelerate

    Availability

    Available in iOS 4.0 and later.

  • Find zero crossings; double precision.

    Declaration

    Swift

    func vDSP_nzcrosD(_ __vDSP_A: UnsafePointer<Double>, _ __vDSP_I: vDSP_Stride, _ __vDSP_B: vDSP_Length, _ __vDSP_C: UnsafeMutablePointer<vDSP_Length>, _ __vDSP_D: UnsafeMutablePointer<vDSP_Length>, _ __vDSP_N: vDSP_Length)

    Objective-C

    void vDSP_nzcrosD ( const double *__vDSP_A, vDSP_Stride __vDSP_IA, vDSP_Length __vDSP_B, vDSP_Length *__vDSP_C, vDSP_Length *__vDSP_D, vDSP_Length __vDSP_N );

    Parameters

    __vDSP_A

    Double-precision real input vector.

    __vDSP_I

    Address stride for A.

    __vDSP_B

    Maximum number of crossings to find.

    __vDSP_C

    Index of last crossing found.

    __vDSP_D

    Total number of zero crossings found.

    __vDSP_N

    Number of elements in A.

    Discussion

    This performs the following operation:

    • *D = *C = 0; for(n = 1; n < N; n++) { if( sign(A[n * I]) != sign(A[(n - 1) * I]) ) { *D = *D + 1; if( *D == B) { *C = n * I; break; } } }

    The "function" sign(x) above has the value -1 if the sign bit of x is 1 (x is negative or -0), and +1 if the sign bit is 0 (x is positive or +0).

    Scans vector A to locate transitions from positive to negative values and from negative to positive values. The scan terminates when the number of crossings specified by B is found, or the end of the vector is reached. The zero-based index of the last crossing is returned in C. C is the actual array index, not the pre-stride index. If the zero crossing that B specifies is not found, zero is returned in C. The total number of zero crossings found is returned in D.

    Note that a transition from -0 to +0 or from +0 to -0 is counted as a zero crossing.

    Import Statement

    Objective-C

    @import Accelerate;

    Swift

    import Accelerate

    Availability

    Available in iOS 4.0 and later.

The functions in this group take a vector that contains the linear averages of values from other vectors and adds an additional vector into those averages.

  • Vector linear average; single precision.

    Declaration

    Swift

    func vDSP_vavlin(_ __vDSP_A: UnsafePointer<Float>, _ __vDSP_I: vDSP_Stride, _ __vDSP_B: UnsafePointer<Float>, _ __vDSP_C: UnsafeMutablePointer<Float>, _ __vDSP_K: vDSP_Stride, _ __vDSP_N: vDSP_Length)

    Objective-C

    void vDSP_vavlin ( const float *__vDSP_A, vDSP_Stride __vDSP_IA, const float *__vDSP_B, float *__vDSP_C, vDSP_Stride __vDSP_IC, vDSP_Length __vDSP_N );

    Parameters

    __vDSP_A

    Single-precision real input vector.

    __vDSP_I

    Address stride for A.

    __vDSP_B

    Single-precision real input scalar.

    __vDSP_C

    Single-precision real input-output vector.

    __vDSP_K

    Stride for C

    __vDSP_N

    The number of elements to process; each vector must have at least N elements.

    Discussion

    This performs the following operation:

    image: ../art/vdsp_84.eps

    Recalculates the linear average of input-output vector C to include input vector A. Input scalar B specifies the number of vectors included in the current average.

    Import Statement

    Objective-C

    @import Accelerate;

    Swift

    import Accelerate

    Availability

    Available in iOS 4.0 and later.

  • Vector linear average; double precision.

    Declaration

    Swift

    func vDSP_vavlinD(_ __vDSP_A: UnsafePointer<Double>, _ __vDSP_I: vDSP_Stride, _ __vDSP_B: UnsafePointer<Double>, _ __vDSP_C: UnsafeMutablePointer<Double>, _ __vDSP_K: vDSP_Stride, _ __vDSP_N: vDSP_Length)

    Objective-C

    void vDSP_vavlinD ( const double *__vDSP_A, vDSP_Stride __vDSP_IA, const double *__vDSP_B, double *__vDSP_C, vDSP_Stride __vDSP_IC, vDSP_Length __vDSP_N );

    Parameters

    __vDSP_A

    Double-precision real input vector.

    __vDSP_I

    Address stride for A.

    __vDSP_B

    Double-precision real input scalar.

    __vDSP_C

    Double-precision real input-output vector.

    __vDSP_K

    Address stride for C.

    __vDSP_N

    The number of elements to process; each vector must have at least N elements.

    Discussion

    This performs the following operation:

    image: ../art/vdsp_84.eps

    Recalculates the linear average of input-output vector C to include input vector A. Input scalar B specifies the number of vectors included in the current average.

    Import Statement

    Objective-C

    @import Accelerate;

    Swift

    import Accelerate

    Availability

    Available in iOS 4.0 and later.

The functions in this group calculate the linear interpolation between neighboring elements.

  • Vector linear interpolation between neighboring elements; single precision.

    Declaration

    Swift

    func vDSP_vlint(_ __vDSP_A: UnsafePointer<Float>, _ __vDSP_B: UnsafePointer<Float>, _ __vDSP_J: vDSP_Stride, _ __vDSP_C: UnsafeMutablePointer<Float>, _ __vDSP_K: vDSP_Stride, _ __vDSP_N: vDSP_Length, _ __vDSP_M: vDSP_Length)

    Objective-C

    void vDSP_vlint ( const float *__vDSP_A, const float *__vDSP_B, vDSP_Stride __vDSP_IB, float *__vDSP_C, vDSP_Stride __vDSP_IC, vDSP_Length __vDSP_N, vDSP_Length __vDSP_M );

    Parameters

    __vDSP_A

    Single-precision real input vector.

    __vDSP_B

    Single-precision real input vector: integer parts are indices into A and fractional parts are interpolation constants.

    __vDSP_J

    Address stride for B.

    __vDSP_C

    Single-precision real output vector.

    __vDSP_K

    Address stride for C.

    __vDSP_N

    Element count for C.

    __vDSP_M

    Length of A.

    Discussion

    Performs the following operation:

    image: ../art/vdsp_118.eps

    Generates vector C by interpolating between neighboring values of vector A as controlled by vector B. The integer portion of each element in B is the zero-based index of the first element of a pair of adjacent values in vector A.

    The value of the corresponding element of C is derived from these two values by linear interpolation, using the fractional part of the value in B.

    Argument M is not used in the calculation. However, the integer parts of the values in B must be greater than or equal to zero and less than or equal to M - 2.

    Import Statement

    Objective-C

    @import Accelerate;

    Swift

    import Accelerate

    Availability

    Available in iOS 4.0 and later.

  • Vector linear interpolation between neighboring elements; double precision.

    Declaration

    Swift

    func vDSP_vlintD(_ __vDSP_A: UnsafePointer<Double>, _ __vDSP_B: UnsafePointer<Double>, _ __vDSP_J: vDSP_Stride, _ __vDSP_C: UnsafeMutablePointer<Double>, _ __vDSP_K: vDSP_Stride, _ __vDSP_N: vDSP_Length, _ __vDSP_M: vDSP_Length)

    Objective-C

    void vDSP_vlintD ( const double *__vDSP_A, const double *__vDSP_B, vDSP_Stride __vDSP_IB, double *__vDSP_C, vDSP_Stride __vDSP_IC, vDSP_Length __vDSP_N, vDSP_Length __vDSP_M );

    Parameters

    __vDSP_A

    Double-precision real input vector.

    __vDSP_B

    Double-precision real input vector: integer parts are indices into A and fractional parts are interpolation constants.

    __vDSP_J

    Address stride for B.

    __vDSP_C

    Double-precision real output vector.

    __vDSP_K

    Address stride for C.

    __vDSP_N

    Element count for C.

    __vDSP_M

    Length of A.

    Discussion

    Performs the following operation:

    image: ../art/vdsp_118.eps

    Generates vector C by interpolating between neighboring values of vector A as controlled by vector B. The integer portion of each element in B is the zero-based index of the first element of a pair of adjacent values in vector A.

    The value of the corresponding element of C is derived from these two values by linear interpolation, using the fractional part of the value in B.

    Argument M is not used in the calculation. However, the integer parts of the values in B must be greater than or equal to zero and less than or equal to M - 2.

    Import Statement

    Objective-C

    @import Accelerate;

    Swift

    import Accelerate

    Availability

    Available in iOS 4.0 and later.

The functions in this group perform integration on the values in a vector.

  • Vector running sum integration; single precision.

    Declaration

    Swift

    func vDSP_vrsum(_ __vDSP_A: UnsafePointer<Float>, _ __vDSP_I: vDSP_Stride, _ __vDSP_S: UnsafePointer<Float>, _ __vDSP_C: UnsafeMutablePointer<Float>, _ __vDSP_K: vDSP_Stride, _ __vDSP_N: vDSP_Length)

    Objective-C

    void vDSP_vrsum ( const float *__vDSP_A, vDSP_Stride __vDSP_IA, const float *__vDSP_S, float *__vDSP_C, vDSP_Stride __vDSP_IC, vDSP_Length __vDSP_N );

    Parameters

    __vDSP_A

    Single-precision real input vector.

    __vDSP_I

    Address stride for A.

    __vDSP_S

    Single-precision real input scalar: weighting factor.

    __vDSP_C

    Single-precision real output vector.

    __vDSP_K

    Stride for C

    __vDSP_N

    The number of elements to process.

    Discussion

    Performs the following operation:

    image: ../art/vdsp_156.eps

    Integrates vector A using a running sum from vector C. Vector A is weighted by scalar S and added to the previous output point. The first element from vector A is not used in the sum.

    Import Statement

    Objective-C

    @import Accelerate;

    Swift

    import Accelerate

    Availability

    Available in iOS 4.0 and later.

  • Vector running sum integration; double precision.

    Declaration

    Swift

    func vDSP_vrsumD(_ __vDSP_A: UnsafePointer<Double>, _ __vDSP_I: vDSP_Stride, _ __vDSP_S: UnsafePointer<Double>, _ __vDSP_C: UnsafeMutablePointer<Double>, _ __vDSP_K: vDSP_Stride, _ __vDSP_N: vDSP_Length)

    Objective-C

    void vDSP_vrsumD ( const double *__vDSP_A, vDSP_Stride __vDSP_IA, const double *__vDSP_S, double *__vDSP_C, vDSP_Stride __vDSP_IC, vDSP_Length __vDSP_N );

    Parameters

    __vDSP_A

    Double-precision real input vector.

    __vDSP_I

    Address stride for A.

    __vDSP_S

    Double-precision real input scalar: weighting factor.

    __vDSP_C

    Double-precision real output vector.

    __vDSP_K

    Address stride for C.

    __vDSP_N

    The number of elements to process.

    Discussion

    Performs the following operation:

    image: ../art/vdsp_156.eps

    Integrates vector A using a running sum from vector C. Vector A is weighted by scalar S and added to the previous output point. The first element from vector A is not used in the sum.

    Import Statement

    Objective-C

    @import Accelerate;

    Swift

    import Accelerate

    Availability

    Available in iOS 4.0 and later.

  • Simpson integration; single precision.

    Declaration

    Swift

    func vDSP_vsimps(_ __vDSP_A: UnsafePointer<Float>, _ __vDSP_I: vDSP_Stride, _ __vDSP_B: UnsafePointer<Float>, _ __vDSP_C: UnsafeMutablePointer<Float>, _ __vDSP_K: vDSP_Stride, _ __vDSP_N: vDSP_Length)

    Objective-C

    void vDSP_vsimps ( const float *__vDSP_A, vDSP_Stride __vDSP_IA, const float *__vDSP_B, float *__vDSP_C, vDSP_Stride __vDSP_IC, vDSP_Length __vDSP_N );

    Parameters

    __vDSP_A

    Single-precision real input vector.

    __vDSP_I

    Address stride for A.

    __vDSP_B

    Single-precision real input scalar.

    __vDSP_C

    Single-precision real output vector.

    __vDSP_K

    Stride for C

    __vDSP_N

    The number of elements to process.

    Discussion

    Performs the following operation:

    image: ../art/vdsp_139.eps

    Integrates vector A using Simpson integration, storing results in vector C. Scalar B specifies the integration step size. This function can only be done out of place.

    Import Statement

    Objective-C

    @import Accelerate;

    Swift

    import Accelerate

    Availability

    Available in iOS 4.0 and later.

  • Simpson integration; double precision.

    Declaration

    Swift

    func vDSP_vsimpsD(_ __vDSP_A: UnsafePointer<Double>, _ __vDSP_I: vDSP_Stride, _ __vDSP_B: UnsafePointer<Double>, _ __vDSP_C: UnsafeMutablePointer<Double>, _ __vDSP_K: vDSP_Stride, _ __vDSP_N: vDSP_Length)

    Objective-C

    void vDSP_vsimpsD ( const double *__vDSP_A, vDSP_Stride __vDSP_IA, const double *__vDSP_B, double *__vDSP_C, vDSP_Stride __vDSP_IC, vDSP_Length __vDSP_N );

    Parameters

    __vDSP_A

    Double-precision real input vector.

    __vDSP_I

    Address stride for A.

    __vDSP_B

    Double-precision real input scalar.

    __vDSP_C

    Double-precision real output vector.

    __vDSP_K

    Stride for C

    __vDSP_N

    The number of elements to process.

    Discussion

    Performs the following operation:

    image: ../art/vdsp_139.eps

    Integrates vector A using Simpson integration, storing results in vector C. Scalar B specifies the integration step size. This function can only be done out of place.

    Import Statement

    Objective-C

    @import Accelerate;

    Swift

    import Accelerate

    Availability

    Available in iOS 4.0 and later.

  • Vector trapezoidal integration; single precision.

    Declaration

    Swift

    func vDSP_vtrapz(_ __vDSP_A: UnsafePointer<Float>, _ __vDSP_I: vDSP_Stride, _ __vDSP_B: UnsafePointer<Float>, _ __vDSP_C: UnsafeMutablePointer<Float>, _ __vDSP_K: vDSP_Stride, _ __vDSP_N: vDSP_Length)

    Objective-C

    void vDSP_vtrapz ( const float *__vDSP_A, vDSP_Stride __vDSP_IA, const float *__vDSP_B, float *__vDSP_C, vDSP_Stride __vDSP_IC, vDSP_Length __vDSP_N );

    Parameters

    __vDSP_A

    Single-precision real input vector.

    __vDSP_I

    Address stride for A.

    __vDSP_B

    Single-precision real input scalar: step size.

    __vDSP_C

    Single-precision real output vector.

    __vDSP_K

    Address stride for C.

    __vDSP_N

    The number of elements to process.

    Discussion

    Performs the following operation:

    image: ../art/vdsp_149.eps

    Estimates the integral of vector A using the trapezoidal rule. Scalar B specifies the integration step size. This function can only be done out of place.

    Import Statement

    Objective-C

    @import Accelerate;

    Swift

    import Accelerate

    Availability

    Available in iOS 4.0 and later.

  • Vector trapezoidal integration; double precision.

    Declaration

    Swift

    func vDSP_vtrapzD(_ __vDSP_A: UnsafePointer<Double>, _ __vDSP_I: vDSP_Stride, _ __vDSP_B: UnsafePointer<Double>, _ __vDSP_C: UnsafeMutablePointer<Double>, _ __vDSP_K: vDSP_Stride, _ __vDSP_N: vDSP_Length)

    Objective-C

    void vDSP_vtrapzD ( const double *__vDSP_A, vDSP_Stride __vDSP_IA, const double *__vDSP_B, double *__vDSP_C, vDSP_Stride __vDSP_IC, vDSP_Length __vDSP_N );

    Parameters

    __vDSP_A

    Double-precision real input vector.

    __vDSP_I

    Address stride for A.

    __vDSP_B

    Double-precision real input scalar: step size.

    __vDSP_C

    Double-precision real output vector.

    __vDSP_K

    Stride for C

    __vDSP_N

    The number of elements to process.

    Discussion

    Performs the following operation:

    image: ../art/vdsp_149.eps

    Estimates the integral of vector A using the trapezoidal rule. Scalar B specifies the integration step size. This function can only be done out of place.

    Import Statement

    Objective-C

    @import Accelerate;

    Swift

    import Accelerate

    Availability

    Available in iOS 4.0 and later.

The functions in this group find sort the values in a vector.

  • Vector in-place sort; single precision.

    Declaration

    Swift

    func vDSP_vsort(_ __vDSP_C: UnsafeMutablePointer<Float>, _ __vDSP_N: vDSP_Length, _ __vDSP_OFLAG: Int32)

    Objective-C

    void vDSP_vsort ( float *__vDSP_C, vDSP_Length __vDSP_N, int __vDSP_Order );

    Parameters

    __vDSP_C

    Single-precision real input-output vector

    __vDSP_N

    The number of elements to process

    __vDSP_OFLAG

    Flag for sort order: 1 for ascending, -1 for descending

    Discussion

    Performs an in-place sort of vector C in the order specified by parameter OFLAG.

    Import Statement

    Objective-C

    @import Accelerate;

    Swift

    import Accelerate

    Availability

    Available in iOS 4.0 and later.

  • Vector in-place sort; double precision.

    Declaration

    Swift

    func vDSP_vsortD(_ __vDSP_C: UnsafeMutablePointer<Double>, _ __vDSP_N: vDSP_Length, _ __vDSP_OFLAG: Int32)

    Objective-C

    void vDSP_vsortD ( double *__vDSP_C, vDSP_Length __vDSP_N, int __vDSP_Order );

    Parameters

    __vDSP_C

    Double-precision real input-output vector

    __vDSP_N

    The number of elements to process

    __vDSP_OFLAG

    Flag for sort order: 1 for ascending, -1 for descending

    Discussion

    Performs an in-place sort of vector C in the order specified by parameter OFLAG.

    Import Statement

    Objective-C

    @import Accelerate;

    Swift

    import Accelerate

    Availability

    Available in iOS 4.0 and later.

  • Vector index in-place sort; single precision.

    Declaration

    Swift

    func vDSP_vsorti(_ __vDSP_C: UnsafePointer<Float>, _ __vDSP_IC: UnsafeMutablePointer<vDSP_Length>, _ __vDSP_List_addr: UnsafeMutablePointer<vDSP_Length>, _ __vDSP_N: vDSP_Length, _ __vDSP_OFLAG: Int32)

    Objective-C

    void vDSP_vsorti ( const float *__vDSP_C, vDSP_Length *__vDSP_I, vDSP_Length *__vDSP_Temporary, vDSP_Length __vDSP_N, int __vDSP_Order );

    Parameters

    __vDSP_C

    Single-precision real input vector

    __vDSP_IC

    Integer output vector. Must be initialized with the indices of vector C, from 0 to N-1.

    __vDSP_List_addr

    Temporary vector. This is currently not used and NULL should be passed.

    __vDSP_N

    The number of elements to process

    __vDSP_OFLAG

    Flag for sort order: 1 for ascending, -1 for descending

    Discussion

    Leaves input vector C unchanged and performs an in-place sort of the indices in vector IC according to the values in C. The sort order is specified by parameter OFLAG.

    The values in C can then be obtained in sorted order, by taking indices in sequence from IC.

    Import Statement

    Objective-C

    @import Accelerate;

    Swift

    import Accelerate

    Availability

    Available in iOS 4.0 and later.

  • Vector index in-place sort; double precision.

    Declaration

    Swift

    func vDSP_vsortiD(_ __vDSP_C: UnsafePointer<Double>, _ __vDSP_IC: UnsafeMutablePointer<vDSP_Length>, _ __vDSP_List_addr: UnsafeMutablePointer<vDSP_Length>, _ __vDSP_N: vDSP_Length, _ __vDSP_OFLAG: Int32)

    Objective-C

    void vDSP_vsortiD ( const double *__vDSP_C, vDSP_Length *__vDSP_I, vDSP_Length *__vDSP_Temporary, vDSP_Length __vDSP_N, int __vDSP_Order );

    Parameters

    __vDSP_C

    Double-precision real input vector

    __vDSP_IC

    Integer output vector. Must be initialized with the indices of vector C, from 0 to N-1.

    __vDSP_List_addr

    Temporary vector. This is currently not used and NULL should be passed.

    __vDSP_N

    The number of elements to process

    __vDSP_OFLAG

    Flag for sort order: 1 for ascending, -1 for descending

    Discussion

    Leaves input vector C unchanged and performs an in-place sort of the indices in vector IC according to the values in C. The sort order is specified by parameter OFLAG.

    The values in C can then be obtained in sorted order, by taking indices in sequence from IC.

    Import Statement

    Objective-C

    @import Accelerate;

    Swift

    import Accelerate

    Availability

    Available in iOS 4.0 and later.

The functions in this group calculates a sliding-window sum for a vector.

  • Vector sliding window sum; single precision.

    Declaration

    Swift

    func vDSP_vswsum(_ __vDSP_A: UnsafePointer<Float>, _ __vDSP_I: vDSP_Stride, _ __vDSP_C: UnsafeMutablePointer<Float>, _ __vDSP_K: vDSP_Stride, _ __vDSP_N: vDSP_Length, _ __vDSP_P: vDSP_Length)

    Objective-C

    void vDSP_vswsum ( const float *__vDSP_A, vDSP_Stride __vDSP_IA, float *__vDSP_C, vDSP_Stride __vDSP_IC, vDSP_Length __vDSP_N, vDSP_Length __vDSP_P );

    Parameters

    __vDSP_A

    Single-precision real input vector. __vDSP_A must contain __vDSP_N + __vDSP_P - 1 elements.

    __vDSP_I

    Address stride for __vDSP_A.

    __vDSP_C

    Single-precision real output vector.

    __vDSP_K

    Address stride for __vDSP_C.

    __vDSP_N

    Number of output points.

    __vDSP_P

    Length of window.

    Discussion

    Writes the sliding window sum of __vDSP_P consecutive elements of vector __vDSP_A to vector __vDSP_C, for each of __vDSP_N possible starting positions of the __vDSP_P-element window in vector __vDSP_A.

    Performs the following operation:

    • for (n = 0; n < N; ++n)
    • C[n] = sum(A[n+p], 0 <= p < P);

    Import Statement

    Objective-C

    @import Accelerate;

    Swift

    import Accelerate

    Availability

    Available in iOS 4.0 and later.

  • Vector sliding window sum; double precision.

    Declaration

    Swift

    func vDSP_vswsumD(_ __vDSP_A: UnsafePointer<Double>, _ __vDSP_I: vDSP_Stride, _ __vDSP_C: UnsafeMutablePointer<Double>, _ __vDSP_K: vDSP_Stride, _ __vDSP_N: vDSP_Length, _ __vDSP_P: vDSP_Length)

    Objective-C

    void vDSP_vswsumD ( const double *__vDSP_A, vDSP_Stride __vDSP_IA, double *__vDSP_C, vDSP_Stride __vDSP_IC, vDSP_Length __vDSP_N, vDSP_Length __vDSP_P );

    Parameters

    __vDSP_A

    Double-precision real input vector. __vDSP_A must contain __vDSP_N + __vDSP_P - 1 elements.

    __vDSP_I

    Address stride for A.

    __vDSP_C

    Double-precision real output vector.

    __vDSP_K

    Address stride for C.

    __vDSP_N

    Number of output points.

    __vDSP_P

    Length of window.

    Discussion

    Writes the sliding window sum of __vDSP_P consecutive elements of vector __vDSP_A to vector __vDSP_C, for each of __vDSP_N possible starting positions of the __vDSP_P-element window in vector __vDSP_A.

    Performs the following operation:

    • for (n = 0; n < N; ++n)
    • C[n] = sum(A[n+p], 0 <= p < P);

    Import Statement

    Objective-C

    @import Accelerate;

    Swift

    import Accelerate

    Availability

    Available in iOS 4.0 and later.

The functions in this group convert between single-precision and double-precision floating-point vectors.

  • Vector convert double-precision to single-precision.

    Declaration

    Swift

    func vDSP_vdpsp(_ __vDSP_A: UnsafePointer<Double>, _ __vDSP_I: vDSP_Stride, _ __vDSP_C: UnsafeMutablePointer<Float>, _ __vDSP_K: vDSP_Stride, _ __vDSP_N: vDSP_Length)

    Objective-C

    void vDSP_vdpsp ( const double *__vDSP_A, vDSP_Stride __vDSP_IA, float *__vDSP_C, vDSP_Stride __vDSP_IC, vDSP_Length __vDSP_N );

    Parameters

    __vDSP_A

    Double-precision real input vector.

    __vDSP_I

    Address stride for A.

    __vDSP_C

    Single-precision real output vector.

    __vDSP_K

    Address stride for C.

    __vDSP_N

    The number of elements to process.

    Discussion

    This performs the following operation:

    image: ../art/vdsp_90.eps

    Creates single-precision vector C by converting double-precision inputs from vector A.

    Import Statement

    Objective-C

    @import Accelerate;

    Swift

    import Accelerate

    Availability

    Available in iOS 4.0 and later.

  • Vector convert single-precision to double-precision.

    Declaration

    Swift

    func vDSP_vspdp(_ __vDSP_A: UnsafePointer<Float>, _ __vDSP_I: vDSP_Stride, _ __vDSP_C: UnsafeMutablePointer<Double>, _ __vDSP_K: vDSP_Stride, _ __vDSP_N: vDSP_Length)

    Objective-C

    void vDSP_vspdp ( const float *__vDSP_A, vDSP_Stride __vDSP_IA, double *__vDSP_C, vDSP_Stride __vDSP_IC, vDSP_Length __vDSP_N );

    Parameters

    __vDSP_A

    Single-precision real input vector.

    __vDSP_I

    Address stride for A.

    __vDSP_C

    Double-precision real output vector.

    __vDSP_K

    Address stride for C.

    __vDSP_N

    The number of elements to process.

    Discussion

    This performs the following operation:

    image: ../art/vdsp_143.eps

    Creates double-precision vector C by converting single-precision inputs from vector A. This function can only be done out of place.

    Import Statement

    Objective-C

    @import Accelerate;

    Swift

    import Accelerate

    Availability

    Available in iOS 4.0 and later.

The functions in this group convert the values in a vector from floating-point values to integer values of a given size.

  • Converts an array of single-precision floating-point values to signed 8-bit integer values, rounding towards zero.

    Declaration

    Swift

    func vDSP_vfix8(_ __vDSP_A: UnsafePointer<Float>, _ __vDSP_I: vDSP_Stride, _ __vDSP_C: UnsafeMutablePointer<Int8>, _ __vDSP_K: vDSP_Stride, _ __vDSP_N: vDSP_Length)

    Objective-C

    void vDSP_vfix8 ( const float *__vDSP_A, vDSP_Stride __vDSP_IA, char *__vDSP_C, vDSP_Stride __vDSP_IC, vDSP_Length __vDSP_N );

    Parameters

    __vDSP_A

    Source vector.

    __vDSP_I

    Source vector stride length.

    __vDSP_C

    Destination vector.

    __vDSP_K

    Destination vector stride length.

    __vDSP_N

    Number of elements in vector.

    Discussion

    If the resulting value is outside the bounds of the output type, the behavior is undefined. If you need to handle out-of-bounds data, you should use one of the functions in Single-Vector Clipping, Limit, and Threshold Operations on the data first.

    Import Statement

    Objective-C

    @import Accelerate;

    Swift

    import Accelerate

    Availability

    Available in iOS 4.0 and later.

  • Converts an array of double-precision floating-point values to signed 8-bit integer values, rounding towards zero.

    Declaration

    Swift

    func vDSP_vfix8D(_ __vDSP_A: UnsafePointer<Double>, _ __vDSP_I: vDSP_Stride, _ __vDSP_C: UnsafeMutablePointer<Int8>, _ __vDSP_K: vDSP_Stride, _ __vDSP_N: vDSP_Length)

    Objective-C

    void vDSP_vfix8D ( const double *__vDSP_A, vDSP_Stride __vDSP_IA, char *__vDSP_C, vDSP_Stride __vDSP_IC, vDSP_Length __vDSP_N );

    Parameters

    __vDSP_A

    Source vector.

    __vDSP_I

    Source vector stride length.

    __vDSP_C

    Destination vector.

    __vDSP_K

    Destination vector stride length.

    __vDSP_N

    Number of elements in vector.

    Discussion

    If the resulting value is outside the bounds of the output type, the behavior is undefined. If you need to handle out-of-bounds data, you should use one of the functions in Single-Vector Clipping, Limit, and Threshold Operations on the data first.

    Import Statement

    Objective-C

    @import Accelerate;

    Swift

    import Accelerate

    Availability

    Available in iOS 4.0 and later.

  • Converts an array of single-precision floating-point values to signed 16-bit integer values, rounding towards zero.

    Declaration

    Swift

    func vDSP_vfix16(_ __vDSP_A: UnsafePointer<Float>, _ __vDSP_I: vDSP_Stride, _ __vDSP_C: UnsafeMutablePointer<Int16>, _ __vDSP_K: vDSP_Stride, _ __vDSP_N: vDSP_Length)

    Objective-C

    void vDSP_vfix16 ( const float *__vDSP_A, vDSP_Stride __vDSP_IA, short *__vDSP_C, vDSP_Stride __vDSP_IC, vDSP_Length __vDSP_N );

    Parameters

    __vDSP_A

    Source vector.

    __vDSP_I

    Source vector stride length.

    __vDSP_C

    Destination vector.

    __vDSP_K

    Destination vector stride length.

    __vDSP_N

    Number of elements in vector.

    Discussion

    If the resulting value is outside the bounds of the output type, the behavior is undefined. If you need to handle out-of-bounds data, you should use one of the functions in Single-Vector Clipping, Limit, and Threshold Operations on the data first.

    Import Statement

    Objective-C

    @import Accelerate;

    Swift

    import Accelerate

    Availability

    Available in iOS 4.0 and later.

  • Converts an array of double-precision floating-point values to signed 16-bit integer values, rounding towards zero.

    Declaration

    Swift

    func vDSP_vfix16D(_ __vDSP_A: UnsafePointer<Double>, _ __vDSP_I: vDSP_Stride, _ __vDSP_C: UnsafeMutablePointer<Int16>, _ __vDSP_K: vDSP_Stride, _ __vDSP_N: vDSP_Length)

    Objective-C

    void vDSP_vfix16D ( const double *__vDSP_A, vDSP_Stride __vDSP_IA, short *__vDSP_C, vDSP_Stride __vDSP_IC, vDSP_Length __vDSP_N );

    Parameters

    __vDSP_A

    Source vector.

    __vDSP_I

    Source vector stride length.

    __vDSP_C

    Destination vector.

    __vDSP_K

    Destination vector stride length.

    __vDSP_N

    Number of elements in vector.

    Discussion

    If the resulting value is outside the bounds of the output type, the behavior is undefined. If you need to handle out-of-bounds data, you should use one of the functions in Single-Vector Clipping, Limit, and Threshold Operations on the data first.

    Import Statement

    Objective-C

    @import Accelerate;

    Swift

    import Accelerate

    Availability

    Available in iOS 4.0 and later.

  • Converts an array of single-precision floating-point values to signed 32-bit integer values, rounding towards zero.

    Declaration

    Swift

    func vDSP_vfix32(_ __vDSP_A: UnsafePointer<Float>, _ __vDSP_I: vDSP_Stride, _ __vDSP_C: UnsafeMutablePointer<Int32>, _ __vDSP_K: vDSP_Stride, _ __vDSP_N: vDSP_Length)

    Objective-C

    void vDSP_vfix32 ( const float *__vDSP_A, vDSP_Stride __vDSP_IA, int *__vDSP_C, vDSP_Stride __vDSP_IC, vDSP_Length __vDSP_N );

    Parameters

    __vDSP_A

    Source vector.

    __vDSP_I

    Source vector stride length.

    __vDSP_C

    Destination vector.

    __vDSP_K

    Destination vector stride length.

    __vDSP_N

    Number of elements in vector.

    Discussion

    If the resulting value is outside the bounds of the output type, the behavior is undefined. If you need to handle out-of-bounds data, you should use one of the functions in Single-Vector Clipping, Limit, and Threshold Operations on the data first.

    Import Statement

    Objective-C

    @import Accelerate;

    Swift

    import Accelerate

    Availability

    Available in iOS 4.0 and later.

  • Converts an array of double-precision floating-point values to signed 16-bit integer values, rounding towards zero.

    Declaration

    Swift

    func vDSP_vfix32D(_ __vDSP_A: UnsafePointer<Double>, _ __vDSP_I: vDSP_Stride, _ __vDSP_C: UnsafeMutablePointer<Int32>, _ __vDSP_K: vDSP_Stride, _ __vDSP_N: vDSP_Length)

    Objective-C

    void vDSP_vfix32D ( const double *__vDSP_A, vDSP_Stride __vDSP_IA, int *__vDSP_C, vDSP_Stride __vDSP_IC, vDSP_Length __vDSP_N );

    Parameters

    __vDSP_A

    Source vector.

    __vDSP_I

    Source vector stride length.

    __vDSP_C

    Destination vector.

    __vDSP_K

    Destination vector stride length.

    __vDSP_N

    Number of elements in vector.

    Discussion

    If the resulting value is outside the bounds of the output type, the behavior is undefined. If you need to handle out-of-bounds data, you should use one of the functions in Single-Vector Clipping, Limit, and Threshold Operations on the data first.

    Import Statement

    Objective-C

    @import Accelerate;

    Swift

    import Accelerate

    Availability

    Available in iOS 4.0 and later.

  • Converts an array of single-precision floating-point values to signed 8-bit integer values, rounding towards nearest integer.

    Declaration

    Swift

    func vDSP_vfixr8(_ __vDSP_A: UnsafePointer<Float>, _ __vDSP_I: vDSP_Stride, _ __vDSP_C: UnsafeMutablePointer<Int8>, _ __vDSP_K: vDSP_Stride, _ __vDSP_N: vDSP_Length)

    Objective-C

    void vDSP_vfixr8 ( const float *__vDSP_A, vDSP_Stride __vDSP_IA, char *__vDSP_C, vDSP_Stride __vDSP_IC, vDSP_Length __vDSP_N );

    Parameters

    __vDSP_A

    Source vector.

    __vDSP_I

    Source vector stride length.

    __vDSP_C

    Destination vector.

    __vDSP_K

    Destination vector stride length.

    __vDSP_N

    Number of elements in vector.

    Discussion

    If the resulting value is outside the bounds of the output type, the behavior is undefined. If you need to handle out-of-bounds data, you should use one of the functions in Single-Vector Clipping, Limit, and Threshold Operations on the data first.

    Import Statement

    Objective-C

    @import Accelerate;

    Swift

    import Accelerate

    Availability

    Available in iOS 4.0 and later.

  • Converts an array of double-precision floating-point values to signed 8-bit integer values, rounding towards nearest integer.

    Declaration

    Swift

    func vDSP_vfixr8D(_ __vDSP_A: UnsafePointer<Double>, _ __vDSP_I: vDSP_Stride, _ __vDSP_C: UnsafeMutablePointer<Int8>, _ __vDSP_K: vDSP_Stride, _ __vDSP_N: vDSP_Length)

    Objective-C

    void vDSP_vfixr8D ( const double *__vDSP_A, vDSP_Stride __vDSP_IA, char *__vDSP_C, vDSP_Stride __vDSP_IC, vDSP_Length __vDSP_N );

    Parameters

    __vDSP_A

    Source vector.

    __vDSP_I

    Source vector stride length.

    __vDSP_C

    Destination vector.

    __vDSP_K

    Destination vector stride length.

    __vDSP_N

    Number of elements in vector.

    Discussion

    If the resulting value is outside the bounds of the output type, the behavior is undefined. If you need to handle out-of-bounds data, you should use one of the functions in Single-Vector Clipping, Limit, and Threshold Operations on the data first.

    Import Statement

    Objective-C

    @import Accelerate;

    Swift

    import Accelerate

    Availability

    Available in iOS 4.0 and later.