<!--
{
  "documentType" : "article",
  "framework" : "Accelerate",
  "identifier" : "/documentation/Accelerate/vector-generation",
  "metadataVersion" : "0.1.0",
  "role" : "collectionGroup",
  "title" : "Vector generation"
}
-->

# Vector generation

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

## Topics

### Vector generation with ramps using an initial value and increment

[`ramp(withInitialValue:increment:count:)`](/documentation/Accelerate/vDSP/ramp(withInitialValue:increment:count:)-mjsa)

Returns a single-precision vector that contains monotonically incrementing or decrementing values using an initial value and increment.

[`ramp(withInitialValue:increment:count:)`](/documentation/Accelerate/vDSP/ramp(withInitialValue:increment:count:)-3cast)

Returns a double-precision vector that contains monotonically incrementing or decrementing values using an initial value and increment.

[`formRamp(withInitialValue:increment:result:)`](/documentation/Accelerate/vDSP/formRamp(withInitialValue:increment:result:)-40zxg)

Populates a single-precision vector with monotonically incrementing or decrementing values using an initial value and increment.

[`formRamp(withInitialValue:increment:result:)`](/documentation/Accelerate/vDSP/formRamp(withInitialValue:increment:result:)-4ibjw)

Populates a double-precision vector with monotonically incrementing or decrementing values using an initial value and increment.

[`vDSP_vramp`](/documentation/Accelerate/vDSP_vramp)

Generates a single-precision vector with monotonically incrementing or decrementing values using an initial value and increment.

[`vDSP_vrampD`](/documentation/Accelerate/vDSP_vrampD)

Generates a double-precision vector with monotonically incrementing or decrementing values using an initial value and increment.

### Vector generation with ramps using a range

[`ramp(in:count:)`](/documentation/Accelerate/vDSP/ramp(in:count:)-79aw7)

Returns a double-precision vector that contains monotonically incrementing or decrementing values within a range.

[`ramp(in:count:)`](/documentation/Accelerate/vDSP/ramp(in:count:)-744b4)

Returns a single-precision vector that contains monotonically incrementing or decrementing values within a range.

[`formRamp(in:result:)`](/documentation/Accelerate/vDSP/formRamp(in:result:)-8lsid)

Populates a double-precision vector with monotonically incrementing or decrementing values within a range.

[`formRamp(in:result:)`](/documentation/Accelerate/vDSP/formRamp(in:result:)-6ef26)

Populates a single-precision vector with monotonically incrementing or decrementing values within a range.

[`vDSP_vgen`](/documentation/Accelerate/vDSP_vgen)

Generates a single-precision vector that contains monotonically incrementing or decrementing values within a range.

[`vDSP_vgenD`](/documentation/Accelerate/vDSP_vgenD)

Generates a double-precision vector that contains monotonically incrementing or decrementing values within a range.

### Vector generation with ramps and multiplication by a second vector

[`ramp(withInitialValue:multiplyingBy:increment:)`](/documentation/Accelerate/vDSP/ramp(withInitialValue:multiplyingBy:increment:)-6b5re)

Returns a single-precision vector that contains monotonically incrementing or decrementing values, and multiplies that vector by a source vector.

[`ramp(withInitialValue:multiplyingBy:increment:)`](/documentation/Accelerate/vDSP/ramp(withInitialValue:multiplyingBy:increment:)-1s3c9)

Returns a double-precision vector that contains monotonically incrementing or decrementing values, and multiplies that vector by a source vector.

[`formRamp(withInitialValue:multiplyingBy:increment:result:)`](/documentation/Accelerate/vDSP/formRamp(withInitialValue:multiplyingBy:increment:result:)-4r0kz)

Populates a single-precision vector that contains monotonically incrementing or decrementing values, and multiplies that vector by a source vector.

[`formRamp(withInitialValue:multiplyingBy:increment:result:)`](/documentation/Accelerate/vDSP/formRamp(withInitialValue:multiplyingBy:increment:result:)-p7s4)

Populates a double-precision vector that contains monotonically incrementing or decrementing values, and multiplies that vector by a source vector.

[`vDSP_vrampmul`](/documentation/Accelerate/vDSP_vrampmul)

Generates a single-precision vector that contains monotonically incrementing or decrementing values, and multiplies that vector by a source vector.

[`vDSP_vrampmulD`](/documentation/Accelerate/vDSP_vrampmulD)

Generates a double-precision vector that contains monotonically incrementing or decrementing values, and multiplies that vector by a source vector.

[`vDSP_vrampmul_s1_15`](/documentation/Accelerate/vDSP_vrampmul_s1_15)

Generates a fixed-point 1.15 format vector that contains monotonically incrementing or decrementing values, and multiplies that vector by a source vector.

[`vDSP_vrampmul_s8_24`](/documentation/Accelerate/vDSP_vrampmul_s8_24)

Generates a fixed-point 8.24 format vector that contains monotonically incrementing or decrementing values, and multiplies that vector by a source vector.

### Vector addition with ramps and multiplication by a second vector

[`vDSP_vrampmuladd`](/documentation/Accelerate/vDSP_vrampmuladd)

Adds a single-precision vector that contains monotonically incrementing or decrementing values, and multiplies that vector by a source vector.

[`vDSP_vrampmuladdD`](/documentation/Accelerate/vDSP_vrampmuladdD)

Adds a double-precision vector that contains monotonically incrementing or decrementing values, and multiplies that vector by a source vector.

[`vDSP_vrampmuladd_s1_15`](/documentation/Accelerate/vDSP_vrampmuladd_s1_15)

Adds a fixed-point 1.15 format vector that contains monotonically incrementing or decrementing values, and multiplies that vector by a source vector.

[`vDSP_vrampmuladd_s8_24`](/documentation/Accelerate/vDSP_vrampmuladd_s8_24)

Adds a fixed-point 8.24 format vector that contains monotonically incrementing or decrementing values, and multiplies that vector by a source vector.

### Vector generation by extrapolation and interpolation

[`linearInterpolate(values:atIndices:)`](/documentation/Accelerate/vDSP/linearInterpolate(values:atIndices:)-5mbnu)

Returns the single-precision linearly interpolated values of a vector at the specified indices.

[`linearInterpolate(values:atIndices:)`](/documentation/Accelerate/vDSP/linearInterpolate(values:atIndices:)-9rxb4)

Returns the double-precision linearly interpolated values of a vector at the specified indices.

[`linearInterpolate(values:atIndices:result:)`](/documentation/Accelerate/vDSP/linearInterpolate(values:atIndices:result:)-7nre0)

Computes the double-precision linearly interpolated values of a vector at the specified indices.

[`linearInterpolate(values:atIndices:result:)`](/documentation/Accelerate/vDSP/linearInterpolate(values:atIndices:result:)-6i7sl)

Computes the single-precision linearly interpolated values of a vector at the specified indices.

[`vDSP_vgenp`](/documentation/Accelerate/vDSP_vgenp)

Generates the single-precision linearly interpolated values of a vector at the specified indices.

[`vDSP_vgenpD`](/documentation/Accelerate/vDSP_vgenpD)

Generates the double-precision linearly interpolated values of a vector at the specified indices.

### Vector generation with lookup tables

[`linearInterpolate(lookupTable:withOffsets:scale:baseOffset:)`](/documentation/Accelerate/vDSP/linearInterpolate(lookupTable:withOffsets:scale:baseOffset:)-1ye2o)

Returns the double-precision linearly interpolated values of a lookup table from the specified offsets.

[`linearInterpolate(lookupTable:withOffsets:scale:baseOffset:)`](/documentation/Accelerate/vDSP/linearInterpolate(lookupTable:withOffsets:scale:baseOffset:)-3nw6t)

Returns the single-precision linearly interpolated values of a lookup table from the specified offsets.

[`linearInterpolate(lookupTable:withOffsets:scale:baseOffset:result:)`](/documentation/Accelerate/vDSP/linearInterpolate(lookupTable:withOffsets:scale:baseOffset:result:)-9l3uy)

Computes the double-precision linearly interpolated values of a lookup table from the specified offsets.

[`linearInterpolate(lookupTable:withOffsets:scale:baseOffset:result:)`](/documentation/Accelerate/vDSP/linearInterpolate(lookupTable:withOffsets:scale:baseOffset:result:)-4ownc)

Computes the single-precision linearly interpolated values of a lookup table from the specified offsets.

[`vDSP_vtabi`](/documentation/Accelerate/vDSP_vtabi)

Generates a single-precision vector by interpolating values from a lookup table.

[`vDSP_vtabiD`](/documentation/Accelerate/vDSP_vtabiD)

Generates a double-precision vector by interpolating values from a lookup table.

### Vector generation with window functions

  <doc://com.apple.accelerate/documentation/Accelerate/reducing-spectral-leakage-with-windowing>

[`window(ofType:usingSequence:count:isHalfWindow:)`](/documentation/Accelerate/vDSP/window(ofType:usingSequence:count:isHalfWindow:))

Returns an array that contains the specified window.

[`formWindow(usingSequence:result:isHalfWindow:)`](/documentation/Accelerate/vDSP/formWindow(usingSequence:result:isHalfWindow:)-6cmve)

Populates a double-precision vector with a specified window.

[`formWindow(usingSequence:result:isHalfWindow:)`](/documentation/Accelerate/vDSP/formWindow(usingSequence:result:isHalfWindow:)-9dls5)

Populates a single-precision vector with a specified window.

[`vDSP.WindowSequence`](/documentation/Accelerate/vDSP/WindowSequence)

Constants that specify window sequence functions.

[`vDSP_blkman_window`](/documentation/Accelerate/vDSP_blkman_window)

Creates a single-precision Blackman window.

[`vDSP_blkman_windowD`](/documentation/Accelerate/vDSP_blkman_windowD)

Creates a double-precision Blackman window.

[`vDSP_hamm_window`](/documentation/Accelerate/vDSP_hamm_window)

Creates a single-precision Hamming window.

[`vDSP_hamm_windowD`](/documentation/Accelerate/vDSP_hamm_windowD)

Creates a double-precision Hamming window.

[`vDSP_hann_window`](/documentation/Accelerate/vDSP_hann_window)

Creates a single-precision Hann window.

[`vDSP_hann_windowD`](/documentation/Accelerate/vDSP_hann_windowD)

Creates a double-precision Hann window.

[`vDSP_HALF_WINDOW`](/documentation/Accelerate/vDSP_HALF_WINDOW)

Specifies that the window should only contain the bottom half of the values (`0` to `(N+1)/2`).

[`vDSP_HANN_DENORM`](/documentation/Accelerate/vDSP_HANN_DENORM)

Specifies a denormalized Hann window.

[`vDSP_HANN_NORM`](/documentation/Accelerate/vDSP_HANN_NORM)

Specifies a normalized Hann window

### Stereo ramp generation

[`stereoRamp(withInitialValue:multiplyingBy:_:increment:)`](/documentation/Accelerate/vDSP/stereoRamp(withInitialValue:multiplyingBy:_:increment:)-5utuo)

Returns two double-precision vectors that contain stereo monotonically incrementing or decrementing values multiplied by two source vectors.

[`stereoRamp(withInitialValue:multiplyingBy:_:increment:)`](/documentation/Accelerate/vDSP/stereoRamp(withInitialValue:multiplyingBy:_:increment:)-18f8z)

Returns two single-precision vectors that contain stereo monotonically incrementing or decrementing values multiplied by two source vectors.

[`formStereoRamp(withInitialValue:multiplyingBy:_:increment:results:_:)`](/documentation/Accelerate/vDSP/formStereoRamp(withInitialValue:multiplyingBy:_:increment:results:_:)-99lyb)

Populates two single-precision vectors that contain stereo monotonically incrementing or decrementing values multiplied by two source vectors.

[`formStereoRamp(withInitialValue:multiplyingBy:_:increment:results:_:)`](/documentation/Accelerate/vDSP/formStereoRamp(withInitialValue:multiplyingBy:_:increment:results:_:)-9be28)

Populates two single-precision vectors that contain stereo monotonically incrementing or decrementing values multiplied by two source vectors.

[`vDSP_vrampmul2`](/documentation/Accelerate/vDSP_vrampmul2)

Generates a single-precision, stereo ramped vector and multiplies that vector by an input vector.

[`vDSP_vrampmul2D`](/documentation/Accelerate/vDSP_vrampmul2D)

Generates a double-precision, stereo ramped vector and multiplies that vector by an input vector.

[`vDSP_vrampmul2_s1_15`](/documentation/Accelerate/vDSP_vrampmul2_s1_15)

Generates a fixed-point, 1.15 format, stereo ramped vector and multiplies that vector by an input vector.

[`vDSP_vrampmul2_s8_24`](/documentation/Accelerate/vDSP_vrampmul2_s8_24)

Generates a fixed-point, 8.24 format, stereo ramped vector and multiplies that vector by an input vector.

[`vDSP_vrampmuladd2`](/documentation/Accelerate/vDSP_vrampmuladd2)

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

[`vDSP_vrampmuladd2D`](/documentation/Accelerate/vDSP_vrampmuladd2D)

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

[`vDSP_vrampmuladd2_s1_15`](/documentation/Accelerate/vDSP_vrampmuladd2_s1_15)

Multiplies a fixed-point, 1.15 format, stereo input vector by a value that ramps on successive calls, and adds the result to the output vector.

[`vDSP_vrampmuladd2_s8_24`](/documentation/Accelerate/vDSP_vrampmuladd2_s8_24)

Multiplies a fixed-point, 8.24 format, stereo input vector by a value that ramps on successive calls, and adds the result to the output vector.



---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)