Skip to content
This repository has been archived by the owner on Jun 26, 2024. It is now read-only.

Latest commit

 

History

History
35 lines (20 loc) · 1.18 KB

README.md

File metadata and controls

35 lines (20 loc) · 1.18 KB

cfft - Clojure Fast Fourier Transform

A pure Clojure implementation of Fourier transforms.

Travis CI Build Status

Clojars Project

Usage

cfft is intended as a library, import it into your clojure project and call the fft or ifft function on any matrix.

Examples

Calling cfft with: (fft [1 2 3])

will yield:

<Complex (-1.5000000000000009 + 0.8660254037844382j)>
<Complex (-1.4999999999999987 + -0.8660254037844404j)>)````

The fft and ifft functions will take any matrix containing numbers or complex values (hashmaps with a :real and an :imag key). Both produce matrices of identical size to the input containing complex values. To get the results as real numbers, use matrix-apply and the real function.

````(matrix-apply real (fft [1 2 3]))````

## Performance

Performance has not been benchmarked, and is unpredicatble. It currently improves with calls to fft and ifft, most likely as a result of caching in calls to sin and cos in java.lang.Math.

## License

Copyright © 2014 Kevin Dean

Distributed under the MIT license.