Mac 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

  • Biquadratic filtering

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.

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

The functions in this group fill each element in a vector with a specific value or clear each element.

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

  • Build ramped vector; single precision.

    Declaration

    Swift

    func vDSP_vramp(_ __A: UnsafePointer<Float>, _ __B: UnsafePointer<Float>, _ __C: UnsafeMutablePointer<Float>, _ __IC: vDSP_Stride, _ __N: vDSP_Length)

    Objective-C

    void vDSP_vramp ( const float *__A, const float *__B, float *__C, vDSP_Stride __IC, vDSP_Length __N );

    Parameters

    __A

    Pointer to single-precision real input scalar: initial value.

    __B

    Pointer to single-precision real input scalar: increment (or decrement if negative).

    __C

    Single-precision real output vector.

    __IC

    Address stride for C.

    __N

    The number of elements to process.

    Discussion

    Performs the following operation:

    image: ../art/vdsp_132_2x.png

    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.

    Availability

    Available in OS X v10.4 and later.

  • Build ramped vector; double precision.

    Declaration

    Swift

    func vDSP_vrampD(_ __A: UnsafePointer<Double>, _ __B: UnsafePointer<Double>, _ __C: UnsafeMutablePointer<Double>, _ __IC: vDSP_Stride, _ __N: vDSP_Length)

    Objective-C

    void vDSP_vrampD ( const double *__A, const double *__B, double *__C, vDSP_Stride __IC, vDSP_Length __N );

    Discussion

    This function is the same as vDSP_vramp, except for the types of scalars *A and *B and vector C.

    Availability

    Available in OS X v10.4 and later.

  • Builds a ramped vector and multiplies by a source vector; single precision

    Declaration

    Swift

    func vDSP_vrampmul(_ __I: UnsafePointer<Float>, _ __IS: vDSP_Stride, _ __Start: UnsafeMutablePointer<Float>, _ __Step: UnsafePointer<Float>, _ __O: UnsafeMutablePointer<Float>, _ __OS: vDSP_Stride, _ __N: vDSP_Length)

    Objective-C

    void vDSP_vrampmul ( const float *__I, vDSP_Stride __IS, float *__Start, const float *__Step, float *__O, vDSP_Stride __OS, vDSP_Length __N );

    Parameters

    __I

    Single precision input vector, multiplied by the ramp function.

    __IS

    Address stride length in input vector.

    __Start

    The single-precision 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.

    __Step

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

    __O

    The single-precision output vector.

    __OS

    Address stride length in output vector.

    __N

    The number of elements to modify.

    Discussion

    This routine calculates the following:

    1. for (i = 0; i < N; ++i) {
    2. O[i*OS] = *Start * I[i*IS];
    3. *Start += *Step;
    4. }

    Availability

    Available in OS X v10.6 and later.

  • Builds a ramped vector and multiplies by a source vector; double precision.

    Declaration

    Swift

    func vDSP_vrampmulD(_ __I: UnsafePointer<Double>, _ __IS: vDSP_Stride, _ __Start: UnsafeMutablePointer<Double>, _ __Step: UnsafePointer<Double>, _ __O: UnsafeMutablePointer<Double>, _ __OS: vDSP_Stride, _ __N: vDSP_Length)

    Objective-C

    void vDSP_vrampmulD ( const double *__I, vDSP_Stride __IS, double *__Start, const double *__Step, double *__O, vDSP_Stride __OS, vDSP_Length __N );

    Discussion

    This is the same as vDSP_vrampmul, except for the types of the input and output vectors and the ramp parameters

    Availability

    Available in OS X v10.10 and later.

  • Vector fixed-point 1.15 format version of vDSP_vrampmul.

    Declaration

    Swift

    func vDSP_vrampmul_s1_15(_ __I: UnsafePointer<Int16>, _ __IS: vDSP_Stride, _ __Start: UnsafeMutablePointer<Int16>, _ __Step: UnsafePointer<Int16>, _ __O: UnsafeMutablePointer<Int16>, _ __OS: vDSP_Stride, _ __N: vDSP_Length)

    Objective-C

    void vDSP_vrampmul_s1_15 ( const short *__I, vDSP_Stride __IS, short *__Start, const short *__Step, short *__O, vDSP_Stride __OS, vDSP_Length __N );

    Parameters

    __I

    Input vector, multiplied by the ramp function.

    __IS

    Address stride length in input vector.

    __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.

    __Step

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

    __O

    The output vector.

    __OS

    Address stride length in output vector.

    __N

    The number of elements to modify.

    Discussion

    This routine calculates the following:

    1. for (i = 0; i < N; ++i) {
    2. O[i*OS] = *Start * I[i*IS];
    3. *Start += *Step;
    4. }

    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.

    Availability

    Available in OS X v10.6 and later.

  • Vector fixed-point 8.24 format version of vDSP_vrampmul.

    Declaration

    Swift

    func vDSP_vrampmul_s8_24(_ __I: UnsafePointer<Int32>, _ __IS: vDSP_Stride, _ __Start: UnsafeMutablePointer<Int32>, _ __Step: UnsafePointer<Int32>, _ __O: UnsafeMutablePointer<Int32>, _ __OS: vDSP_Stride, _ __N: vDSP_Length)

    Objective-C

    void vDSP_vrampmul_s8_24 ( const int *__I, vDSP_Stride __IS, int *__Start, const int *__Step, int *__O, vDSP_Stride __OS, vDSP_Length __N );

    Parameters

    __I

    Input vector, multiplied by the ramp function.

    __IS

    Address stride length in input vector.

    __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.

    __Step

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

    __O

    The output vector.

    __OS

    Address stride length in output vector.

    __N

    The number of elements to modify.

    Discussion

    This routine calculates the following:

    1. for (i = 0; i < N; ++i) {
    2. O[i*OS] = *Start * I[i*IS];
    3. *Start += *Step;
    4. }

    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.

    Availability

    Available in OS X v10.6 and later.

  • Stereo version of vDSP_vrampmul.

    Declaration

    Swift

    func vDSP_vrampmul2(_ __I0: UnsafePointer<Float>, _ __I1: UnsafePointer<Float>, _ __IS: vDSP_Stride, _ __Start: UnsafeMutablePointer<Float>, _ __Step: UnsafePointer<Float>, _ __O0: UnsafeMutablePointer<Float>, _ __O1: UnsafeMutablePointer<Float>, _ __OS: vDSP_Stride, _ __N: vDSP_Length)

    Objective-C

    void vDSP_vrampmul2 ( const float *__I0, const float *__I1, vDSP_Stride __IS, float *__Start, const float *__Step, float *__O0, float *__O1, vDSP_Stride __OS, vDSP_Length __N );

    Parameters

    __I0

    First single-precision input vector.

    __I1

    Second single-precision input vector.

    __IS

    Stride for both input vectors.

    __Start

    The initial single-precision 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.

    __Step

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

    __O0

    First single-precision output vector.

    __O1

    Second single-precision output vector.

    __OS

    Stride for both output vectors.

    __N

    The number of elements to process in each vector.

    Discussion

    This function calculates the following:

    1. for (i = 0; i < N; ++i) {
    2. O0[i*OS] = *Start * I0[i*IS];
    3. O1[i*OS] = *Start * I1[i*IS];
    4. *Start += *Step;
    5. }

    Availability

    Available in OS X v10.6 and later.

  • Double-precision version of vDSP_vrampmul2.

    Declaration

    Swift

    func vDSP_vrampmul2D(_ __I0: UnsafePointer<Double>, _ __I1: UnsafePointer<Double>, _ __IS: vDSP_Stride, _ __Start: UnsafeMutablePointer<Double>, _ __Step: UnsafePointer<Double>, _ __O0: UnsafeMutablePointer<Double>, _ __O1: UnsafeMutablePointer<Double>, _ __OS: vDSP_Stride, _ __N: vDSP_Length)

    Objective-C

    void vDSP_vrampmul2D ( const double *__I0, const double *__I1, vDSP_Stride __IS, double *__Start, const double *__Step, double *__O0, double *__O1, vDSP_Stride __OS, vDSP_Length __N );

    Discussion

    This is the same as vDSP_vrampmul2, except for the types of the vectors and the ramp parameters.

    Availability

    Available in OS X v10.10 and later.

  • Vector fixed-point 1.15 format version of vDSP_vrampmul2.

    Declaration

    Swift

    func vDSP_vrampmul2_s1_15(_ __I0: UnsafePointer<Int16>, _ __I1: UnsafePointer<Int16>, _ __IS: vDSP_Stride, _ __Start: UnsafeMutablePointer<Int16>, _ __Step: UnsafePointer<Int16>, _ __O0: UnsafeMutablePointer<Int16>, _ __O1: UnsafeMutablePointer<Int16>, _ __OS: vDSP_Stride, _ __N: vDSP_Length)

    Objective-C

    void vDSP_vrampmul2_s1_15 ( const short *__I0, const short *__I1, vDSP_Stride __IS, short *__Start, const short *__Step, short *__O0, short *__O1, vDSP_Stride __OS, vDSP_Length __N );

    Parameters

    __I0

    First input vector, multiplied by the ramp function.

    __I1

    Second input vector, multiplied by the ramp function.

    __IS

    Address stride length in input vectors.

    __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.

    __Step

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

    __O0

    First output vector.

    __O1

    Second output vector.

    __OS

    Address stride length in output vector.

    __N

    The number of elements to modify.

    Discussion

    This function calculates the following:

    1. for (i = 0; i < N; ++i) {
    2. O0[i*OS] = *Start * I0[i*IS];
    3. O1[i*OS] = *Start * I1[i*IS];
    4. *Start += *Step;
    5. }

    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.

    Availability

    Available in OS X v10.6 and later.

  • Vector fixed-point 8.24 format version of vDSP_vrampmul2.

    Declaration

    Swift

    func vDSP_vrampmul2_s8_24(_ __I0: UnsafePointer<Int32>, _ __I1: UnsafePointer<Int32>, _ __IS: vDSP_Stride, _ __Start: UnsafeMutablePointer<Int32>, _ __Step: UnsafePointer<Int32>, _ __O0: UnsafeMutablePointer<Int32>, _ __O1: UnsafeMutablePointer<Int32>, _ __OS: vDSP_Stride, _ __N: vDSP_Length)

    Objective-C

    void vDSP_vrampmul2_s8_24 ( const int *__I0, const int *__I1, vDSP_Stride __IS, int *__Start, const int *__Step, int *__O0, int *__O1, vDSP_Stride __OS, vDSP_Length __N );

    Parameters

    __I0

    First input vector, multiplied by the ramp function.

    __I1

    Second input vector, multiplied by the ramp function.

    __IS

    Address stride length in input vectors.

    __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.

    __Step

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

    __O0

    First output vector.

    __O1

    Second output vector.

    __OS

    Address stride length in output vector.

    __N

    The number of elements to modify.

    Discussion

    This function calculates the following:

    1. for (i = 0; i < N; ++i) {
    2. O0[i*OS] = *Start * I0[i*IS];
    3. O1[i*OS] = *Start * I1[i*IS];
    4. *Start += *Step;
    5. }

    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.

    Availability

    Available in OS X v10.6 and later.

  • Multiplies input vector by a value that ramps up on successive calls, and cumulatively adds the result to the output vector; single precision.

    Declaration

    Swift

    func vDSP_vrampmuladd(_ __I: UnsafePointer<Float>, _ __IS: vDSP_Stride, _ __Start: UnsafeMutablePointer<Float>, _ __Step: UnsafePointer<Float>, _ __O: UnsafeMutablePointer<Float>, _ __OS: vDSP_Stride, _ __N: vDSP_Length)

    Objective-C

    void vDSP_vrampmuladd ( const float *__I, vDSP_Stride __IS, float *__Start, const float *__Step, float *__O, vDSP_Stride __OS, vDSP_Length __N );

    Parameters

    __I

    Single-precision input vector.

    __IS

    Stride for the input vector.

    __Start

    Single-precision 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 on successive calls.

    __Step

    Single-precision value to increment each subsequent value of the ramp function by.

    __O

    Single-precision output vector.

    __OS

    Stride for the output vector.

    __N

    The number of elements to process.

    Discussion

    This routine calculates the following:

    1. for (i = 0; i < N; ++i) {
    2. O[i*OS] += *Start * I[i*IS];
    3. *Start += *Step;
    4. }

    Availability

    Available in OS X v10.6 and later.

  • Multiplies input vector by a value that ramps up on successive calls, and cumulatively adds the result to the output vector; double precision.

    Declaration

    Swift

    func vDSP_vrampmuladdD(_ __I: UnsafePointer<Double>, _ __IS: vDSP_Stride, _ __Start: UnsafeMutablePointer<Double>, _ __Step: UnsafePointer<Double>, _ __O: UnsafeMutablePointer<Double>, _ __OS: vDSP_Stride, _ __N: vDSP_Length)

    Objective-C

    void vDSP_vrampmuladdD ( const double *__I, vDSP_Stride __IS, double *__Start, const double *__Step, double *__O, vDSP_Stride __OS, vDSP_Length __N );

    Discussion

    This is the same as vDSP_vrampmuladd, except for the types of the input and output vectors and the ramp parameters.

    Availability

    Available in OS X v10.10 and later.

  • Vector fixed-point 1.15 format version of vDSP_vrampmuladd.

    Declaration

    Swift

    func vDSP_vrampmuladd_s1_15(_ __I: UnsafePointer<Int16>, _ __IS: vDSP_Stride, _ __Start: UnsafeMutablePointer<Int16>, _ __Step: UnsafePointer<Int16>, _ __O: UnsafeMutablePointer<Int16>, _ __OS: vDSP_Stride, _ __N: vDSP_Length)

    Objective-C

    void vDSP_vrampmuladd_s1_15 ( const short *__I, vDSP_Stride __IS, short *__Start, const short *__Step, short *__O, vDSP_Stride __OS, vDSP_Length __N );

    Parameters

    __I

    Input vector, multiplied by the ramp function.

    __IS

    Address stride length in input vector.

    __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.

    __Step

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

    __O

    The output vector.

    __OS

    Address stride length in output vector.

    __N

    The number of elements to modify.

    Discussion

    This routine calculates the following:

    1. for (i = 0; i < N; ++i) {
    2. O[i*OS] += *Start * I[i*IS];
    3. *Start += *Step;
    4. }

    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.

    Availability

    Available in OS X v10.6 and later.

  • Vector fixed-point 8.24 format version of vDSP_vrampmuladd.

    Declaration

    Swift

    func vDSP_vrampmuladd_s8_24(_ __I: UnsafePointer<Int32>, _ __IS: vDSP_Stride, _ __Start: UnsafeMutablePointer<Int32>, _ __Step: UnsafePointer<Int32>, _ __O: UnsafeMutablePointer<Int32>, _ __OS: vDSP_Stride, _ __N: vDSP_Length)

    Objective-C

    void vDSP_vrampmuladd_s8_24 ( const int *__I, vDSP_Stride __IS, int *__Start, const int *__Step, int *__O, vDSP_Stride __OS, vDSP_Length __N );

    Parameters

    __I

    Input vector, multiplied by the ramp function.

    __IS

    Address stride length in input vector.

    __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.

    __Step

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

    __O

    The output vector.

    __OS

    Address stride length in output vector.

    __N

    The number of elements to modify.

    Discussion

    This routine calculates the following:

    1. for (i = 0; i < N; ++i) {
    2. O[i*OS] += *Start * I[i*IS];
    3. *Start += *Step;
    4. }

    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.

    Availability

    Available in OS X v10.6 and later.

  • Stereo version of vDSP_vrampmuladd; single precision.

    Declaration

    Swift

    func vDSP_vrampmuladd2(_ __I0: UnsafePointer<Float>, _ __I1: UnsafePointer<Float>, _ __IS: vDSP_Stride, _ __Start: UnsafeMutablePointer<Float>, _ __Step: UnsafePointer<Float>, _ __O0: UnsafeMutablePointer<Float>, _ __O1: UnsafeMutablePointer<Float>, _ __OS: vDSP_Stride, _ __N: vDSP_Length)

    Objective-C

    void vDSP_vrampmuladd2 ( const float *__I0, const float *__I1, vDSP_Stride __IS, float *__Start, const float *__Step, float *__O0, float *__O1, vDSP_Stride __OS, vDSP_Length __N );

    Parameters

    __I0

    Single-precision first input vector, multiplied by the ramp function.

    __I1

    Single-precision second input vector, multiplied by the ramp function.

    __IS

    Address stride length in input vectors.

    __Start

    The single-precision 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.

    __Step

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

    __O0

    Single-precision first output vector.

    __O1

    Single-precision second output vector.

    __OS

    Address stride length in output vector.

    __N

    The number of elements to modify.

    Discussion

    This function calculates the following:

    1. for (i = 0; i < N; ++i) {
    2. O0[i*OS] += *Start * I0[i*IS];
    3. O1[i*OS] += *Start * I1[i*IS];
    4. *Start += *Step;
    5. }

    Availability

    Available in OS X v10.6 and later.

  • Stereo version of vDSP_vrampmuladdD; double precision.

    Declaration

    Swift

    func vDSP_vrampmuladd2D(_ __I0: UnsafePointer<Double>, _ __I1: UnsafePointer<Double>, _ __IS: vDSP_Stride, _ __Start: UnsafeMutablePointer<Double>, _ __Step: UnsafePointer<Double>, _ __O0: UnsafeMutablePointer<Double>, _ __O1: UnsafeMutablePointer<Double>, _ __OS: vDSP_Stride, _ __N: vDSP_Length)

    Objective-C

    void vDSP_vrampmuladd2D ( const double *__I0, const double *__I1, vDSP_Stride __IS, double *__Start, const double *__Step, double *__O0, double *__O1, vDSP_Stride __OS, vDSP_Length __N );

    Discussion

    This is the same as vDSP_vrampmuladd2, except for the types of the input and output vectors and the ramp parameters.

    Availability

    Available in OS X v10.10 and later.

  • Vector fixed-point 1.15 format version of vDSP_vrampmuladd2.

    Declaration

    Swift

    func vDSP_vrampmuladd2_s1_15(_ __I0: UnsafePointer<Int16>, _ __I1: UnsafePointer<Int16>, _ __IS: vDSP_Stride, _ __Start: UnsafeMutablePointer<Int16>, _ __Step: UnsafePointer<Int16>, _ __O0: UnsafeMutablePointer<Int16>, _ __O1: UnsafeMutablePointer<Int16>, _ __OS: vDSP_Stride, _ __N: vDSP_Length)

    Objective-C

    void vDSP_vrampmuladd2_s1_15 ( const short *__I0, const short *__I1, vDSP_Stride __IS, short *__Start, const short *__Step, short *__O0, short *__O1, vDSP_Stride __OS, vDSP_Length __N );

    Parameters

    __I0

    First input vector, multiplied by the ramp function.

    __I1

    Second input vector, multiplied by the ramp function.

    __IS

    Address stride length in input vectors.

    __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.

    __Step

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

    __O0

    First output vector.

    __O1

    Second output vector.

    __OS

    Address stride length in output vector.

    __N

    The number of elements to modify.

    Discussion

    This function calculates the following:

    1. for (i = 0; i < N; ++i) {
    2. O0[i*OS] += *Start * I0[i*IS];
    3. O1[i*OS] += *Start * I1[i*IS];
    4. *Start += *Step;
    5. }

    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.

    Availability

    Available in OS X v10.6 and later.

  • Vector fixed-point 8.24 format version of vDSP_vrampmuladd2.

    Declaration

    Swift

    func vDSP_vrampmuladd2_s8_24(_ __I0: UnsafePointer<Int32>, _ __I1: UnsafePointer<Int32>, _ __IS: vDSP_Stride, _ __Start: UnsafeMutablePointer<Int32>, _ __Step: UnsafePointer<Int32>, _ __O0: UnsafeMutablePointer<Int32>, _ __O1: UnsafeMutablePointer<Int32>, _ __OS: vDSP_Stride, _ __N: vDSP_Length)

    Objective-C

    void vDSP_vrampmuladd2_s8_24 ( const int *__I0, const int *__I1, vDSP_Stride __IS, int *__Start, const int *__Step, int *__O0, int *__O1, vDSP_Stride __OS, vDSP_Length __N );

    Parameters

    __I0

    First input vector, multiplied by the ramp function.

    __I1

    Second input vector, multiplied by the ramp function.

    __IS

    Address stride length in input vectors.

    __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.

    __Step

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

    __O0

    First output vector.

    __O1

    Second output vector.

    __OS

    Address stride length in output vector.

    __N

    The number of elements to modify.

    Discussion

    This function calculates the following:

    1. for (i = 0; i < N; ++i) {
    2. O0[i*OS] += *Start * I0[i*IS];
    3. O1[i*OS] += *Start * I1[i*IS];
    4. *Start += *Step;
    5. }

    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.

    Availability

    Available in OS X v10.6 and later.

  • Vector tapered ramp; single precision.

    Declaration

    Swift

    func vDSP_vgen(_ __A: UnsafePointer<Float>, _ __B: UnsafePointer<Float>, _ __C: UnsafeMutablePointer<Float>, _ __IC: vDSP_Stride, _ __N: vDSP_Length)

    Objective-C

    void vDSP_vgen ( const float *__A, const float *__B, float *__C, vDSP_Stride __IC, vDSP_Length __N );

    Parameters

    __A

    Pointer to single-precision real input scalar: base value.

    __B

    Pointer to single-precision real input scalar: end value.

    __C

    Single-precision real output vector.

    __IC

    Address stride for C.

    __N

    The number of elements to process.

    Discussion

    Performs the following operation:

    image: ../art/vdsp_114_2x.png

    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.

    Availability

    Available in OS X v10.4 and later.

  • Vector tapered ramp; double precision.

    Declaration

    Swift

    func vDSP_vgenD(_ __A: UnsafePointer<Double>, _ __B: UnsafePointer<Double>, _ __C: UnsafeMutablePointer<Double>, _ __IC: vDSP_Stride, _ __N: vDSP_Length)

    Objective-C

    void vDSP_vgenD ( const double *__A, const double *__B, double *__C, vDSP_Stride __IC, vDSP_Length __N );

    Discussion

    This function is the same as vDSP_vgen, except for the types of scalars *A and *B and vector C.

    Availability

    Available in OS X v10.4 and later.

  • Vector generate by extrapolation and interpolation; single precision.

    Declaration

    Swift

    func vDSP_vgenp(_ __A: UnsafePointer<Float>, _ __IA: vDSP_Stride, _ __B: UnsafePointer<Float>, _ __IB: vDSP_Stride, _ __C: UnsafeMutablePointer<Float>, _ __IC: vDSP_Stride, _ __N: vDSP_Length, _ __M: vDSP_Length)

    Objective-C

    void vDSP_vgenp ( const float *__A, vDSP_Stride __IA, const float *__B, vDSP_Stride __IB, float *__C, vDSP_Stride __IC, vDSP_Length __N, vDSP_Length __M );

    Parameters

    __A

    Single-precision real input vector.

    __IA

    Address stride for A.

    __B

    Single-precision real input vector.

    __IB

    Address stride for B.

    __C

    Single-precision real output vector.

    __IC

    Address stride for C.

    __N

    Element count for C.

    __M

    Element count for A and B.

    Discussion

    Performs the following operation:

    image: ../art/vdsp_115_2x.png

    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*IB]], the function is the constant A[0*IA].

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

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

    • For 0 <= n < N, C[n*IC] = 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.

    Availability

    Available in OS X v10.4 and later.

  • Vector generate by extrapolation and interpolation; double precision.

    Declaration

    Swift

    func vDSP_vgenpD(_ __A: UnsafePointer<Double>, _ __IA: vDSP_Stride, _ __B: UnsafePointer<Double>, _ __IB: vDSP_Stride, _ __C: UnsafeMutablePointer<Double>, _ __IC: vDSP_Stride, _ __N: vDSP_Length, _ __M: vDSP_Length)

    Objective-C

    void vDSP_vgenpD ( const double *__A, vDSP_Stride __IA, const double *__B, vDSP_Stride __IB, double *__C, vDSP_Stride __IC, vDSP_Length __N, vDSP_Length __M );

    Discussion

    This function is the same as vDSP_vgenp, except for the types of vectors A, B, and C.

    Availability

    Available in OS X v10.4 and later.

  • Vector interpolation, table lookup; single precision.

    Declaration

    Swift

    func vDSP_vtabi(_ __A: UnsafePointer<Float>, _ __IA: vDSP_Stride, _ __S1: UnsafePointer<Float>, _ __S2: UnsafePointer<Float>, _ __C: UnsafePointer<Float>, _ __M: vDSP_Length, _ __D: UnsafeMutablePointer<Float>, _ __ID: vDSP_Stride, _ __N: vDSP_Length)

    Objective-C

    void vDSP_vtabi ( const float *__A, vDSP_Stride __IA, const float *__S1, const float *__S2, const float *__C, vDSP_Length __M, float *__D, vDSP_Stride __ID, vDSP_Length __N );

    Parameters

    __A

    Single-precision real input vector.

    __IA

    Address stride for A.

    __S1

    Pointer to single-precision real input scalar: scale factor.

    __S2

    Pointer to single-precision real input scalar: base offset.

    __C

    Single-precision real input vector: lookup table.

    __M

    Lookup table size.

    __D

    Single-precision real output vector.

    __ID

    Stride for D

    __N

    The number of elements to write to D.

    Discussion

    Performs the following operation:

    image: ../art/vdsp_145_2x.png

    where F is scaling factor *S1 and G is scaling factor *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:

    1. floor(F * minimum input value + G) = 0
    2. 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.

    Availability

    Available in OS X v10.4 and later.

  • Vector interpolation, table lookup; double precision.

    Declaration

    Swift

    func vDSP_vtabiD(_ __A: UnsafePointer<Double>, _ __IA: vDSP_Stride, _ __S1: UnsafePointer<Double>, _ __S2: UnsafePointer<Double>, _ __C: UnsafePointer<Double>, _ __M: vDSP_Length, _ __ID: UnsafeMutablePointer<Double>, _ __L: vDSP_Stride, _ __N: vDSP_Length)

    Objective-C

    void vDSP_vtabiD ( const double *__A, vDSP_Stride __IA, const double *__S1, const double *__S2, const double *__C, vDSP_Length __M, double *__ID, vDSP_Stride __L, vDSP_Length __N );

    Discussion

    This function is the same as vDSP_vtabi, except for the types of scalars S1 and S2 and vectors A, C, and D.

    Availability

    Available in OS X v10.4 and later.

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

  • Compute mean and standard deviation and then calculate new elements to have a zero mean and a unit standard deviation. Single precision.

    Declaration

    Swift

    func vDSP_normalize(_ __A: UnsafePointer<Float>, _ __IA: vDSP_Stride, _ __C: UnsafeMutablePointer<Float>, _ __IC: vDSP_Stride, _ __Mean: UnsafeMutablePointer<Float>, _ __StandardDeviation: UnsafeMutablePointer<Float>, _ __N: vDSP_Length)

    Objective-C

    void vDSP_normalize ( const float *__A, vDSP_Stride __IA, float *__C, vDSP_Stride __IC, float *__Mean, float *__StandardDeviation, vDSP_Length __N );

    Parameters

    __A

    Single-precision input vector.

    __IA

    Stride for A.

    __C

    Single-precision output vector, or NULL (see Discussion below).

    __IC

    Stride for C.

    __Mean

    Single-precision mean of the elements of A.

    __StandardDeviation

    Single-precision standard deviation of the elements of A.

    __N

    Number of elements in A.

    Discussion

    The function calculates values for Mean and StandardDeviation, then calculates new values for A to have a zero mean and unit standard deviation.

    For iOS 9.0 and later or OS X 10.11 and later, the production of new elements may be omitted by passing NULL for C. In this case A remains unchanged.

    Availability

    Available in OS X v10.8 and later.

  • Compute mean and standard deviation and then calculate new elements to have a zero mean and a unit standard deviation. Double precision.

    Declaration

    Swift

    func vDSP_normalizeD(_ __A: UnsafePointer<Double>, _ __IA: vDSP_Stride, _ __C: UnsafeMutablePointer<Double>, _ __IC: vDSP_Stride, _ __Mean: UnsafeMutablePointer<Double>, _ __StandardDeviation: UnsafeMutablePointer<Double>, _ __N: vDSP_Length)

    Objective-C

    void vDSP_normalizeD ( const double *__A, vDSP_Stride __IA, double *__C, vDSP_Stride __IC, double *__Mean, double *__StandardDeviation, vDSP_Length __N );

    Discussion

    This is the same as vDSP_normalize, except for the types of A, C, Mean, and StandardDeviation.

    Availability

    Available in OS X v10.8 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(_ __A: UnsafePointer<Float>, _ __IA: vDSP_Stride, _ __C: UnsafeMutablePointer<Float>, _ __IC: vDSP_Stride, _ __N: vDSP_Length)

    Objective-C

    void vDSP_polar ( const float *__A, vDSP_Stride __IA, float *__C, vDSP_Stride __IC, vDSP_Length __N );

    Parameters

    __A

    Single-precision real input vector

    __IA

    Stride for A, must be even

    __C

    Single-precision output vector

    __IC

    Stride for C, must be even

    __N

    Number of ordered pairs processed

    Discussion

    This performs the following operation:

    image: ../art/vdsp_72_2x.png

    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.

    Availability

    Available in OS X v10.4 and later.

  • Rectangular to polar conversion; double precision.

    Declaration

    Swift

    func vDSP_polarD(_ __A: UnsafePointer<Double>, _ __IA: vDSP_Stride, _ __C: UnsafeMutablePointer<Double>, _ __IC: vDSP_Stride, _ __N: vDSP_Length)

    Objective-C

    void vDSP_polarD ( const double *__A, vDSP_Stride __IA, double *__C, vDSP_Stride __IC, vDSP_Length __N );

    Discussion

    This function is the same as vDSP_polar, except for the types of vectors A and C.

    Availability

    Available in OS X v10.4 and later.

  • Polar to rectangular conversion; single precision.

    Declaration

    Swift

    func vDSP_rect(_ __A: UnsafePointer<Float>, _ __IA: vDSP_Stride, _ __C: UnsafeMutablePointer<Float>, _ __IC: vDSP_Stride, _ __N: vDSP_Length)

    Objective-C

    void vDSP_rect ( const float *__A, vDSP_Stride __IA, float *__C, vDSP_Stride __IC, vDSP_Length __N );

    Parameters

    __A

    Single-precision real input vector

    __IA

    Stride for A, must be even

    __C

    Single-precision real output vector

    __IC

    Stride for C, must be even

    __N

    Number of ordered pairs processed

    Discussion

    This performs the following operation:

    image: ../art/vdsp_73_2x.png

    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.

    Availability

    Available in OS X v10.4 and later.

  • Polar to rectangular conversion; double precision.

    Declaration

    Swift

    func vDSP_rectD(_ __A: UnsafePointer<Double>, _ __IA: vDSP_Stride, _ __C: UnsafeMutablePointer<Double>, _ __IC: vDSP_Stride, _ __N: vDSP_Length)

    Objective-C

    void vDSP_rectD ( const double *__A, vDSP_Stride __IA, double *__C, vDSP_Stride __IC, vDSP_Length __N );

    Discussion

    This function is the same as vDSP_rect, except for the types of vectors A and C.

    Availability

    Available in OS X v10.4 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(_ __A: UnsafePointer<Float>, _ __IA: vDSP_Stride, _ __B: UnsafePointer<Float>, _ __C: UnsafeMutablePointer<Float>, _ __IC: vDSP_Stride, _ __N: vDSP_Length, _ __F: UInt32)

    Objective-C

    void vDSP_vdbcon ( const float *__A, vDSP_Stride __IA, const float *__B, float *__C, vDSP_Stride __IC, vDSP_Length __N, unsigned int __F );

    Parameters

    __A

    Single-precision real input vector

    __IA

    Stride for A

    __B

    Pointer to single-precision real input scalar: zero reference

    __C

    Single-precision real output vector

    __IC

    Stride for C

    __N

    The number of elements to process

    __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_2x.png

    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.

    Availability

    Available in OS X v10.4 and later.

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

    Declaration

    Swift

    func vDSP_vdbconD(_ __A: UnsafePointer<Double>, _ __IA: vDSP_Stride, _ __B: UnsafePointer<Double>, _ __C: UnsafeMutablePointer<Double>, _ __IC: vDSP_Stride, _ __N: vDSP_Length, _ __F: UInt32)

    Objective-C

    void vDSP_vdbconD ( const double *__A, vDSP_Stride __IA, const double *__B, double *__C, vDSP_Stride __IC, vDSP_Length __N, unsigned int __F );

    Discussion

    This function is the same as vDSP_vdbcon, except for the types of vectors A and C and scalar *B.

    Availability

    Available in OS X v10.4 and later.

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

  • Vector truncate to fraction; single precision.

    Declaration

    Swift

    func vDSP_vfrac(_ __A: UnsafePointer<Float>, _ __IA: vDSP_Stride, _ __C: UnsafeMutablePointer<Float>, _ __IC: vDSP_Stride, _ __N: vDSP_Length)

    Objective-C

    void vDSP_vfrac ( const float *__A, vDSP_Stride __IA, float *__C, vDSP_Stride __IC, vDSP_Length __N );

    Parameters

    __A

    Single-precision real input vector

    __IA

    Stride for A

    __C

    Single-precision real output vector

    __IC

    Stride for C

    __N

    The number of elements to process

    Discussion

    Performs the following operation:

    image: ../art/vdsp_111_2x.png

    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.

    Availability

    Available in OS X v10.4 and later.

  • Vector truncate to fraction; double precision.

    Declaration

    Swift

    func vDSP_vfracD(_ __A: UnsafePointer<Double>, _ __IA: vDSP_Stride, _ __C: UnsafeMutablePointer<Double>, _ __IC: vDSP_Stride, _ __N: vDSP_Length)

    Objective-C

    void vDSP_vfracD ( const double *__A, vDSP_Stride __IA, double *__C, vDSP_Stride __IC, vDSP_Length __N );

    Discussion

    This function is the same as vDSP_vfrac, except for the types of vectors A and C.

    Availability

    Available in OS X v10.4 and later.

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

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(_ __A: UnsafePointer<DSPSplitComplex>, _ __IA: vDSP_Stride, _ __C: UnsafeMutablePointer<Float>, _ __IC: vDSP_Stride, _ __N: vDSP_Length)

    Objective-C

    void vDSP_zvphas ( const DSPSplitComplex *__A, vDSP_Stride __IA, float *__C, vDSP_Stride __IC, vDSP_Length __N );

    Parameters

    __A

    Single-precision complex input vector.

    __IA

    Stride for A.

    __C

    Single-precision real output vector.

    __IC

    Stride for C.

    __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:

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

    Availability

    Available in OS X v10.4 and later.

  • Complex vector phase; double precision.

    Declaration

    Swift

    func vDSP_zvphasD(_ __A: UnsafePointer<DSPDoubleSplitComplex>, _ __IA: vDSP_Stride, _ __C: UnsafeMutablePointer<Double>, _ __IC: vDSP_Stride, _ __N: vDSP_Length)

    Objective-C

    void vDSP_zvphasD ( const DSPDoubleSplitComplex *__A, vDSP_Stride __IA, double *__C, vDSP_Stride __IC, vDSP_Length __N );

    Discussion

    This function is the same as vDSP_zvphas, except for the types of vectors A and C.

    Availability

    Available in OS X v10.4 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(_ __A: UnsafePointer<Float>, _ __IA: vDSP_Stride, _ __B: UnsafePointer<Float>, _ __C: UnsafePointer<Float>, _ __D: UnsafeMutablePointer<Float>, _ __ID: vDSP_Stride, _ __N: vDSP_Length)

    Objective-C

    void vDSP_vclip ( const float *__A, vDSP_Stride __IA, const float *__B, const float *__C, float *__D, vDSP_Stride __ID, vDSP_Length __N );

    Parameters

    __A

    Single-precision real input vector

    __IA

    Stride for A

    __B

    Pointer to single-precision real input scalar: low clipping threshold

    __C

    Pointer to single-precision real input scalar: high clipping threshold

    __D

    Single-precision real output vector

    __ID

    Stride for D

    __N

    The number of elements to process

    Discussion

    This performs the following operation:

    1. for (n = 0; n < N; ++n) {
    2. if (A[n*IA] < *B)
    3. D[n*ID] = *B;
    4. else if (A[n*IA] > *C)
    5. D[n*ID] = *C;
    6. else
    7. D[n*ID] = A[n*IA];
    8. }

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

    Availability

    Available in OS X v10.4 and later.

  • Vector clip; double precision.

    Declaration

    Swift

    func vDSP_vclipD(_ __A: UnsafePointer<Double>, _ __IA: vDSP_Stride, _ __B: UnsafePointer<Double>, _ __C: UnsafePointer<Double>, _ __D: UnsafeMutablePointer<Double>, _ __ID: vDSP_Stride, _ __N: vDSP_Length)

    Objective-C

    void vDSP_vclipD ( const double *__A, vDSP_Stride __IA, const double *__B, const double *__C, double *__D, vDSP_Stride __ID, vDSP_Length __N );

    Discussion

    This function is the same as vDSP_vclip, except for the types of vectors A and D and scalars *B and *C.

    Availability

    Available in OS X v10.4 and later.

  • Vector clip and count; single precision.

    Declaration

    Swift

    func vDSP_vclipc(_ __A: UnsafePointer<Float>, _ __IA: vDSP_Stride, _ __B: UnsafePointer<Float>, _ __C: UnsafePointer<Float>, _ __D: UnsafeMutablePointer<Float>, _ __ID: vDSP_Stride, _ __N: vDSP_Length, _ __NLow: UnsafeMutablePointer<vDSP_Length>, _ __NHigh: UnsafeMutablePointer<vDSP_Length>)

    Objective-C

    void vDSP_vclipc ( const float *__A, vDSP_Stride __IA, const float *__B, const float *__C, float *__D, vDSP_Stride __ID, vDSP_Length __N, vDSP_Length *__NLow, vDSP_Length *__NHigh );

    Parameters

    __A

    Single-precision real input vector

    __IA

    Stride for A

    __B

    Pointer to single-precision real input scalar: low clipping threshold

    __C

    Pointer to single-precision real input scalar: high clipping threshold

    __D

    Single-precision real output vector

    __ID

    Stride for D

    __vDSP_N

    Number of elements in A and D

    __NLow

    Pointer to integer: number of elements that were clipped to *B

    __NHigh

    Pointer to integer: number of elements that were clipped to *C

    Discussion

    This performs the following operation:

    1. for (n = 0; n < N; ++n) {
    2. if (A[n*IA] < *B)
    3. D[n*ID] = *B;
    4. else if (A[n*IA] > *C)
    5. D[n*ID] = *C;
    6. else
    7. D[n*ID] = A[n*IA];
    8. }

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

    The count of elements clipped to *B is returned in *NLow, and the count of elements clipped to *C is returned in *NHigh

    Availability

    Available in OS X v10.4 and later.

  • Vector clip and count; double precision.

    Declaration

    Swift

    func vDSP_vclipcD(_ __A: UnsafePointer<Double>, _ __IA: vDSP_Stride, _ __B: UnsafePointer<Double>, _ __C: UnsafePointer<Double>, _ __D: UnsafeMutablePointer<Double>, _ __ID: vDSP_Stride, _ __N: vDSP_Length, _ __NLow: UnsafeMutablePointer<vDSP_Length>, _ __NHigh: UnsafeMutablePointer<vDSP_Length>)

    Objective-C

    void vDSP_vclipcD ( const double *__A, vDSP_Stride __IA, const double *__B, const double *__C, double *__D, vDSP_Stride __ID, vDSP_Length __N, vDSP_Length *__NLow, vDSP_Length *__NHigh );

    Discussion

    This function is the same as vDSP_vclipc, except for the types of vectors A and D and scalars *B and *C.

    Availability

    Available in OS X v10.4 and later.

  • Vector inverted clip; single precision.

    Declaration

    Swift

    func vDSP_viclip(_ __A: UnsafePointer<Float>, _ __IA: vDSP_Stride, _ __B: UnsafePointer<Float>, _ __C: UnsafePointer<Float>, _ __D: UnsafeMutablePointer<Float>, _ __ID: vDSP_Stride, _ __N: vDSP_Length)

    Objective-C

    void vDSP_viclip ( const float *__A, vDSP_Stride __IA, const float *__B, const float *__C, float *__D, vDSP_Stride __ID, vDSP_Length __N );

    Parameters

    __A

    Single-precision real input vector

    __IA

    Stride for A

    __B

    Pointer to single-precision real input scalar: lower threshold

    __C

    Pointer to single-precision real input scalar: upper threshold

    __D

    Single-precision real output vector

    __ID

    Stride for D

    __N

    The number of elements to process

    Discussion

    Performs the following operation:

    1. for (int n = 0; n < N; ++n) {
    2. if (A[nIA] <= *B || A[nIA] >= *C)
    3. D[nID] = A[nIA];
    4. else if (A[nIA] < 0)
    5. D[nID] = *B;
    6. else
    7. D[nID] = *C;
    8. }

    Performs an inverted clip of vector A using lower-threshold and upper-threshold input scalars *B and *C. Note that negative values in A are clipped to *B.

    Availability

    Available in OS X v10.4 and later.

  • Vector inverted clip; double precision.

    Declaration

    Swift

    func vDSP_viclipD(_ __A: UnsafePointer<Double>, _ __IA: vDSP_Stride, _ __B: UnsafePointer<Double>, _ __C: UnsafePointer<Double>, _ __D: UnsafeMutablePointer<Double>, _ __ID: vDSP_Stride, _ __N: vDSP_Length)

    Objective-C

    void vDSP_viclipD ( const double *__A, vDSP_Stride __IA, const double *__B, const double *__C, double *__D, vDSP_Stride __ID, vDSP_Length __N );

    Discussion

    This function is the same as vDSP_viclip, except for the types of vectors A, B, C, and D.

    Availability

    Available in OS X v10.4 and later.

  • Vector test limit; single precision.

    Declaration

    Swift

    func vDSP_vlim(_ __A: UnsafePointer<Float>, _ __IA: vDSP_Stride, _ __B: UnsafePointer<Float>, _ __C: UnsafePointer<Float>, _ __D: UnsafeMutablePointer<Float>, _ __ID: vDSP_Stride, _ __N: vDSP_Length)

    Objective-C

    void vDSP_vlim ( const float *__A, vDSP_Stride __IA, const float *__B, const float *__C, float *__D, vDSP_Stride __ID, vDSP_Length __N );

    Parameters

    __A

    Single-precision real input vector

    __IA

    Stride for A

    __B

    Pointer to single-precision real input scalar: limit

    __C

    Pointer to single-precision real input scalar

    __D

    Single-precision real output vector

    __ID

    Stride for D

    __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:

    1. for (n = 0; n < N; ++n)
    2. if (*B <= A[n*IA])
    3. D[n*ID] = *C;
    4. else
    5. D[n*ID] = -(*C);

    Availability

    Available in OS X v10.4 and later.

  • Vector test limit; double precision.

    Declaration

    Swift

    func vDSP_vlimD(_ __A: UnsafePointer<Double>, _ __IA: vDSP_Stride, _ __B: UnsafePointer<Double>, _ __C: UnsafePointer<Double>, _ __D: UnsafeMutablePointer<Double>, _ __ID: vDSP_Stride, _ __N: vDSP_Length)

    Objective-C

    void vDSP_vlimD ( const double *__A, vDSP_Stride __IA, const double *__B, const double *__C, double *__D, vDSP_Stride __ID, vDSP_Length __N );

    Discussion

    This function is the same as vDSP_vlim, except for the types of vectors A, B, C, and D.

    Availability

    Available in OS X v10.4 and later.

  • Vector threshold; single precision.

    Declaration

    Swift

    func vDSP_vthr(_ __A: UnsafePointer<Float>, _ __IA: vDSP_Stride, _ __B: UnsafePointer<Float>, _ __C: UnsafeMutablePointer<Float>, _ __IC: vDSP_Stride, _ __N: vDSP_Length)

    Objective-C

    void vDSP_vthr ( const float *__A, vDSP_Stride __IA, const float *__B, float *__C, vDSP_Stride __IC, vDSP_Length __N );

    Parameters

    __A

    Single-precision real input vector

    __IA

    Stride for A

    __B

    Pointer to single-precision real input scalar: lower threshold

    __C

    Single-precision real output vector

    __IC

    Stride for C

    __N

    The number of elements to process

    Discussion

    Performs the following operation:

    1. for (n = 0; n < N; ++n){
    2. if (A[n*IA] >= *B)
    3. C[n*IC] = A[n*IA];
    4. else
    5. C[n*IC] = *B;
    6. }

    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.

    Availability

    Available in OS X v10.4 and later.

  • Vector threshold; double precision.

    Declaration

    Swift

    func vDSP_vthrD(_ __A: UnsafePointer<Double>, _ __IA: vDSP_Stride, _ __B: UnsafePointer<Double>, _ __C: UnsafeMutablePointer<Double>, _ __IC: vDSP_Stride, _ __N: vDSP_Length)

    Objective-C

    void vDSP_vthrD ( const double *__A, vDSP_Stride __IA, const double *__B, double *__C, vDSP_Stride __IC, vDSP_Length __N );

    Discussion

    This function is the same as vDSP_vthr, except for the types of vectors A and C, and scalar *B.

    Availability

    Available in OS X v10.4 and later.

  • Vector threshold with zero fill; single precision.

    Declaration

    Swift

    func vDSP_vthres(_ __A: UnsafePointer<Float>, _ __IA: vDSP_Stride, _ __B: UnsafePointer<Float>, _ __C: UnsafeMutablePointer<Float>, _ __IC: vDSP_Stride, _ __N: vDSP_Length)

    Objective-C

    void vDSP_vthres ( const float *__A, vDSP_Stride __IA, const float *__B, float *__C, vDSP_Stride __IC, vDSP_Length __N );

    Parameters

    __A

    Single-precision real input vector

    __IA

    Stride for A

    __B

    Pointer to single-precision real input scalar: lower threshold

    __C

    Single-precision real output vector

    __IC

    Stride for C

    __N

    The number of elements to process

    Discussion

    Performs the following operation:

    1. for (n = 0; n < N; ++n){
    2. if (A[n*IA] >= *B)
    3. C[n*IC] = A[n*IA];
    4. else
    5. C[n*IC] = 0;
    6. }

    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.

    Availability

    Available in OS X v10.4 and later.

  • Vector threshold with zero fill; double precision.

    Declaration

    Swift

    func vDSP_vthresD(_ __A: UnsafePointer<Double>, _ __IA: vDSP_Stride, _ __B: UnsafePointer<Double>, _ __C: UnsafeMutablePointer<Double>, _ __IC: vDSP_Stride, _ __N: vDSP_Length)

    Objective-C

    void vDSP_vthresD ( const double *__A, vDSP_Stride __IA, const double *__B, double *__C, vDSP_Stride __IC, vDSP_Length __N );

    Discussion

    This function is the same as vDSP_vthres, except for the types of vectors A and C and scalar *B.

    Availability

    Available in OS X v10.4 and later.

  • Vector threshold with signed constant; single precision.

    Declaration

    Swift

    func vDSP_vthrsc(_ __A: UnsafePointer<Float>, _ __IA: vDSP_Stride, _ __B: UnsafePointer<Float>, _ __C: UnsafePointer<Float>, _ __D: UnsafeMutablePointer<Float>, _ __ID: vDSP_Stride, _ __N: vDSP_Length)

    Objective-C

    void vDSP_vthrsc ( const float *__A, vDSP_Stride __IA, const float *__B, const float *__C, float *__D, vDSP_Stride __ID, vDSP_Length __N );

    Parameters

    __A

    Single-precision real input vector

    __IA

    Stride for A

    __B

    Pointer to single-precision real input scalar: lower threshold

    __C

    Pointer to single-precision real input scalar: output constant

    __D

    Single-precision real output vector

    __ID

    Stride for D

    __N

    The number of elements to process

    Discussion

    Performs the following operation:

    1. for (n = 0; n < N; ++n){
    2. if (A[n*IA] >= *B)
    3. D[n*Id] = *C;
    4. else
    5. D[n*Id] = -*C;
    6. }

    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.

    Availability

    Available in OS X v10.4 and later.

  • Vector threshold with signed constant; double precision.

    Declaration

    Swift

    func vDSP_vthrscD(_ __A: UnsafePointer<Double>, _ __IA: vDSP_Stride, _ __B: UnsafePointer<Double>, _ __C: UnsafePointer<Double>, _ __D: UnsafeMutablePointer<Double>, _ __ID: vDSP_Stride, _ __N: vDSP_Length)

    Objective-C

    void vDSP_vthrscD ( const double *__A, vDSP_Stride __IA, const double *__B, const double *__C, double *__D, vDSP_Stride __ID, vDSP_Length __N );

    Discussion

    This function is the same as vDSP_vthrsc, except for the types of vectors A and D, and scalars *B and *C.

    Availability

    Available in OS X v10.4 and later.

The functions in this group compress an input vector by eliminating elements that correspond to zero values in a gating vector.

  • Vector compress; single precision.

    Declaration

    Swift

    func vDSP_vcmprs(_ __A: UnsafePointer<Float>, _ __IA: vDSP_Stride, _ __B: UnsafePointer<Float>, _ __IB: vDSP_Stride, _ __C: UnsafeMutablePointer<Float>, _ __IC: vDSP_Stride, _ __N: vDSP_Length)

    Objective-C

    void vDSP_vcmprs ( const float *__A, vDSP_Stride __IA, const float *__B, vDSP_Stride __IB, float *__C, vDSP_Stride __IC, vDSP_Length __N );

    Parameters

    __A

    Single-precision real input vector

    __IA

    Stride for A

    __B

    Single-precision real gating vector

    __IB

    Stride for B

    __C

    Single-precision real output vector

    __IC

    Stride for C

    __N

    The number of elements to process.

    Discussion

    Performs the following operation:

    1. vDSP_Length p = 0;
    2. for (n = 0; n < N; ++n){
    3. if (B[n*IB] != 0)
    4. C[p++ * IC] = A[n*IA];
    5. }

    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.

    Availability

    Available in OS X v10.4 and later.

  • Vector compress; double precision.

    Declaration

    Swift

    func vDSP_vcmprsD(_ __A: UnsafePointer<Double>, _ __IA: vDSP_Stride, _ __B: UnsafePointer<Double>, _ __IB: vDSP_Stride, _ __C: UnsafeMutablePointer<Double>, _ __IC: vDSP_Stride, _ __N: vDSP_Length)

    Objective-C

    void vDSP_vcmprsD ( const double *__A, vDSP_Stride __IA, const double *__B, vDSP_Stride __IB, double *__C, vDSP_Stride __IC, vDSP_Length __N );

    Discussion

    This function is the same as vDSP_vcmprs, except for the types of vectors A, B, and C.

    Availability

    Available in OS X v10.4 and later.

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

  • Vector gather; single precision.

    Declaration

    Swift

    func vDSP_vgathr(_ __A: UnsafePointer<Float>, _ __B: UnsafePointer<vDSP_Length>, _ __IB: vDSP_Stride, _ __C: UnsafeMutablePointer<Float>, _ __IC: vDSP_Stride, _ __N: vDSP_Length)

    Objective-C

    void vDSP_vgathr ( const float *__A, const vDSP_Length *__B, vDSP_Stride __IB, float *__C, vDSP_Stride __IC, vDSP_Length __N );

    Parameters

    __A

    Single-precision real input vector

    __B

    Integer vector containing indices

    __IB

    Stride for B

    __C

    Single-precision real output vector

    __IC

    Stride for C

    __N

    The number of elements to process

    Discussion

    Performs the following operation:

    1. for (n = 0; n < N; ++n){
    2. } C[n*IC] = A[B[n*IB] - 1];

    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 A when evaluating indices (in other words, 1 is subtracted from a 1-based index found in B to obtain the 0-based index into A). This function can only be done out of place.

    Availability

    Available in OS X v10.4 and later.

  • Vector gather; double precision.

    Declaration

    Swift

    func vDSP_vgathrD(_ __A: UnsafePointer<Double>, _ __B: UnsafePointer<vDSP_Length>, _ __IB: vDSP_Stride, _ __C: UnsafeMutablePointer<Double>, _ __IC: vDSP_Stride, _ __N: vDSP_Length)

    Objective-C

    void vDSP_vgathrD ( const double *__A, const vDSP_Length *__B, vDSP_Stride __IB, double *__C, vDSP_Stride __IC, vDSP_Length __N );

    Discussion

    This function is the same as vDSP_vgathr, except for the types of vectors A and C.

    Availability

    Available in OS X v10.4 and later.

  • Vector gather, absolute pointers; single precision.

    Declaration

    Swift

    func vDSP_vgathra(_ __A: UnsafeMutablePointer<UnsafePointer<Float>>, _ __IA: vDSP_Stride, _ __C: UnsafeMutablePointer<Float>, _ __IC: vDSP_Stride, _ __N: vDSP_Length)

    Objective-C

    void vDSP_vgathra ( const float * _Nonnull *__A, vDSP_Stride __IA, float *__C, vDSP_Stride __IC, vDSP_Length __N );

    Parameters

    __A

    Input vector containing pointers to single-precision values in memory.

    __IA

    Address stride for A.

    __C

    Single-precision real output vector.

    __IC

    Address stride for C.

    __N

    The number of elements to process.

    Discussion

    Performs the following operation:

    1. for (n = 0; n < N; ++n){
    2. C[n*IC] = *A[n*IA];
    3. }

    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.

    Availability

    Available in OS X v10.4 and later.

  • Vector gather, absolute pointers; double precision.

    Declaration

    Swift

    func vDSP_vgathraD(_ __A: UnsafeMutablePointer<UnsafePointer<Double>>, _ __IA: vDSP_Stride, _ __C: UnsafeMutablePointer<Double>, _ __IC: vDSP_Stride, _ __N: vDSP_Length)

    Objective-C

    void vDSP_vgathraD ( const double * _Nonnull *__A, vDSP_Stride __IA, double *__C, vDSP_Stride __IC, vDSP_Length __N );

    Discussion

    This function is the same as vDSP_vgathra, except for the types of vectors A and C.

    Availability

    Available in OS X v10.4 and later.

  • Vector index; single precision.

    Declaration

    Swift

    func vDSP_vindex(_ __A: UnsafePointer<Float>, _ __B: UnsafePointer<Float>, _ __IB: vDSP_Stride, _ __C: UnsafeMutablePointer<Float>, _ __IC: vDSP_Stride, _ __N: vDSP_Length)

    Objective-C

    void vDSP_vindex ( const float *__A, const float *__B, vDSP_Stride __IB, float *__C, vDSP_Stride __IC, vDSP_Length __N );

    Parameters

    _A

    Single-precision real input vector.

    _B

    Single-precision real input vector: indices.

    _IB

    Address stride for B.

    _C

    Single-precision real output vector.

    _IC

    Address stride for C.

    _N

    The number of elements to process.

    Discussion

    Performs the following operation:

    image: ../art/vdsp_116_2x.png

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

    Availability

    Available in OS X v10.4 and later.

  • Vector index; double precision.

    Declaration

    Swift

    func vDSP_vindexD(_ __A: UnsafePointer<Double>, _ __B: UnsafePointer<Double>, _ __IB: vDSP_Stride, _ __C: UnsafeMutablePointer<Double>, _ __IC: vDSP_Stride, _ __N: vDSP_Length)

    Objective-C

    void vDSP_vindexD ( const double *__A, const double *__B, vDSP_Stride __IB, double *__C, vDSP_Stride __IC, vDSP_Length __N );

    Discussion

    This function is the same as vDSP_vindex, except for the types of vectors A, B, and C.

    Availability

    Available in OS X v10.4 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(_ __C: UnsafeMutablePointer<Float>, _ __IC: vDSP_Stride, _ __N: vDSP_Length)

    Objective-C

    void vDSP_vrvrs ( float *__C, vDSP_Stride __IC, vDSP_Length __N );

    Parameters

    __C

    Single-precision real input-output vector.

    __IC

    Address stride for C.

    __N

    The number of elements to process.

    Discussion

    Performs the following operation:

    image: ../art/vdsp_133_2x.png

    Reverses the order of vector C in place.

    Availability

    Available in OS X v10.4 and later.

  • Vector reverse order, in place; double precision.

    Declaration

    Swift

    func vDSP_vrvrsD(_ __C: UnsafeMutablePointer<Double>, _ __IC: vDSP_Stride, _ __N: vDSP_Length)

    Objective-C

    void vDSP_vrvrsD ( double *__C, vDSP_Stride __IC, vDSP_Length __N );

    Discussion

    This function is the same as vDSP_vrvrs, except for the type of vector C.

    Availability

    Available in OS X v10.4 and later.

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

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(_ __A: UnsafePointer<Float>, _ __IA: vDSP_Stride, _ __B: vDSP_Length, _ __C: UnsafeMutablePointer<vDSP_Length>, _ __D: UnsafeMutablePointer<vDSP_Length>, _ __N: vDSP_Length)

    Objective-C

    void vDSP_nzcros ( const float *__A, vDSP_Stride __IA, vDSP_Length __B, vDSP_Length *__C, vDSP_Length *__D, vDSP_Length __N );

    Parameters

    __A

    Single-precision real input vector.

    __IA

    Address stride for A.

    __B

    Maximum number of crossings to find.

    __C

    Index of last crossing found.

    __D

    Total number of zero crossings found

    __N

    Number of elements in A.

    Discussion

    This performs the following operation:

    1. *D = *C = 0; for(n = 1; n < N; n++) { if( sign(A[n * IA]) != sign(A[(n - 1) * IA]) ) { *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.

    Availability

    Available in OS X v10.4 and later.

  • Find zero crossings; double precision.

    Declaration

    Swift

    func vDSP_nzcrosD(_ __A: UnsafePointer<Double>, _ __IA: vDSP_Stride, _ __B: vDSP_Length, _ __C: UnsafeMutablePointer<vDSP_Length>, _ __D: UnsafeMutablePointer<vDSP_Length>, _ __N: vDSP_Length)

    Objective-C

    void vDSP_nzcrosD ( const double *__A, vDSP_Stride __IA, vDSP_Length __B, vDSP_Length *__C, vDSP_Length *__D, vDSP_Length __N );

    Discussion

    This function is the same as vDSP_nzcros, except for the type of the input vector.

    Availability

    Available in OS X v10.4 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(_ __A: UnsafePointer<Float>, _ __IA: vDSP_Stride, _ __B: UnsafePointer<Float>, _ __C: UnsafeMutablePointer<Float>, _ __IC: vDSP_Stride, _ __N: vDSP_Length)

    Objective-C

    void vDSP_vavlin ( const float *__A, vDSP_Stride __IA, const float *__B, float *__C, vDSP_Stride __IC, vDSP_Length __N );

    Parameters

    __A

    Single-precision real input vector.

    __IA

    Address stride for A.

    __B

    Pointer to single-precision real input scalar.

    __C

    Single-precision real input-output vector.

    __IC

    Stride for C

    __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_2x.png

    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.

    Availability

    Available in OS X v10.4 and later.

  • Vector linear average; double precision.

    Declaration

    Swift

    func vDSP_vavlinD(_ __A: UnsafePointer<Double>, _ __IA: vDSP_Stride, _ __B: UnsafePointer<Double>, _ __C: UnsafeMutablePointer<Double>, _ __IC: vDSP_Stride, _ __N: vDSP_Length)

    Objective-C

    void vDSP_vavlinD ( const double *__A, vDSP_Stride __IA, const double *__B, double *__C, vDSP_Stride __IC, vDSP_Length __N );

    Discussion

    This function is the same as vDSP_vavlin, except for the types of vectors A, B, and C

    Availability

    Available in OS X v10.4 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(_ __A: UnsafePointer<Float>, _ __B: UnsafePointer<Float>, _ __IB: vDSP_Stride, _ __C: UnsafeMutablePointer<Float>, _ __IC: vDSP_Stride, _ __N: vDSP_Length, _ __M: vDSP_Length)

    Objective-C

    void vDSP_vlint ( const float *__A, const float *__B, vDSP_Stride __IB, float *__C, vDSP_Stride __IC, vDSP_Length __N, vDSP_Length __M );

    Parameters

    __A

    Single-precision real input vector.

    __B

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

    __IB

    Address stride for B.

    __C

    Single-precision real output vector.

    __IC

    Address stride for C.

    __N

    Element count for C.

    __M

    Length of A.

    Discussion

    Performs the following operation:

    1. for (n = 0; n < N; ++n){
    2. float b = B[n*IB];
    3. float index = trunc(b]); //int part of B value
    4. float alpha = b - index; //frac part of B value
    5. float a0 = A[(int)index]; //indexed A value
    6. float a1 = A[(int)index + 1]; //next A value
    7. C[n*IC] = a0 + (alpha * (a1 -a0)); //interpolated value
    8. }

    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.

    Availability

    Available in OS X v10.4 and later.

  • Vector linear interpolation between neighboring elements; double precision.

    Declaration

    Swift

    func vDSP_vlintD(_ __A: UnsafePointer<Double>, _ __B: UnsafePointer<Double>, _ __IB: vDSP_Stride, _ __C: UnsafeMutablePointer<Double>, _ __IC: vDSP_Stride, _ __N: vDSP_Length, _ __M: vDSP_Length)

    Objective-C

    void vDSP_vlintD ( const double *__A, const double *__B, vDSP_Stride __IB, double *__C, vDSP_Stride __IC, vDSP_Length __N, vDSP_Length __M );

    Discussion

    This function is the same as vDSP_vlint, except for the types of vectors A, B, and C.

    Availability

    Available in OS X v10.4 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(_ __A: UnsafePointer<Float>, _ __IA: vDSP_Stride, _ __S: UnsafePointer<Float>, _ __C: UnsafeMutablePointer<Float>, _ __IC: vDSP_Stride, _ __N: vDSP_Length)

    Objective-C

    void vDSP_vrsum ( const float *__A, vDSP_Stride __IA, const float *__S, float *__C, vDSP_Stride __IC, vDSP_Length __N );

    Parameters

    __A

    Single-precision real input vector.

    __IA

    Address stride for A.

    __S

    Points to single-precision real input scalar: weighting factor.

    __C

    Single-precision real output vector.

    __IC

    Stride for C

    __N

    The number of elements to process.

    Discussion

    Performs the following operation:

    image: ../art/vdsp_156_2x.png

    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.

    Availability

    Available in OS X v10.4 and later.

  • Vector running sum integration; double precision.

    Declaration

    Swift

    func vDSP_vrsumD(_ __A: UnsafePointer<Double>, _ __IA: vDSP_Stride, _ __S: UnsafePointer<Double>, _ __C: UnsafeMutablePointer<Double>, _ __IC: vDSP_Stride, _ __N: vDSP_Length)

    Objective-C

    void vDSP_vrsumD ( const double *__A, vDSP_Stride __IA, const double *__S, double *__C, vDSP_Stride __IC, vDSP_Length __N );

    Discussion

    This function is the same as vDSP_vrsum, except for the types of vectors A and C and scalar *S.

    Availability

    Available in OS X v10.4 and later.

  • Simpson integration; single precision.

    Declaration

    Swift

    func vDSP_vsimps(_ __A: UnsafePointer<Float>, _ __IA: vDSP_Stride, _ __B: UnsafePointer<Float>, _ __C: UnsafeMutablePointer<Float>, _ __IC: vDSP_Stride, _ __N: vDSP_Length)

    Objective-C

    void vDSP_vsimps ( const float *__A, vDSP_Stride __IA, const float *__B, float *__C, vDSP_Stride __IC, vDSP_Length __N );

    Parameters

    __A

    Single-precision real input vector.

    __IA

    Address stride for A.

    __B

    Pointer to single-precision real input scalar.

    __C

    Single-precision real output vector.

    __IC

    Stride for C

    __N

    The number of elements to process.

    Discussion

    Performs the following operation:

    image: ../art/vdsp_139_2x.png

    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.

    Availability

    Available in OS X v10.4 and later.

  • Simpson integration; double precision.

    Declaration

    Swift

    func vDSP_vsimpsD(_ __A: UnsafePointer<Double>, _ __IA: vDSP_Stride, _ __B: UnsafePointer<Double>, _ __C: UnsafeMutablePointer<Double>, _ __IC: vDSP_Stride, _ __N: vDSP_Length)

    Objective-C

    void vDSP_vsimpsD ( const double *__A, vDSP_Stride __IA, const double *__B, double *__C, vDSP_Stride __IC, vDSP_Length __N );

    Discussion

    This function is the same as vDSP_vsimps, except for the types of vectors A and C and scalar *S.

    Availability

    Available in OS X v10.4 and later.

  • Vector trapezoidal integration; single precision.

    Declaration

    Swift

    func vDSP_vtrapz(_ __A: UnsafePointer<Float>, _ __IA: vDSP_Stride, _ __B: UnsafePointer<Float>, _ __C: UnsafeMutablePointer<Float>, _ __IC: vDSP_Stride, _ __N: vDSP_Length)

    Objective-C

    void vDSP_vtrapz ( const float *__A, vDSP_Stride __IA, const float *__B, float *__C, vDSP_Stride __IC, vDSP_Length __N );

    Parameters

    __A

    Single-precision real input vector.

    __IA

    Address stride for A.

    __B

    Pointer to single-precision real input scalar: step size.

    __C

    Single-precision real output vector.

    __IC

    Address stride for C.

    __N

    The number of elements to process.

    Discussion

    Performs the following operation:

    image: ../art/vdsp_149_2x.png

    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.

    Availability

    Available in OS X v10.4 and later.

  • Vector trapezoidal integration; double precision.

    Declaration

    Swift

    func vDSP_vtrapzD(_ __A: UnsafePointer<Double>, _ __IA: vDSP_Stride, _ __B: UnsafePointer<Double>, _ __C: UnsafeMutablePointer<Double>, _ __IC: vDSP_Stride, _ __N: vDSP_Length)

    Objective-C

    void vDSP_vtrapzD ( const double *__A, vDSP_Stride __IA, const double *__B, double *__C, vDSP_Stride __IC, vDSP_Length __N );

    Discussion

    This function is the same as vDSP_vtrapz, except for the types of vectors A and C and scalar *B.

    Availability

    Available in OS X v10.4 and later.

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

  • Vector in-place sort; single precision.

    Declaration

    Swift

    func vDSP_vsort(_ __C: UnsafeMutablePointer<Float>, _ __N: vDSP_Length, _ __Order: Int32)

    Objective-C

    void vDSP_vsort ( float *__C, vDSP_Length __N, int __Order );

    Parameters

    __C

    Single-precision real input-output vector

    __N

    The number of elements to process

    __Order

    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 Order.

    Availability

    Available in OS X v10.4 and later.

  • Vector in-place sort; double precision.

    Declaration

    Swift

    func vDSP_vsortD(_ __C: UnsafeMutablePointer<Double>, _ __N: vDSP_Length, _ __Order: Int32)

    Objective-C

    void vDSP_vsortD ( double *__C, vDSP_Length __N, int __Order );

    Discussion

    This function is the same as vDSP_vsort, except for the type of vector C.

    Availability

    Available in OS X v10.4 and later.

  • Vector index in-place sort; single precision.

    Declaration

    Swift

    func vDSP_vsorti(_ __C: UnsafePointer<Float>, _ __I: UnsafeMutablePointer<vDSP_Length>, _ __Temporary: UnsafeMutablePointer<vDSP_Length>, _ __N: vDSP_Length, _ __Order: Int32)

    Objective-C

    void vDSP_vsorti ( const float *__C, vDSP_Length *__I, vDSP_Length *__Temporary, vDSP_Length __N, int __Order );

    Parameters

    __C

    Single-precision real input vector

    __I

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

    __Temporary

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

    __N

    The number of elements to process

    __Order

    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 I according to the values in C. The sort order is specified by parameter Order.

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

    Availability

    Available in OS X v10.4 and later.

  • Vector index in-place sort; double precision.

    Declaration

    Swift

    func vDSP_vsortiD(_ __C: UnsafePointer<Double>, _ __I: UnsafeMutablePointer<vDSP_Length>, _ __Temporary: UnsafeMutablePointer<vDSP_Length>, _ __N: vDSP_Length, _ __Order: Int32)

    Objective-C

    void vDSP_vsortiD ( const double *__C, vDSP_Length *__I, vDSP_Length *__Temporary, vDSP_Length __N, int __Order );

    Discussion

    This function is the same as vDSP_vsorti, except for the type of vector C.

    Availability

    Available in OS X v10.4 and later.

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

The functions in this group find the maximum value in a sliding window within an input vector.

  • Finds the maximum value in a sliding window at each possible position within an input vector; single precision.

    Declaration

    Swift

    func vDSP_vswmax(_ __A: UnsafePointer<Float>, _ __IA: vDSP_Stride, _ __C: UnsafeMutablePointer<Float>, _ __IC: vDSP_Stride, _ __N: vDSP_Length, _ __WindowLength: vDSP_Length)

    Objective-C

    void vDSP_vswmax ( const float *__A, vDSP_Stride __IA, float *__C, vDSP_Stride __IC, vDSP_Length __N, vDSP_Length __WindowLength );

    Parameters

    __A

    Single-precision real input vector.

    __IA

    Stride for input vector.

    __C

    Single-precision real output vector.

    __IC

    Stride for output vector.

    __N

    Number of window positions (see Discussion below).

    __WindowLength

    Length of the window; must be greater than 0.

    Discussion

    The left end of the window is moved through N positions in A, from 0 to N - 1. At each position n, the maximum value in the window is found and written into C[n].

    A must contain N + WindowLength - 1 elements, and C must also contain space for N + WindowLength - 1 elements. A and C may not overlap.

    Although the function only writes N outputs into C, it may use the additional elements for intermediate computation.

    Availability

    Available in OS X v10.10 and later.

  • Finds the maximum value in a sliding window at each possible position within an input vector; double precision.

    Declaration

    Swift

    func vDSP_vswmaxD(_ __A: UnsafePointer<Double>, _ __IA: vDSP_Stride, _ __C: UnsafeMutablePointer<Double>, _ __IC: vDSP_Stride, _ __N: vDSP_Length, _ __WindowLength: vDSP_Length)

    Objective-C

    void vDSP_vswmaxD ( const double *__A, vDSP_Stride __IA, double *__C, vDSP_Stride __IC, vDSP_Length __N, vDSP_Length __WindowLength );

    Discussion

    This is the same as vDSP_vswmax, except for the type of the input and output vectors.

    Availability

    Available in OS X v10.10 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(_ __A: UnsafePointer<Double>, _ __IA: vDSP_Stride, _ __C: UnsafeMutablePointer<Float>, _ __IC: vDSP_Stride, _ __N: vDSP_Length)

    Objective-C

    void vDSP_vdpsp ( const double *__A, vDSP_Stride __IA, float *__C, vDSP_Stride __IC, vDSP_Length __N );

    Parameters

    __A

    Double-precision real input vector.

    __IA

    Address stride for A.

    __C

    Single-precision real output vector.

    __IC

    Address stride for C.

    __N

    The number of elements to process.

    Discussion

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

    Availability

    Available in OS X v10.4 and later.

  • Vector convert single-precision to double-precision.

    Declaration

    Swift

    func vDSP_vspdp(_ __A: UnsafePointer<Float>, _ __IA: vDSP_Stride, _ __C: UnsafeMutablePointer<Double>, _ __IC: vDSP_Stride, _ __N: vDSP_Length)

    Objective-C

    void vDSP_vspdp ( const float *__A, vDSP_Stride __IA, double *__C, vDSP_Stride __IC, vDSP_Length __N );

    Parameters

    __A

    Single-precision real input vector.

    __IA

    Address stride for A.

    __C

    Double-precision real output vector.

    __IC

    Address stride for C.

    __N

    The number of elements to process.

    Discussion

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

    Availability

    Available in OS X v10.4 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(_ __A: UnsafePointer<Float>, _ __IA: vDSP_Stride, _ __C: UnsafeMutablePointer<Int8>, _ __IC: vDSP_Stride, _ __N: vDSP_Length)

    Objective-C

    void vDSP_vfix8 ( const float *__A, vDSP_Stride __IA, char *__C, vDSP_Stride __IC, vDSP_Length __N );

    Parameters

    __A

    Source vector.

    __IA

    Source vector stride length.

    __C

    Destination vector.

    __IC

    Destination vector stride length.

    __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.

    Availability

    Available in OS X v10.4 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(_ __A: UnsafePointer<Double>, _ __IA: vDSP_Stride, _ __C: UnsafeMutablePointer<Int8>, _ __IC: vDSP_Stride, _ __N: vDSP_Length)

    Objective-C

    void vDSP_vfix8D ( const double *__A, vDSP_Stride __IA, char *__C, vDSP_Stride __IC, vDSP_Length __N );

    Discussion

    This function is the same as vDSP_vfix8, except for the type of vector A.

    Availability

    Available in OS X v10.4 and later.

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

    Declaration

    Objective-C

    void vDSP_vfix16 ( const float *vDSP_input1, ptrdiff_t vDSP_stride1, int16_t *vDSP_input2, ptrdiff_t vDSP_stride2, size_t vDSP_size );

    Parameters

    __A

    Source vector.

    __IA

    Source vector stride length.

    __C

    Destination vector.

    __IC

    Destination vector stride length.

    __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

    #include <OSvKernDSPLib.h>;

    Availability

    Available in OS X v10.4 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(_ __A: UnsafePointer<Double>, _ __IA: vDSP_Stride, _ __C: UnsafeMutablePointer<Int16>, _ __IC: vDSP_Stride, _ __N: vDSP_Length)

    Objective-C

    void vDSP_vfix16D ( const double *__A, vDSP_Stride __IA, short *__C, vDSP_Stride __IC, vDSP_Length __N );

    Discussion

    This function is the same as vDSP_vfix16, except for the type of vector A.

    Availability

    Available in OS X v10.4 and later.

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

    Declaration

    Objective-C

    void vDSP_vfix32 ( const float *vDSP_input1, ptrdiff_t vDSP_stride1, int *vDSP_input2, ptrdiff_t vDSP_stride2, size_t vDSP_size );

    Parameters

    __A

    Source vector.

    __IA

    Source vector stride length.

    __C

    Destination vector.

    __IC

    Destination vector stride length.

    __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

    #include <OSvKernDSPLib.h>;

    Availability

    Available in OS X v10.4 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(_ __A: UnsafePointer<Double>, _ __IA: vDSP_Stride, _ __C: UnsafeMutablePointer<Int32>, _ __IC: vDSP_Stride, _ __N: vDSP_Length)

    Objective-C

    void vDSP_vfix32D ( const double *__A, vDSP_Stride __IA, int *__C, vDSP_Stride __IC, vDSP_Length __N );

    Discussion

    This function is the same as vDSP_vfix32, except for the type of vector A.

    Availability

    Available in OS X v10.4 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(_ __A: UnsafePointer<Float>, _ __IA: vDSP_Stride, _ __C: UnsafeMutablePointer<Int8>, _ __IC: vDSP_Stride, _ __N: vDSP_Length)

    Objective-C

    void vDSP_vfixr8 ( const float *__A, vDSP_Stride __IA, char *__C, vDSP_Stride __IC, vDSP_Length __N );

    Parameters

    __A

    Source vector.

    __IA

    Source vector stride length.

    __C

    Destination vector.

    __IC

    Destination vector stride length.

    __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.

    Availability

    Available in OS X v10.4 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(_ __A: UnsafePointer<Double>, _ __IA: vDSP_Stride, _ __C: UnsafeMutablePointer<Int8>, _ __IC: vDSP_Stride, _ __N: vDSP_Length)

    Objective-C

    void vDSP_vfixr8D ( const double *__A, vDSP_Stride __IA, char *__C, vDSP_Stride __IC, vDSP_Length __N );

    Discussion

    This function is the same as vDSP_vfixr8, except for the type of vector A.

    Availability

    Available in OS X v10.4 and later.

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

    Declaration

    Swift

    func vDSP_vfixr16(_ __A: UnsafePointer<Float>, _ __IA: vDSP_Stride, _ __C: UnsafeMutablePointer<Int16>, _ __IC: vDSP_Stride, _ __N: vDSP_Length)

    Objective-C

    void vDSP_vfixr16 ( const float *__A, vDSP_Stride __IA, short *__C, vDSP_Stride __IC, vDSP_Length __N );

    Parameters

    __A

    Source vector.

    __IA

    Source vector stride length.

    __C

    Destination vector.

    __IC

    Destination vector stride length.

    __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.

    Availability

    Available in OS X v10.4 and later.

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

    Declaration

    Swift

    func vDSP_vfixr16D(_ __A: UnsafePointer<Double>, _ __IA: vDSP_Stride, _ __C: UnsafeMutablePointer<Int16>, _ __IC: vDSP_Stride, _ __N: vDSP_Length)

    Objective-C

    void vDSP_vfixr16D ( const double *__A, vDSP_Stride __IA, short *__C, vDSP_Stride __IC, vDSP_Length __N );

    Discussion

    This function is the same as vDSP_vfixr16, except for the type of vector A.

    Availability

    Available in OS X v10.4 and later.

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

    Declaration

    Swift

    func vDSP_vfixr32(_ __A: UnsafePointer<Float>, _ __IA: vDSP_Stride, _ __C: UnsafeMutablePointer<Int32>, _ __IC: vDSP_Stride, _ __N: vDSP_Length)

    Objective-C

    void vDSP_vfixr32 ( const float *__A, vDSP_Stride __IA, int *__C, vDSP_Stride __IC, vDSP_Length __N );

    Parameters

    __A

    Source vector.

    __IA

    Source vector stride length.

    __C

    Destination vector.

    __IC

    Destination vector stride length.

    __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.

    Availability

    Available in OS X v10.4 and later.

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

    Declaration

    Swift

    func vDSP_vfixr32D(_ __A: UnsafePointer<Double>, _ __IA: vDSP_Stride, _ __C: UnsafeMutablePointer<Int32>, _ __IC: vDSP_Stride, _ __N: vDSP_Length)

    Objective-C

    void vDSP_vfixr32D ( const double *__A, vDSP_Stride __IA, int *__C, vDSP_Stride __IC, vDSP_Length __N );

    Discussion

    This function is the same as vDSP_vfixr32, except for the type of vector A.

    Availability

    Available in OS X v10.4 and later.

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

    Declaration

    Swift