{"id":15640371,"url":"https://github.com/drom/fourier","last_synced_at":"2025-04-13T15:50:44.070Z","repository":{"id":29526619,"uuid":"33065201","full_name":"drom/fourier","owner":"drom","description":":wavy_dash: Fourier transform in JavaScript","archived":false,"fork":false,"pushed_at":"2024-01-27T07:52:30.000Z","size":234,"stargazers_count":79,"open_issues_count":8,"forks_count":10,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-04-10T11:25:13.168Z","etag":null,"topics":["fft","fourier","hacktoberfest"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/drom.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2015-03-29T07:32:21.000Z","updated_at":"2024-12-16T03:03:45.000Z","dependencies_parsed_at":"2024-06-19T05:15:57.413Z","dependency_job_id":"dccda27a-c682-4bbd-81f8-d24060abc46f","html_url":"https://github.com/drom/fourier","commit_stats":{"total_commits":115,"total_committers":2,"mean_commits":57.5,"dds":0.008695652173912993,"last_synced_commit":"9ae494d2e53a4a964d2af30b8d2ce4335a132872"},"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/drom%2Ffourier","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/drom%2Ffourier/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/drom%2Ffourier/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/drom%2Ffourier/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/drom","download_url":"https://codeload.github.com/drom/fourier/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248741147,"owners_count":21154249,"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":["fft","fourier","hacktoberfest"],"created_at":"2024-10-03T11:35:07.629Z","updated_at":"2025-04-13T15:50:44.037Z","avatar_url":"https://github.com/drom.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cspan\u003e\u003cimg align=\"right\" src=\"logo.png\"/\u003e\u003c/span\u003e\n\n# *Fourier*\n[![NPM version](https://img.shields.io/npm/v/fourier.svg)](https://www.npmjs.org/package/fourier)\n[![Linux](https://github.com/drom/fourier/actions/workflows/linux.yml/badge.svg)](https://github.com/drom/fourier/actions/workflows/linux.yml)\n[![MacOS](https://github.com/drom/fourier/actions/workflows/macos.yml/badge.svg)](https://github.com/drom/fourier/actions/workflows/macos.yml)\n[![Windows](https://github.com/drom/fourier/actions/workflows/windows.yml/badge.svg)](https://github.com/drom/fourier/actions/workflows/windows.yml)\n\nPure JavaScript library discrete transforms, including [Discrete Fourier Transform](http://en.wikipedia.org/wiki/Discrete_Fourier_transform) (DFT); It's fast, inverse, and special forms.\n\n## Use\n### Node.js\n\n```\nnpm i fourier\n```\n\n```js\nvar fourier = require('fourier');\n```\n\n### Browser\n\n```html\n\u003cscript src=\"https://cdn.jsdelivr.net/npm/fourier/fourier.min.js\"\u003e\u003c/script\u003e\n```\n\n## Functions\n### FFT custom\nFast Fourier transform (FFT). Cooley–Tukey algorithm. in-place. Radix-2, Decimation in Time (DIT).\n\nOne function for each data type, vector size and coding style\n\n```js\nfourier.custom.fft_\u003ctype\u003e_\u003csize\u003e_\u003cstyle\u003e\n```\n\n- data type: `f32` or `f64`\n- vector size: `16`, `32`, ... `1048576`\n- coding style: 'raw' or `asm`\n\n#### example:\n\n```js\n// Init\nvar stdlib = {\n    Math: Math,\n    Float32Array: Float32Array,\n    Float64Array: Float64Array\n};\n\n// Create heap for the fft data and twiddle factors\nvar heap = fourier.custom.alloc(65536, 3);\n\n// Create instance of FFT runner\nvar fft_f64_65536_asm_runner = fourier.custom.fft_f64_65536_asm(stdlib, null, heap);\n\n// Init twiddle factors\nfft_f64_65536_asm_runner.init();\n\n// Run transformations\nfft_f64_65536_asm_runner.transform();\n```\n\n### Other\n\n```js\nfourier.dft(realArray, imagArray); // ⇒ [realArray, imagArray]\n```\n\n$$\\large X_k=\\sum_{n=0}^{N-1}x_n\\cdot e^{-i 2 \\pi k n/N}$$\n\n\n```js\nfourier.idft(realArray, imagArray); // ⇒ [realArray, imagArray]\n```\n\n$$\\large x_n=\\frac{1}{N}\\sum_{k=0}^{N-1}X_k\\cdot e^{i 2 \\pi kn/N}$$\n\n## Testing\n`npm test`\n\n\n## License\nMIT [LICENSE](https://github.com/drom/fourier/blob/master/LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdrom%2Ffourier","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdrom%2Ffourier","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdrom%2Ffourier/lists"}