<!--
{
  "availability" : [
    "iOS: 13.0.0 -",
    "iPadOS: 13.0.0 -",
    "macCatalyst: -",
    "macOS: 10.15.0 -",
    "tvOS: 13.0.0 -",
    "visionOS: -",
    "watchOS: 6.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Accelerate",
  "identifier" : "/documentation/Accelerate/vDSP/window(ofType:usingSequence:count:isHalfWindow:)",
  "metadataVersion" : "0.1.0",
  "role" : "Type Method",
  "symbol" : {
    "kind" : "Type Method",
    "modules" : [
      "Accelerate"
    ],
    "preciseIdentifier" : "s:10Accelerate4vDSPO6window6ofType13usingSequence5count12isHalfWindowSayxGxm_AC0kG0OSiSbtAA01vB25_FloatingPointGeneratableRzlFZ"
  },
  "title" : "window(ofType:usingSequence:count:isHalfWindow:)"
}
-->

# window(ofType:usingSequence:count:isHalfWindow:)

Returns an array that contains the specified window.

```
static func window<T>(ofType: T.Type, usingSequence sequence: vDSP.WindowSequence, count: Int, isHalfWindow: Bool) -> [T] where T : vDSP_FloatingPointGeneratable
```

## Parameters

`ofType`

The precision of the generated window.

`sequence`

The window sequence to use for generation.

`count`

The number of elements to generate.

`isHalfWindow`

A Boolean value that specifies whether the function generates half of the number of elements.

## Discussion

Use this function to generate and return a vector populated with values of a specified window sequence.

The following code shows how to generate a single-precision Blackman window:

```swift
let c = vDSP.window(ofType: Float.self,
                    usingSequence: .blackman,
                    count: 1024,
                    isHalfWindow: false)
```

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

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