{"id":13634993,"url":"https://github.com/scijs/fourier-transform","last_synced_at":"2025-04-06T02:08:03.908Z","repository":{"id":38150881,"uuid":"58754356","full_name":"scijs/fourier-transform","owner":"scijs","description":"Minimalistic and efficient FFT implementation","archived":false,"fork":false,"pushed_at":"2021-06-21T22:46:49.000Z","size":57,"stargazers_count":167,"open_issues_count":2,"forks_count":19,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-03-30T01:06:47.811Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/scijs.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-05-13T16:06:02.000Z","updated_at":"2024-07-10T17:14:55.000Z","dependencies_parsed_at":"2022-07-25T20:19:53.713Z","dependency_job_id":null,"html_url":"https://github.com/scijs/fourier-transform","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scijs%2Ffourier-transform","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scijs%2Ffourier-transform/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scijs%2Ffourier-transform/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scijs%2Ffourier-transform/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/scijs","download_url":"https://codeload.github.com/scijs/fourier-transform/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247423513,"owners_count":20936626,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-02T00:00:38.671Z","updated_at":"2025-04-06T02:08:03.887Z","avatar_url":"https://github.com/scijs.png","language":"JavaScript","readme":"# fourier-transform [![stable](https://img.shields.io/badge/stability-stable-brightgreen.svg)](http://github.com/badges/stability-badges) [![Build Status](https://img.shields.io/travis/scijs/fourier-transform.svg)](https://travis-ci.org/scijs/fourier-transform)\n\nMinimalistic and efficient FFT implementation for 2\u003csup\u003en\u003c/sup\u003e-size inputs. Includes regular and asm.js versions.\n\n[![npm install fourier-transform](https://nodei.co/npm/fourier-transform.png?mini=true)](https://npmjs.org/package/fourier-transform/)\n\n```js\nvar ft = require('fourier-transform')\nvar db = require('decibels')\nvar sine = require('audio-oscillator/sin')\n\n// generate sine wave 440 Hz\nvar waveform = sine(1024, 440)\n\n//get normalized magnitudes for frequencies from 0 to 22050 with interval 44100/1024 ≈ 43Hz\nvar spectrum = ft(waveform)\n\n//convert to decibels\nvar decibels = spectrum.map((value) =\u003e db.fromGain(value))\n```\n\nTo use asm.js version, require as `require('fourier-transform/asm')`. That is ~35% faster.\n\n## Thanks\n\nTo all the [existing fft packages](./benchmark.md), without them this one would not be possible. Special thanks to @corbanbrook for the most efficient implementation in [dsp.js](https://github.com/corbanbrook/dsp.js). This package is based on [dsp.js RFFT](https://github.com/corbanbrook/dsp.js/blob/master/dsp.js#L554), which is based on [RealFFT](http://www.jjj.de/fxt/).\n\n## Contribute\n\nIf you find it slow, difficult or broken, please [post an issue](https://github.com/dfcreative/fourier-transform/issues). If you have ideas or know-hows for better implementation - [PR’s are welcome](https://github.com/dfcreative/fourier-transform/pulls).\n\n## Related\n\n* [fourier transforms benchmark](./benchmark.md).\n* [ndarray-fft](https://github.com/scijs/ndarray-fft) FFT for ndarrays, allowing not-power-of-two inputs.\n* [gl-fourier](https://github.com/dfcreative/gl-fourier) WebGL fourier transform implementations.\n* [gl-spectrum](https://github.com/dfcreative/gl-spectrum) render spectrum in 2d/3d canvas.\n","funding_links":[],"categories":["data structures and algorithms"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fscijs%2Ffourier-transform","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fscijs%2Ffourier-transform","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fscijs%2Ffourier-transform/lists"}