<!--
{
  "availability" : [
    "iOS: 15.0.0 -",
    "iPadOS: 15.0.0 -",
    "macCatalyst: -",
    "macOS: 12.0.0 -",
    "tvOS: 15.0.0 -",
    "visionOS: -",
    "watchOS: 8.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Accelerate",
  "identifier" : "/documentation/Accelerate/vDSP/DiscreteFourierTransform/init(previous:count:direction:transformType:ofType:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "Accelerate"
    ],
    "preciseIdentifier" : "s:10Accelerate4vDSPO24DiscreteFourierTransformC8previous5count9direction13transformType02ofJ0AEy_xGAEy_SfGSg_SiAC0dE9DirectionOAC012DFTTransformJ0OxmtKcfc"
  },
  "title" : "init(previous:count:direction:transformType:ofType:)"
}
-->

# init(previous:count:direction:transformType:ofType:)

Returns a new discrete Fourier transform instance.

```
init(previous: vDSP.DiscreteFourierTransform<Float>? = nil, count: Int, direction: vDSP.FourierTransformDirection, transformType: vDSP.DFTTransformType, ofType: T.Type) throws
```

## Parameters

`previous`

An existing [`vDSP.DiscreteFourierTransform`](/documentation/Accelerate/vDSP/DiscreteFourierTransform) structure that shares memory with the discrete Fourier transform instance that this function returns. Pass `nil` to create an object with newly initialized and allocated memory.

`count`

The number of complex elements.

`direction`

A flag that specifies the transform direction.

`transformType`

A flag that specifies whether the forward transform is real-to-complex or complex-to-complex.

`ofType`

The data type for the discrete Fourier transform operation. For split-complex operations, this needs to be be either <doc://com.apple.documentation/documentation/Swift/Float> or <doc://com.apple.documentation/documentation/Swift/Double>. For interleaved operations, this needs to be either [`DSPComplex`](/documentation/Accelerate/DSPComplex) or [`DSPDoubleComplex`](/documentation/Accelerate/DSPDoubleComplex).

## Discussion

The interleaved DFT operations that the Accelerate framework provides work over collections with specific counts. The maximum number of complex elements that these operations support is 4096, and other supported counts are the result of the formula `f * 2ⁿ` for certain values of `f` and `n`. In the case of real-to-complex, `n` is the number of real elements divided by two, and for complex-to-complex `n` is the number of complex elements.

The following tables show the complete list of supported lengths for different values of `f` and `n`:

### Supported lengths for f = 1

|n |`2ⁿ`|`length` (`f * 2ⁿ`)|
|--|----|-------------------|
|3 |8   |**8**              |
|4 |16  |**16**             |
|5 |32  |**32**             |
|6 |64  |**64**             |
|7 |128 |**128**            |
|8 |256 |**256**            |
|9 |512 |**512**            |
|10|1024|**1024**           |
|11|2048|**2048**           |
|12|4096|**4096**           |

### Supported lengths for f = 3

|n|`2ⁿ`|`length` (`f * 2ⁿ`)|
|-|----|-------------------|
|2|4   |**12**             |
|3|8   |**24**             |
|4|16  |**48**             |
|5|32  |**96**             |
|6|64  |**192**            |
|7|128 |**384**            |
|8|256 |**768**            |

### Supported lengths for f = 5

|n|`2ⁿ`|`length` (`f * 2ⁿ`)|
|-|----|-------------------|
|2|4   |**20**             |
|3|8   |**40**             |
|4|16  |**80**             |
|5|32  |**160**            |
|6|64  |**320**            |
|7|128 |**640**            |

### Supported lengths for f = 9

|n|`2ⁿ`|`length` (`f * 2ⁿ`)|
|-|----|-------------------|
|2|4   |**36**             |
|3|8   |**72**             |
|4|16  |**144**            |
|5|32  |**288**            |
|6|64  |**576**            |
|7|128 |**1152**           |

### Supported lengths for f = 15

|n|`2ⁿ`|`length` (`f * 2ⁿ`)|
|-|----|-------------------|
|2|4   |**60**             |
|3|8   |**120**            |
|4|16  |**240**            |
|5|32  |**480**            |
|6|64  |**960**            |
|7|128 |**1920**           |

---

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)