flat-fft
TypeScript icon, indicating that this package has built-in type declarations

2.1.2 • Public • Published

Flat FFT

A simple FFT implementation in JS with no fragmented allocations.

Usage

This module is based on ESM, thus you need to import it via import keyword.

import {FlatFFT} from "flat-fft";

// Setup calculation template for order 10 FFT (1024 complex numbers in length)
const FFT1024 = new FlatFFT(10);

// Create a range of complex numbers as Float32Array.
const original = FlatFFT.toComplex(new Array(1024).fill(0).map((v,i)=>i));
// perform FFT
const transformed = FFT1024.fft(original);
// perform IFFT
const reconstructed = FFT1024.ifft(transformed);

console.log(original, transformed, reconstructed);

Readme

Keywords

none

Package Sidebar

Install

npm i flat-fft

Weekly Downloads

2

Version

2.1.2

License

MIT

Unpacked Size

8.74 kB

Total Files

6

Last publish

Collaborators

  • martian17