Contents

jkl1337/swiftpffft

Swift package providing a PFFFT (Pretty Fast, Fast Fourier Transform) library with wrapper.

Example


// construct an interface for FFT, IFFT and convolutions. The interface is parameterized on the
// type of element in the signal (time) domain. The spectrum (frequency) domain type will always be
// complex. For a real valued signal the spectrum size will be `n / 2`, with the packing convention
// 
let fft = try FFT<Complex<Float>>(n: 16)
let signal = fft.makeSignalBuffer()

signal.enumerateInPlace { (i, v) in
    v = Complex(Float(i) + 1.0, Float(i) - 2.0)
}

let spectrum = fft.makeSpectrumBuffer()
fft.forward(signal: signal, spectrum: spectrum)

fft.inverse(spectrum: spectrum, signal: signal)

Package Metadata

Repository: jkl1337/swiftpffft

Default branch: master

README: README.md