{"id":20802022,"url":"https://github.com/iqengine/webfft","last_synced_at":"2025-09-09T16:34:00.266Z","repository":{"id":188757972,"uuid":"679379838","full_name":"IQEngine/WebFFT","owner":"IQEngine","description":"The Fastest Fourier Transform on the Web!","archived":false,"fork":false,"pushed_at":"2025-01-27T18:41:52.000Z","size":2257,"stargazers_count":100,"open_issues_count":7,"forks_count":8,"subscribers_count":8,"default_branch":"main","last_synced_at":"2025-04-13T04:59:41.166Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/IQEngine.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":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-08-16T17:51:20.000Z","updated_at":"2025-04-04T16:25:28.000Z","dependencies_parsed_at":"2024-06-03T05:46:28.341Z","dependency_job_id":null,"html_url":"https://github.com/IQEngine/WebFFT","commit_stats":null,"previous_names":["iqengine/webfft"],"tags_count":60,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IQEngine%2FWebFFT","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IQEngine%2FWebFFT/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IQEngine%2FWebFFT/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IQEngine%2FWebFFT/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/IQEngine","download_url":"https://codeload.github.com/IQEngine/WebFFT/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248665756,"owners_count":21142123,"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-11-17T18:27:46.574Z","updated_at":"2025-04-13T04:59:47.289Z","avatar_url":"https://github.com/IQEngine.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# WebFFT\n\nThe Fastest Fourier Transform on the Web!\n\n[Try it out](https://webfft.com/)\n\n[Documentation](https://webfft.com/docs)\n\nWe welcome feedback via GitHub Issues and PRs!\n\n## Overview\n\nWebFFT is a metalibrary containing many FFT libraries, both javascript and webassembly based. We'll refer to these as sub-libraries.\n\nThere is a default sub-library that is used, but if you run\n\n```javascript\nimport webfft from \"webfft\";\nconst fft = new webfft(1024);\nfft.profile(); // optional arg sets number of seconds spent profiling\n```\n\nit will benchmark them all and use the best one for future calls.\n\nAs part of importing the library we will run a check to see if wasm is even supported, so the profiler and default can know which pool to pull from.\n\n### Basic Usage\n\n```javascript\nconst webfft = require('webfft');\n\n// Instantiate\nconst fftsize = 1024; // must be power of 2\nconst fft = new webfft(fftsize);\n\n// Profile\nprofileResults = fft.profile(); // results object can be used to make visualizations of the benchmarking results\n\n// Create Input\nconst input = new Float32Array(2048); // interleaved complex array (IQIQIQIQ...), so it's twice the size\ninput.fill(0);\n\n// Run FFT\nconst out = fft.fft(input); // out will be a Float32Array of size 2048\n// or\nconst out = fft.fft(input, 'kissWasm');\n\nfft.dispose(); // release Wasm memory\n```\n\n### 2D FFTs\n\nWebFFT also supports 2D FFTs, using an array of arrays.\nThe inner arrays should be length 2*size and the outter array length should be a power of 2 but does not need to match the inner. \n\n```javascript\nimport webfft from \"webfft\";\n\nconst fftsize = 1024;\nconst outterSize = 128;\nconst fft = new webfft(fftsize);\nlet inputArr = [];\nfor (let j = 0; j \u003c outterSize; j++) {\n  const subArray = new Float32Array(fftsize * 2);\n  for (let i = 0; i \u003c fftsize * 2; i++) {\n    subArray[i] = i * j * 1.12312312; // Arbitrary\n  }\n  inputArr.push(subArray); // add inner array\n}\nconst out = fft.fft2d(inputArr);\n\nfft.dispose(); // cleanup wasm\n```\n\n### Other Notes\n\nDeploy site using `cd site \u0026\u0026 npm run deploy`, and make sure in github pages settings it uses \"deploy from a branch\" and gh-pages is selected as the branch, because npm run deploy runs the gh-pages command which publishes the site to gh-pages branch by default.\n\nUse fftr() for real-valued input, the output will still be complex but only the positive frequencies will be returned.\n\nYou don't have to pass fft/fftr/fft2d typed arrays, they can be regular javascript arrays.\n\nRun unit tests with `npm run test`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fiqengine%2Fwebfft","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fiqengine%2Fwebfft","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fiqengine%2Fwebfft/lists"}