<!--
{
  "availability" : [
    "iOS: 8.0.0 -",
    "iPadOS: 8.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.10.0 -",
    "tvOS: -",
    "visionOS: 1.0.0 -",
    "watchOS: 2.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Accelerate",
  "identifier" : "/documentation/Accelerate/vDSP_vrampmul2D",
  "metadataVersion" : "0.1.0",
  "role" : "Function",
  "symbol" : {
    "kind" : "Function",
    "modules" : [
      "Accelerate"
    ],
    "preciseIdentifier" : "c:@F@vDSP_vrampmul2D"
  },
  "title" : "vDSP_vrampmul2D"
}
-->

# vDSP_vrampmul2D

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

```
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);
```

## Parameters

`__I0`

The first double-precision input vector.

`__I1`

The second double-precision input vector.

`__IS`

The stride for both input vectors.

`__Start`

On input, the initial value of the ramp. On output, the next value in the ramp.

`__Step`

The increment, or decrement if negative, between each generated element.

`__O0`

The first double-precision output vector.

`__O1`

The second double-precision output vector.

`__OS`

The stride for both output vectors.

`__N`

The number of elements that the function processes.

## Discussion

The functions in this group function populate a vector, by multiplying the values in an input vector with the corresponding values of a ramp generated by the `Start` and `Step` parameters. The following code describes the calculation:

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

For example, the following code fills the array `i` with sine values:

```swift
let n = vDSP_Length(1024)

let i: [Float] = (0 ..< n).map {
    return sin(Float($0) / 20)
}
```

The following illustrates the values of `i`:

![Visualization of a sine wave.](images/com.apple.accelerate/media-3239936@2x.png)

Use `i` as the input vector to [`vDSP_vrampmul`](/documentation/Accelerate/vDSP_vrampmul):

```swift
let stride = vDSP_Stride(1)

var start: Float = 0
var step: Float = 0.1
var o = [Float](repeating: 0,
                count: Int(n))

vDSP_vrampmul(i,
              stride,
              &start,
              &step,
              &o,
              stride,
              n)
```

On return, the output vector, `o`, is filled with a ramped-sine wave:

![Visualization of the generated vector.](images/com.apple.accelerate/media-3239774@2x.png)

---

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)