SpHr_DFTClosestSize( Size, Option)


Returns the closest DFT-compatible size. Compatible sizes are = f * 2n, where f is 1, 3, 5, or 15 and n is at least 3. See https://developer.apple.com/documentation/accelerate/1450061-vdsp_dft_zop_createsetup?language=objc


Size  number of DFT points.


Option  < 0  Returns 1 if desiredSize is incompatible with DFT and 0 if compatible.

Option  = 0  Returns next larger DFT-compatible size.

Option  = 1  Returns next smaller DFT-compatible size.

Option  = 2  Returns closest DFT-compatible size.


Example

Function SpHr_DFTClosestSize_Example()

    variable size = 32526

    variable closestSize = SpHr_DFTClosestSize( Size, 2)

    Printf "Closest compatible size to %g is %g\r", size, closestSize

End

Contact: Brian