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.

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.

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

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.

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.

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

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.

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

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.

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.

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.

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

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.

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