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

# vDSP_vtmergD

Performs a tapered merge between two double-precision vectors.

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

## Parameters

`__A`

The first input vector.

`__IA`

The distance between the elements in the first input vector.``

`__B`

The second input vector.

`__IB`

The distance between the elements in the second input vector.

`__C`

The output vector.

`__IC`

The distance between the elements in the output vector.

`__N`

The number of complex elements in the output vector.

## Discussion

The following code performs a tapered merge between two vectors that represent sine waves at different frequencies:

```swift
    let count = 1024
    
    let vectorA: [Double] = (0 ..< count).map {
        return sin(Double($0) * 0.4)
    }
    
    let vectorB: [Double] = (0 ..< count).map {
        return sin(Double($0) * 0.025)
    }
    
    let stride = 1
    let n = vDSP_Length(count)
    
    let tapered = [Double](unsafeUninitializedCapacity: count) {
        buffer, initializedCount in
        
        vDSP_vtmergD(vectorA, stride,
                     vectorB, stride,
                     buffer.baseAddress!, stride,
                     n)
        
        initializedCount = count
    }
```

The following image shows the result of the tapered merge in `tapered`.

![Graphic showing the tapered merge from a high-frequency sine wave to a low-frequency sine wave.](images/com.apple.accelerate/media-4329457@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)