https://github.com/jeslie0/purescript-fft-js
The fastest JS Radix-4/Radix-2 FFT implementation, in PureScript
https://github.com/jeslie0/purescript-fft-js
fft fft-js javascript nix purescript
Last synced: about 2 months ago
JSON representation
The fastest JS Radix-4/Radix-2 FFT implementation, in PureScript
- Host: GitHub
- URL: https://github.com/jeslie0/purescript-fft-js
- Owner: jeslie0
- Created: 2024-01-12T02:00:37.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-01-12T02:54:27.000Z (over 2 years ago)
- Last Synced: 2025-01-16T16:26:23.763Z (over 1 year ago)
- Topics: fft, fft-js, javascript, nix, purescript
- Language: JavaScript
- Homepage: https://pursuit.purescript.org/packages/purescript-fft-js
- Size: 28.3 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
# purescript-fft-js
-----

[](https://github.com/jeslie0/purescript-fft-js/releases)
[](https://github.com/jeslie0/purescript-fft-js/actions/workflows/CI.yml)
[](https://pursuit.purescript.org/packages/purescript-fft-js)
A PureScript wrapper around [fft.js](https://github.com/indutny/fft.js/), providing functions to take the Fast Fourier Transform of real and complex arrays. There is also a module extending the functionality to the [cartesian](https://github.com/Ebmtranceboy/purescript-cartesian) library.
## Notes
This library exposes the public fft.js functionality in the [FFT](./src/FFT.purs) module. The module uses two `newtype` wrappers `RealArray` and `ComplexArray` to add a bit of type safety to the function types. A complex array is an interweaved array of real and imaginary parts: `[re_0, im_0, re_1, im_1,...]`.
Whenever we refer to the size of an array, we mean the number of *numbers* in it, not elements in the array. An array interpreted as a `ComplexArray` will have size half of that if it is interpreted as a `RealArray`. This is helpfully made clear by the `FFTArray` typeclass, whose instances have a `size` function.
## Installation
```
spago install fft-js
```
## Documentation
Module documentation is [published on Pursuit](http://pursuit.purescript.org/packages/purescript-fft-js).