<!--
{
  "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_hamm_windowD",
  "metadataVersion" : "0.1.0",
  "role" : "Function",
  "symbol" : {
    "kind" : "Function",
    "modules" : [
      "Accelerate"
    ],
    "preciseIdentifier" : "c:@F@vDSP_hamm_windowD"
  },
  "title" : "vDSP_hamm_windowD"
}
-->

# vDSP_hamm_windowD

Creates a double-precision Hamming window.

```
extern void vDSP_hamm_windowD(double *__C, vDSP_Length __N, int __Flag);
```

## Parameters

`__C`

The output vector.

`__N`

The number of elements in the output vector.

`__Flag`

A value that specifies whether the function creates a half window or a full window. Pass the <doc://com.apple.documentation/documentation/kernel/1645052-anonymous/vdsp_half_window> flag to create only the first `(N+1)/2` points; pass `0` to create a full-size window.

## Discussion

The [`vDSP_hamm_window`](/documentation/Accelerate/vDSP_hamm_window) and [`vDSP_hamm_windowD`](/documentation/Accelerate/vDSP_hamm_windowD) functions create a Hamming window vector using the following operation:

```objc
for (n=0; n < N; ++n)
{
    C[n] = 0.54 - (0.46 * cos( 2 * pi * n / N ) );
}
```

The following code shows how to generate a Hamming window:

```swift
let n = vDSP_Length(1024)

var c = [Float](repeating: 0,
                count: Int(n))

vDSP_hamm_window(&c,
                 n,
                 0)
```

The following illustrates the values of the output vector, `c`:

![Visualization of a Hamming window.](images/com.apple.accelerate/media-3233507@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)