{"id":19934584,"url":"https://github.com/maxmarsc/adaa_wavetable","last_synced_at":"2025-05-03T12:30:42.097Z","repository":{"id":128131941,"uuid":"587260380","full_name":"maxmarsc/ADAA_wavetable","owner":"maxmarsc","description":"Python implementation of \" Antiderivative Antialiasing for Arbitrary Waveform Generation\" IEEE research paper","archived":false,"fork":false,"pushed_at":"2024-01-19T15:48:25.000Z","size":385,"stargazers_count":24,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-07T15:52:11.180Z","etag":null,"topics":["antialiasing","audio","dsp","python","real-time","research"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/maxmarsc.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}},"created_at":"2023-01-10T10:38:46.000Z","updated_at":"2025-03-19T13:06:06.000Z","dependencies_parsed_at":null,"dependency_job_id":"26415021-cc0e-4ba5-b9cb-ac43a9fabd22","html_url":"https://github.com/maxmarsc/ADAA_wavetable","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/maxmarsc%2FADAA_wavetable","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maxmarsc%2FADAA_wavetable/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maxmarsc%2FADAA_wavetable/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maxmarsc%2FADAA_wavetable/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/maxmarsc","download_url":"https://codeload.github.com/maxmarsc/ADAA_wavetable/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252190493,"owners_count":21708892,"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":["antialiasing","audio","dsp","python","real-time","research"],"created_at":"2024-11-12T23:17:20.411Z","updated_at":"2025-05-03T12:30:41.782Z","avatar_url":"https://github.com/maxmarsc.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Experimentations on ADAA for wavetable oscillators\nThis repository contains all the python experiments I made based on the IEEE research paper [Antiderivative Antialiasing for Arbitrary Waveform Generation](https://ieeexplore.ieee.org/document/9854137)\n\nThe paper provided an algorithm, some results and some matlab demo code which you can find [here](https://dangelo.audio/ieee-talsp-aaiir-osc.html)\n\nThis work was presented at the [Audio Developer Conference 2023](https://audio.dev/conference/) alongside its C++ implementation for real-time [here](https://github.com/maxmarsc/libadawata). \n\nThe code contained in here is certainly not production ready, but I made what I could to understand, replicate, and further adapt the algorithm to a real-time scenario.\n\n*Keep in mind that I'm not a DSP specialist, if you find something weird or buggy in my code don't hesitate to tell it. Also this repository is not dedicated to explain the algorithm in any case.*\n\n## What's included\nThis repository contains 3 mains parts :\n- `matlab` : contains the Matlab code of the paper demo, slightly modified to run with Octave\n- `python` : contains the different versions of the algorithm and some tools to\nanalyze the results (metrics, graphs...)\n- `python/legacy.py` : contains some iterations of my work when adapting the algorithm.\nIt's only provided for R\u0026D legacy and should not be considered reliable\n\n## What changed since ADC23\n- Matlab is no longer required to compute SNR. Both SNR and SINAD computations\nare working as expected and in full python code\n- Following SINAD fixes, I changed the mipmap transition thresholds, algorithm\nshould be a little slower\n- The cross-fading is no longer using this weird frequency-based strategy I presented\nat ADC23, now using a more classic time-based strategy\n\n\n## Python experimentations\n### Requirements\nThe following tools are required :\n- `libsamplerate` : for mipmapping resampling\n- `libsndfile` : for audio exporting\n\nOn Ubuntu you can install `libsamplerate` and `libsndfile` with the following command:\n```bash\napt-get install -y libsamplerate0 libsndfile1\n```\n\nAfter that you will need to install the python requirements :\n```bash\npip install -r requirements.txt\n```\n\n### How to use\nI provide a main python script that can performs three tasks, on different version\nof both the ADAA algorithm, and its alternatives (lerp + oversampling) :\n- Metrics computation (SNR and SINAD)\n- Sweep test spectrogram plot\n- Power spectral density plot\n\nSome values still needs to be modified manually in the `main.py` file depending on your use case:\n- `DURATION_S` : The duration of generated audio, might lead to high ram usage if too high\n- `FREQS` : A list of frequencies to generate for (only in psd/metrics modes)\n- `ALGOS_OPTIONS` :  A list of all the algorithm to test\n- `NUM_PROCESS` : The number of parallel process, maxed out to 20, mined out to you ncpus\n- `SAMPLERATE`\n\n#### Metrics\nFor the metrics mode use the following options :\n```bash\npython python/main.py metrics [--export {snr,sinad,both,none}] [--export-dir EXPORT_DIR] [--export-audio] [--export-phase]\n```\n\nYou'd usually want to add all the frequencies you want to test in `FREQS`.\nThe script will write the metrics in CSV files.\n\n#### Sweep test\nFor the metrics mode use the following options :\n```bash\npython python/main.py sweep [--export-dir EXPORT_DIR] [--export-audio] [--export-phase]\n```\n\nThis will automatically generate a sweep test from 20Hz to Nyquist and plot its spectrogram.  \nThis mode will not read the `FREQS` variable.  \nI suggest a duration of 5s to have a good enough resolution in the spectrogram.\n\n#### PSD\nFor the psd mode use the following options :\n```bash\npython python/main.py psd [--export-dir EXPORT_DIR] [--export-audio] [--export-phase]\n```\n\nThis will use a matplotlib graph to display the psd values for each test, and a final\ngraph with all the waveforms on the same graphs.\n\n**This mode requires `FREQS` to contains a single value**\n\n# What's next\nAs mentioned above, this is an experimentation repo, not a tool designed for\nadvanced use or anything like it.\n\nI don't plan to make modifications to make it a user-friendly demo tool.\nHowever I'm open to suggestions in order to help further researchs such as :\n- Improvements on the argparser to allow passing frequencies and/or other parameters\n- ~~Metrics improvements/fixes~~ DONE\n- Improvement/Changes in the algorithm\n\n\nIf you wan't to discuss about it you can open an issue or you can find me on :\n - [Discord](https://discordapp.com/users/Groumpf#2353)\n - [Twitter](https://twitter.com/Groumpf_)\n - [Mastodon](https://piaille.fr/@groumpf)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaxmarsc%2Fadaa_wavetable","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmaxmarsc%2Fadaa_wavetable","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaxmarsc%2Fadaa_wavetable/lists"}