---
title: "stereoRamp(withInitialValue:multiplyingBy:_:increment:)"
framework: accelerate
role: symbol
role_heading: Type Method
path: "accelerate/vdsp/stereoramp(withinitialvalue:multiplyingby:_:increment:)-18f8z"
---

# stereoRamp(withInitialValue:multiplyingBy:_:increment:)

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

## Declaration

```swift
static func stereoRamp<U>(withInitialValue initialValue: inout Float, multiplyingBy multiplierOne: U, _ multiplierTwo: U, increment: Float) -> (firstOutput: [Float], secondOutput: [Float]) where U : AccelerateBuffer, U.Element == Float
```

## Parameters

- `initialValue`: The initial value of the ramp.
- `multiplierOne`: The first input vector that’s multiplied by the ramp function.
- `multiplierTwo`: The second input vector that’s multiplied by the ramp function.
- `increment`: The increment, or decrement if negative, between each generated element.

## Discussion

Discussion Use this function to create two vectors by multiplying the values in two input vectors with the corresponding values of a ramp. For example, the following code fills the arrays multiplierOne and multiplierTwo with sine values: let n = vDSP_Length(1024)

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

let multiplierTwo: [Float] = (0 ..< n).map {     return sin(Float($0) / 40) } The following figure illustrates the values of multiplierOne, as a solid line, and multiplierTwo, as a dashed line:

Pass multiplierOne and multiplierTwo as the multiplyingBy parameter of stereoRamp(withInitialValue:multiplyingBy:_:increment:): var start: Float = 0 let step: Float = 0.1

let results = vDSP.stereoRamp(withInitialValue: &start,                               multiplyingBy: multiplierOne, multiplierTwo,                               increment: step) On return, the output vectors, results.firstOutput and results.secondOutput, contain ramped-sine waves. The figure below shows the first output as a solid line and the second output as a dashed line:

## See Also

### Type Methods

- [absolute(_:)](accelerate/vdsp/absolute(_:)-9c3ge.md)
- [absolute(_:)](accelerate/vdsp/absolute(_:)-5ehc1.md)
- [absolute(_:result:)](accelerate/vdsp/absolute(_:result:)-9x5jn.md)
- [absolute(_:result:)](accelerate/vdsp/absolute(_:result:)-1wu9x.md)
- [absolute(_:result:)](accelerate/vdsp/absolute(_:result:)-657bd.md)
- [absolute(_:result:)](accelerate/vdsp/absolute(_:result:)-4pigo.md)
- [add(_:_:)](accelerate/vdsp/add(_:_:)-9mv1a.md)
- [add(_:_:)](accelerate/vdsp/add(_:_:)-2ftxc.md)
- [add(_:_:)](accelerate/vdsp/add(_:_:)-53nh9.md)
- [add(_:_:)](accelerate/vdsp/add(_:_:)-7swvf.md)
- [add(_:_:result:)](accelerate/vdsp/add(_:_:result:)-2531u.md)
- [add(_:_:result:)](accelerate/vdsp/add(_:_:result:)-2w0o9.md)
- [add(_:_:result:)](accelerate/vdsp/add(_:_:result:)-338hl.md)
- [add(_:_:result:)](accelerate/vdsp/add(_:_:result:)-3vzwi.md)
- [add(_:to:count:result:)](accelerate/vdsp/add(_:to:count:result:)-g1dk.md)
