---
title: "window(ofType:usingSequence:count:isHalfWindow:)"
framework: accelerate
role: symbol
role_heading: Type Method
path: "accelerate/vdsp/window(oftype:usingsequence:count:ishalfwindow:)"
---

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

Returns an array that contains the specified window.

## Declaration

```swift
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.

## Mentioned in

Reducing spectral leakage with windowing

## Discussion

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: let c = vDSP.window(ofType: Float.self,                     usingSequence: .blackman,                     count: 1024,                     isHalfWindow: false) The following figure illustrates the values of the output vector, c:

## 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)
