I am implementing the FFT using vDSP.DiscreteFourierTransform. According to the official documentation, the count parameter has requirements as outlined below:
/// The `count` parameter must be:
/// * For split-complex real-to-complex: `2ⁿ` or `f * 2ⁿ`, where `f` is `3`, `5`, or `15` and `n >= 4`.
/// * For split-complex complex-to-complex: `2ⁿ` or `f * 2ⁿ`, where `f` is `3`, `5`, or `15` and `n >= 3`.
/// * For interleaved: `f * 2ⁿ`, where `f` is `2`, `3`, `5`, `3x3`, `3x5`, or `5x5`, and `n>=2`.
Despite adhering to these specifications in theory, my attempt to initialize an interleaved DFT with count = 2 * 2 * 5 * 5 (equivalent to 5×5 × 2²) resulted in a failure. Below is the code snippet I used for the initialization:
do {
let dft = try vDSP.DiscreteFourierTransform(
previous: nil,
count: 2 * 2 * 5 * 5,
direction: .forward,
transformType: .complexReal,
ofType: DSPComplex.self
)
print(dft)
} catch {
print("DFT init failed:", error)
}
Could somebody more knowledgeable with these APIs have a look? Thanks!