{"id":31737329,"url":"https://github.com/mathaou/jdsp","last_synced_at":"2025-10-09T09:12:01.426Z","repository":{"id":209765042,"uuid":"724282062","full_name":"mathaou/jdsp","owner":"mathaou","description":"Digital Signal Processing Utilities for Jai ","archived":false,"fork":false,"pushed_at":"2024-05-31T23:10:19.000Z","size":3361,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-06-01T00:25:02.802Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C","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/mathaou.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-11-27T19:07:29.000Z","updated_at":"2024-05-31T23:10:24.000Z","dependencies_parsed_at":"2023-11-29T03:36:41.498Z","dependency_job_id":"ee1048fb-ed38-4826-9da5-712565cfa444","html_url":"https://github.com/mathaou/jdsp","commit_stats":null,"previous_names":["mathaou/jdsp"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/mathaou/jdsp","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mathaou%2Fjdsp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mathaou%2Fjdsp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mathaou%2Fjdsp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mathaou%2Fjdsp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mathaou","download_url":"https://codeload.github.com/mathaou/jdsp/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mathaou%2Fjdsp/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279001124,"owners_count":26083021,"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","status":"online","status_checked_at":"2025-10-09T02:00:07.460Z","response_time":59,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":"2025-10-09T09:09:15.256Z","updated_at":"2025-10-09T09:12:01.414Z","avatar_url":"https://github.com/mathaou.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# jdsp - Jai Digital Signal Processing Utilities\n\n![jfft](./jfft.gif)\n\n| Feature | Description|\n| --- | --- |\n| `jfft` | Fast Fourier Transforms with various windowing functions |\n| `jdsp_filter` | **WIP** Various filters including lowpass, highpass, bandstop, and bandpass |\n\n---\n#### `jfft`\n\n`jfft` only processes real data sets at this time. No complex numbers. This means that instead of real/imaginary components we have sine/cosine.\n\n`jfft_create_transformer :: (signal_length: int, allocator: Allocator = temp) -\u003e *jfft_transformer #must`\n\n\u003e Sets up the memory needed to perform FFTs on inputs of a specific length. `signal_length` should be a power of two for best performance, but the only real requirement is that `signal_length` is even. Internal memory can be reused by `jfft_forward` and `jfft_backward`.\n\n`jfft_destroy_transformer :: (jfft: *jfft_transformer)`\n\n\u003e If you used something other than `temp` as an allocator or you don't call `reset_temporary_storage` too often you can call this.\n\n`jfft_forward :: (jfft: *jfft_transformer, input: []float32)`\n\n\u003e Performs an FFT on a given input buffer and puts sine/cosine components . `input` should match the `signal_length` of the transformer. DC is in bin `0`. Bins `1..N/2-1` contain frequency bins. Nyquist starts at bin `N/2`. Results can be fed into `jfft_magnitude_transform` or `jfft_magnitude_dB_transform` for useful analytics.\n\n`jfft_forward_transform :: (input: []float32, allocator: Allocator = temp)`\n\n\u003e Creates `*jfft_transformer` internally. Same as `jfft_forward` otherwise. Good as a one-off.\n\n`jfft_backward :: (jfft: *jfft_transformer, input: []float32)`\n\n\u003e Performs an inverse FFT on data returned from `jfft_forward`. Floating point errors mean that the original signal may not be able to be recreated exactly depending on original signal.\n\n`jfft_backward_transform :: (input: []float32, allocator: Allocator = temp)`\n\n\u003e  Creates `*jfft_transformer` internally. Same as `jfft_backward` otherwise. Good as a one-off.\n\n`jfft_magnitude_transform :: (input: []float32)`\n\n\u003e Modifies input in-place. Converts results of `jfft_forward` to be magnitude data up to `N/2` due to Nyquist-Shannon sampling theorem. This means that an FFT can only provide useful info for frequency bins of `sample_rate / 2`. Anything beyond `N/2` is imaginary or something (useful for reconstruction).\n\n`jfft_magnitude :: (input: []float32, allocator: Allocator = temp) -\u003e []float32 #must`\n\n\u003e Same as `jfft_magnitude_transform` but it returns a new array without touching original data.\n\n`jfft_magnitude_db_transform :: (input: []float32)`\n\n\u003e Similar to `jfft_magnitude_transform` except converts the first `N/2` frequency bins to decibels.\n\n`jfft_magnitude_db :: (input: []float32, allocator: Allocator = temp) -\u003e []float32 #must`\n\n\u003e Same as `jfft_magnitude_db_transform` but returns a new array without touching original data.\n\n---\nModifications to the frequency-domain data from `jfft_forward` would require overlap-add for successful `jfft_backward`. The successful execution of Fourier synthesis from modified frequency-domain data is on the programmer and outside the scope of the API at this time.\n\n---\n\n#### `jdsp_filter`\n\nWorking on it!\n\n---\n\n#### Example\n\nGo into `example` and run `jai example.jai -release`. You should have an `sdl2` library accessible somewhere in case the one in `modules` doesn't work for you for whatever reason.\n\nRun it like `./example`.\n\n`UP/DOWN` will increase/decrease your chunk for FFT.\n\n`SPACE` will pause the graphs at the current chunk.\n\n`LEFT/RIGHT` will move to next/previous frame when paused.\n\n`K/L` will decrease/increase the time betweeen chunks when unpaused.\n\nClick the `Window` combo box at the top to see how different windows affect your input signal and FFT results.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmathaou%2Fjdsp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmathaou%2Fjdsp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmathaou%2Fjdsp/lists"}