Accelerate Framework - UBogun/Xojo-iosLib GitHub Wiki
Accelerate is Apple’s framework with highly optimized math routines for vector, DSP and FFT calculations. Currently only a few methods are implemented. Tell me if you need more!
##Methods vDSP_create_fftsetup (Log2n As UInt32, Radix As Int32) as Ptr: Creates a single precision FFT data structure. Currently this structure is not built into a Xojo class, use it only by its pointer.
vDSP_destroy_fftsetup (FFT_Setup As Ptr): Used to release a single presision FFT data structure.
vDSP_ctoz (C As Ptr, IC As Int32, Z As Ptr, IZ As Int32, N As UInt32): Copies the contents of an interleaved complex vector C to a split complex vector Z; single precision. C must be of type Complex and Z of type SplitComplex.
vDSP_fft_zrip (Setup As Ptr, C As Ptr, IC As Int32, Log2N As Int32, Direction As Integer): Computes an in-place single-precision real discrete Fourier transform, either from the time domain to the frequency domain (forward) or from the frequency domain to the time domain (inverse). Setup must be of type FFT_Setup and C a Complex.
vDSP_vsq (vDSP_input as Ptr, vDSP_strideInput as Int32, vDSP_Result as Ptr, vDSP_StrideResult As Int32, vDSP_Size as Uint32): Computes the squared values of vector vDSP_input and leaves the result in vector vDSP_result; single precision. See Vector_Square for a use example.
vDSP_vsqD (vDSP_input as Ptr, vDSP_strideInput as Int32, vDSP_Result as Ptr, vDSP_StrideResult As Int32, vDSP_Size as Uint32): Computes the squared values of vector vDSP_input and leaves the result in vector vDSP_result; double precision. See Vector_Square for a use example.
Vector_Square (aPoint As NSPoint) As NSPoint: Builds the vector square of a NSPoint using vDSP_vsqD. Please note this is just an example and I would rather recommend to use the NSPoint Vector_Square extension method which is faster. Conversions between NSPoint and Memoryblock eat up too much time although the DSP function in general is quite fast.
Vector_SquareSingle (aPoint As NSPoint) As NSPoint: Builds the vector square of a NSPoint using vDSP_vsq. Please note this is just an example and I would rather recommend to use the NSPoint Vector_Square extension method which is faster. Conversions between NSPoint and Memoryblock eat up too much time although the DSP function in general is quite fast.