flamo 0.1.3__tar.gz → 0.1.5__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {flamo-0.1.3 → flamo-0.1.5}/PKG-INFO +2 -1
- {flamo-0.1.3 → flamo-0.1.5}/examples/e1_mimo.py +60 -0
- {flamo-0.1.3 → flamo-0.1.5}/examples/e8_colorless_fdn.py +7 -74
- {flamo-0.1.3 → flamo-0.1.5}/examples/e8_fdn.py +2 -2
- {flamo-0.1.3 → flamo-0.1.5}/examples/e9_loss_profile.py +4 -4
- {flamo-0.1.3 → flamo-0.1.5}/flamo/auxiliary/config/config.py +2 -1
- {flamo-0.1.3 → flamo-0.1.5}/flamo/auxiliary/eq.py +2 -1
- {flamo-0.1.3 → flamo-0.1.5}/flamo/auxiliary/reverb.py +1 -1
- {flamo-0.1.3 → flamo-0.1.5}/flamo/functional.py +68 -1
- {flamo-0.1.3 → flamo-0.1.5}/flamo/optimize/loss.py +2 -1
- {flamo-0.1.3 → flamo-0.1.5}/flamo/processor/dsp.py +41 -10
- {flamo-0.1.3 → flamo-0.1.5}/pyproject.toml +2 -1
- flamo-0.1.3/losses.py +0 -721
- flamo-0.1.3/rirs/lrf/fdn_target_ir.wav +0 -0
- flamo-0.1.3/rirs/lrf/target_ir.wav +0 -0
- flamo-0.1.3/run.py +0 -387
- flamo-0.1.3/test_fdn.py +0 -437
- flamo-0.1.3/test_fdn_2.py +0 -466
- flamo-0.1.3/test_fdn_3.py +0 -399
- flamo-0.1.3/test_fdn_4.py +0 -465
- flamo-0.1.3/test_fdn_5.py +0 -407
- flamo-0.1.3/test_fdn_6.py +0 -423
- flamo-0.1.3/test_fdn_6_wgn.py +0 -424
- flamo-0.1.3/test_peq.py +0 -219
- flamo-0.1.3/test_prop_peak.py +0 -56
- {flamo-0.1.3 → flamo-0.1.5}/.gitignore +0 -0
- {flamo-0.1.3 → flamo-0.1.5}/2025_FLAMO_ICASSP_DalSantoDeBortoli_poster.pdf +0 -0
- {flamo-0.1.3 → flamo-0.1.5}/LICENSE +0 -0
- {flamo-0.1.3 → flamo-0.1.5}/README.md +0 -0
- {flamo-0.1.3 → flamo-0.1.5}/examples/e0_siso.py +0 -0
- {flamo-0.1.3 → flamo-0.1.5}/examples/e2_chaining_filters.py +0 -0
- {flamo-0.1.3 → flamo-0.1.5}/examples/e3_series_class.py +0 -0
- {flamo-0.1.3 → flamo-0.1.5}/examples/e4_recursion.py +0 -0
- {flamo-0.1.3 → flamo-0.1.5}/examples/e4_recursion_nn.py +0 -0
- {flamo-0.1.3 → flamo-0.1.5}/examples/e5_shell.py +0 -0
- {flamo-0.1.3 → flamo-0.1.5}/examples/e6_anti_aliasing.py +0 -0
- {flamo-0.1.3 → flamo-0.1.5}/examples/e7_biquad.py +0 -0
- {flamo-0.1.3 → flamo-0.1.5}/examples/e7_biquad_nn.py +0 -0
- {flamo-0.1.3 → flamo-0.1.5}/examples/e7_geq.py +0 -0
- {flamo-0.1.3 → flamo-0.1.5}/examples/e7_peq.py +0 -0
- {flamo-0.1.3 → flamo-0.1.5}/examples/e7_svf.py +0 -0
- {flamo-0.1.3 → flamo-0.1.5}/examples/e8_active_acoustics.py +0 -0
- {flamo-0.1.3 → flamo-0.1.5}/examples/e8_colorless_sfdn.py +0 -0
- {flamo-0.1.3 → flamo-0.1.5}/examples/run_all.py +0 -0
- {flamo-0.1.3 → flamo-0.1.5}/flamo/__init__.py +0 -0
- {flamo-0.1.3 → flamo-0.1.5}/flamo/auxiliary/__init__.py +0 -0
- {flamo-0.1.3 → flamo-0.1.5}/flamo/auxiliary/filterbank.py +0 -0
- {flamo-0.1.3 → flamo-0.1.5}/flamo/auxiliary/minimize.py +0 -0
- {flamo-0.1.3 → flamo-0.1.5}/flamo/auxiliary/scattering.py +0 -0
- {flamo-0.1.3 → flamo-0.1.5}/flamo/optimize/__init__.py +0 -0
- {flamo-0.1.3 → flamo-0.1.5}/flamo/optimize/dataset.py +0 -0
- {flamo-0.1.3 → flamo-0.1.5}/flamo/optimize/surface.py +0 -0
- {flamo-0.1.3 → flamo-0.1.5}/flamo/optimize/trainer.py +0 -0
- {flamo-0.1.3 → flamo-0.1.5}/flamo/optimize/utils.py +0 -0
- {flamo-0.1.3 → flamo-0.1.5}/flamo/processor/__init__.py +0 -0
- {flamo-0.1.3 → flamo-0.1.5}/flamo/processor/system.py +0 -0
- {flamo-0.1.3 → flamo-0.1.5}/flamo/utils.py +0 -0
- {flamo-0.1.3 → flamo-0.1.5}/notebooks/e7_biquad.ipynb +0 -0
- {flamo-0.1.3 → flamo-0.1.5}/notebooks/e8_colorless_fdn.ipynb +0 -0
- {flamo-0.1.3 → flamo-0.1.5}/rirs/Otala-2024.05.10/mic1_speaker1.wav +0 -0
- {flamo-0.1.3 → flamo-0.1.5}/rirs/Otala-2024.05.10/mic1_speaker10.wav +0 -0
- {flamo-0.1.3 → flamo-0.1.5}/rirs/Otala-2024.05.10/mic1_speaker11.wav +0 -0
- {flamo-0.1.3 → flamo-0.1.5}/rirs/Otala-2024.05.10/mic1_speaker12.wav +0 -0
- {flamo-0.1.3 → flamo-0.1.5}/rirs/Otala-2024.05.10/mic1_speaker13.wav +0 -0
- {flamo-0.1.3 → flamo-0.1.5}/rirs/Otala-2024.05.10/mic1_speaker14.wav +0 -0
- {flamo-0.1.3 → flamo-0.1.5}/rirs/Otala-2024.05.10/mic1_speaker2.wav +0 -0
- {flamo-0.1.3 → flamo-0.1.5}/rirs/Otala-2024.05.10/mic1_speaker3.wav +0 -0
- {flamo-0.1.3 → flamo-0.1.5}/rirs/Otala-2024.05.10/mic1_speaker5.wav +0 -0
- {flamo-0.1.3 → flamo-0.1.5}/rirs/Otala-2024.05.10/mic1_speaker6.wav +0 -0
- {flamo-0.1.3 → flamo-0.1.5}/rirs/Otala-2024.05.10/mic1_speaker7.wav +0 -0
- {flamo-0.1.3 → flamo-0.1.5}/rirs/Otala-2024.05.10/mic1_speaker8.wav +0 -0
- {flamo-0.1.3 → flamo-0.1.5}/rirs/Otala-2024.05.10/mic1_speaker9.wav +0 -0
- {flamo-0.1.3 → flamo-0.1.5}/rirs/Otala-2024.05.10/mic2_speaker1.wav +0 -0
- {flamo-0.1.3 → flamo-0.1.5}/rirs/Otala-2024.05.10/mic2_speaker10.wav +0 -0
- {flamo-0.1.3 → flamo-0.1.5}/rirs/Otala-2024.05.10/mic2_speaker11.wav +0 -0
- {flamo-0.1.3 → flamo-0.1.5}/rirs/Otala-2024.05.10/mic2_speaker12.wav +0 -0
- {flamo-0.1.3 → flamo-0.1.5}/rirs/Otala-2024.05.10/mic2_speaker13.wav +0 -0
- {flamo-0.1.3 → flamo-0.1.5}/rirs/Otala-2024.05.10/mic2_speaker14.wav +0 -0
- {flamo-0.1.3 → flamo-0.1.5}/rirs/Otala-2024.05.10/mic2_speaker2.wav +0 -0
- {flamo-0.1.3 → flamo-0.1.5}/rirs/Otala-2024.05.10/mic2_speaker3.wav +0 -0
- {flamo-0.1.3 → flamo-0.1.5}/rirs/Otala-2024.05.10/mic2_speaker5.wav +0 -0
- {flamo-0.1.3 → flamo-0.1.5}/rirs/Otala-2024.05.10/mic2_speaker6.wav +0 -0
- {flamo-0.1.3 → flamo-0.1.5}/rirs/Otala-2024.05.10/mic2_speaker7.wav +0 -0
- {flamo-0.1.3 → flamo-0.1.5}/rirs/Otala-2024.05.10/mic2_speaker8.wav +0 -0
- {flamo-0.1.3 → flamo-0.1.5}/rirs/Otala-2024.05.10/mic2_speaker9.wav +0 -0
- {flamo-0.1.3 → flamo-0.1.5}/rirs/Otala-2024.05.10/mic3_speaker1.wav +0 -0
- {flamo-0.1.3 → flamo-0.1.5}/rirs/Otala-2024.05.10/mic3_speaker10.wav +0 -0
- {flamo-0.1.3 → flamo-0.1.5}/rirs/Otala-2024.05.10/mic3_speaker11.wav +0 -0
- {flamo-0.1.3 → flamo-0.1.5}/rirs/Otala-2024.05.10/mic3_speaker12.wav +0 -0
- {flamo-0.1.3 → flamo-0.1.5}/rirs/Otala-2024.05.10/mic3_speaker13.wav +0 -0
- {flamo-0.1.3 → flamo-0.1.5}/rirs/Otala-2024.05.10/mic3_speaker14.wav +0 -0
- {flamo-0.1.3 → flamo-0.1.5}/rirs/Otala-2024.05.10/mic3_speaker2.wav +0 -0
- {flamo-0.1.3 → flamo-0.1.5}/rirs/Otala-2024.05.10/mic3_speaker3.wav +0 -0
- {flamo-0.1.3 → flamo-0.1.5}/rirs/Otala-2024.05.10/mic3_speaker5.wav +0 -0
- {flamo-0.1.3 → flamo-0.1.5}/rirs/Otala-2024.05.10/mic3_speaker6.wav +0 -0
- {flamo-0.1.3 → flamo-0.1.5}/rirs/Otala-2024.05.10/mic3_speaker7.wav +0 -0
- {flamo-0.1.3 → flamo-0.1.5}/rirs/Otala-2024.05.10/mic3_speaker8.wav +0 -0
- {flamo-0.1.3 → flamo-0.1.5}/rirs/Otala-2024.05.10/mic3_speaker9.wav +0 -0
- {flamo-0.1.3 → flamo-0.1.5}/rirs/Otala-2024.05.10/mic4_speaker1.wav +0 -0
- {flamo-0.1.3 → flamo-0.1.5}/rirs/Otala-2024.05.10/mic4_speaker10.wav +0 -0
- {flamo-0.1.3 → flamo-0.1.5}/rirs/Otala-2024.05.10/mic4_speaker11.wav +0 -0
- {flamo-0.1.3 → flamo-0.1.5}/rirs/Otala-2024.05.10/mic4_speaker12.wav +0 -0
- {flamo-0.1.3 → flamo-0.1.5}/rirs/Otala-2024.05.10/mic4_speaker13.wav +0 -0
- {flamo-0.1.3 → flamo-0.1.5}/rirs/Otala-2024.05.10/mic4_speaker14.wav +0 -0
- {flamo-0.1.3 → flamo-0.1.5}/rirs/Otala-2024.05.10/mic4_speaker2.wav +0 -0
- {flamo-0.1.3 → flamo-0.1.5}/rirs/Otala-2024.05.10/mic4_speaker3.wav +0 -0
- {flamo-0.1.3 → flamo-0.1.5}/rirs/Otala-2024.05.10/mic4_speaker5.wav +0 -0
- {flamo-0.1.3 → flamo-0.1.5}/rirs/Otala-2024.05.10/mic4_speaker6.wav +0 -0
- {flamo-0.1.3 → flamo-0.1.5}/rirs/Otala-2024.05.10/mic4_speaker7.wav +0 -0
- {flamo-0.1.3 → flamo-0.1.5}/rirs/Otala-2024.05.10/mic4_speaker8.wav +0 -0
- {flamo-0.1.3 → flamo-0.1.5}/rirs/Otala-2024.05.10/mic4_speaker9.wav +0 -0
- {flamo-0.1.3 → flamo-0.1.5}/rirs/Otala-2024.05.10/mic5_speaker1.wav +0 -0
- {flamo-0.1.3 → flamo-0.1.5}/rirs/Otala-2024.05.10/mic5_speaker10.wav +0 -0
- {flamo-0.1.3 → flamo-0.1.5}/rirs/Otala-2024.05.10/mic5_speaker11.wav +0 -0
- {flamo-0.1.3 → flamo-0.1.5}/rirs/Otala-2024.05.10/mic5_speaker12.wav +0 -0
- {flamo-0.1.3 → flamo-0.1.5}/rirs/Otala-2024.05.10/mic5_speaker13.wav +0 -0
- {flamo-0.1.3 → flamo-0.1.5}/rirs/Otala-2024.05.10/mic5_speaker14.wav +0 -0
- {flamo-0.1.3 → flamo-0.1.5}/rirs/Otala-2024.05.10/mic5_speaker2.wav +0 -0
- {flamo-0.1.3 → flamo-0.1.5}/rirs/Otala-2024.05.10/mic5_speaker3.wav +0 -0
- {flamo-0.1.3 → flamo-0.1.5}/rirs/Otala-2024.05.10/mic5_speaker5.wav +0 -0
- {flamo-0.1.3 → flamo-0.1.5}/rirs/Otala-2024.05.10/mic5_speaker6.wav +0 -0
- {flamo-0.1.3 → flamo-0.1.5}/rirs/Otala-2024.05.10/mic5_speaker7.wav +0 -0
- {flamo-0.1.3 → flamo-0.1.5}/rirs/Otala-2024.05.10/mic5_speaker8.wav +0 -0
- {flamo-0.1.3 → flamo-0.1.5}/rirs/Otala-2024.05.10/mic5_speaker9.wav +0 -0
- {flamo-0.1.3 → flamo-0.1.5}/rirs/arni_35_3541_4_2.wav +0 -0
- {flamo-0.1.3 → flamo-0.1.5}/rirs/s3_r4_o.wav +0 -0
- {flamo-0.1.3 → flamo-0.1.5}/sphinx/Makefile +0 -0
- {flamo-0.1.3 → flamo-0.1.5}/sphinx/_build/doctrees/auxiliary/eq.doctree +0 -0
- {flamo-0.1.3 → flamo-0.1.5}/sphinx/_build/doctrees/auxiliary/filterbank.doctree +0 -0
- {flamo-0.1.3 → flamo-0.1.5}/sphinx/_build/doctrees/auxiliary/minimize.doctree +0 -0
- {flamo-0.1.3 → flamo-0.1.5}/sphinx/_build/doctrees/auxiliary/reverb.doctree +0 -0
- {flamo-0.1.3 → flamo-0.1.5}/sphinx/_build/doctrees/auxiliary/scattering.doctree +0 -0
- {flamo-0.1.3 → flamo-0.1.5}/sphinx/_build/doctrees/environment.pickle +0 -0
- {flamo-0.1.3 → flamo-0.1.5}/sphinx/_build/doctrees/functional.doctree +0 -0
- {flamo-0.1.3 → flamo-0.1.5}/sphinx/_build/doctrees/index.doctree +0 -0
- {flamo-0.1.3 → flamo-0.1.5}/sphinx/_build/doctrees/optimize/dataset.doctree +0 -0
- {flamo-0.1.3 → flamo-0.1.5}/sphinx/_build/doctrees/optimize/loss.doctree +0 -0
- {flamo-0.1.3 → flamo-0.1.5}/sphinx/_build/doctrees/optimize/trainer.doctree +0 -0
- {flamo-0.1.3 → flamo-0.1.5}/sphinx/_build/doctrees/optimize/utils.doctree +0 -0
- {flamo-0.1.3 → flamo-0.1.5}/sphinx/_build/doctrees/processor/dsp.doctree +0 -0
- {flamo-0.1.3 → flamo-0.1.5}/sphinx/_build/doctrees/processor/system.doctree +0 -0
- {flamo-0.1.3 → flamo-0.1.5}/sphinx/_build/html/.buildinfo +0 -0
- {flamo-0.1.3 → flamo-0.1.5}/sphinx/_build/html/.buildinfo.bak +0 -0
- {flamo-0.1.3 → flamo-0.1.5}/sphinx/_build/html/.nojekyll +0 -0
- {flamo-0.1.3 → flamo-0.1.5}/sphinx/_build/html/_sources/auxiliary/eq.rst.txt +0 -0
- {flamo-0.1.3 → flamo-0.1.5}/sphinx/_build/html/_sources/auxiliary/filterbank.rst.txt +0 -0
- {flamo-0.1.3 → flamo-0.1.5}/sphinx/_build/html/_sources/auxiliary/minimize.rst.txt +0 -0
- {flamo-0.1.3 → flamo-0.1.5}/sphinx/_build/html/_sources/auxiliary/reverb.rst.txt +0 -0
- {flamo-0.1.3 → flamo-0.1.5}/sphinx/_build/html/_sources/auxiliary/scattering.rst.txt +0 -0
- {flamo-0.1.3 → flamo-0.1.5}/sphinx/_build/html/_sources/functional.rst.txt +0 -0
- {flamo-0.1.3 → flamo-0.1.5}/sphinx/_build/html/_sources/index.rst.txt +0 -0
- {flamo-0.1.3 → flamo-0.1.5}/sphinx/_build/html/_sources/optimize/dataset.rst.txt +0 -0
- {flamo-0.1.3 → flamo-0.1.5}/sphinx/_build/html/_sources/optimize/loss.rst.txt +0 -0
- {flamo-0.1.3 → flamo-0.1.5}/sphinx/_build/html/_sources/optimize/trainer.rst.txt +0 -0
- {flamo-0.1.3 → flamo-0.1.5}/sphinx/_build/html/_sources/optimize/utils.rst.txt +0 -0
- {flamo-0.1.3 → flamo-0.1.5}/sphinx/_build/html/_sources/processor/dsp.rst.txt +0 -0
- {flamo-0.1.3 → flamo-0.1.5}/sphinx/_build/html/_sources/processor/system.rst.txt +0 -0
- {flamo-0.1.3 → flamo-0.1.5}/sphinx/_build/html/_static/_sphinx_javascript_frameworks_compat.js +0 -0
- {flamo-0.1.3 → flamo-0.1.5}/sphinx/_build/html/_static/alabaster.css +0 -0
- {flamo-0.1.3 → flamo-0.1.5}/sphinx/_build/html/_static/basic.css +0 -0
- {flamo-0.1.3 → flamo-0.1.5}/sphinx/_build/html/_static/css/badge_only.css +0 -0
- {flamo-0.1.3 → flamo-0.1.5}/sphinx/_build/html/_static/css/fonts/Roboto-Slab-Bold.woff +0 -0
- {flamo-0.1.3 → flamo-0.1.5}/sphinx/_build/html/_static/css/fonts/Roboto-Slab-Bold.woff2 +0 -0
- {flamo-0.1.3 → flamo-0.1.5}/sphinx/_build/html/_static/css/fonts/Roboto-Slab-Regular.woff +0 -0
- {flamo-0.1.3 → flamo-0.1.5}/sphinx/_build/html/_static/css/fonts/Roboto-Slab-Regular.woff2 +0 -0
- {flamo-0.1.3 → flamo-0.1.5}/sphinx/_build/html/_static/css/fonts/fontawesome-webfont.eot +0 -0
- {flamo-0.1.3 → flamo-0.1.5}/sphinx/_build/html/_static/css/fonts/fontawesome-webfont.svg +0 -0
- {flamo-0.1.3 → flamo-0.1.5}/sphinx/_build/html/_static/css/fonts/fontawesome-webfont.ttf +0 -0
- {flamo-0.1.3 → flamo-0.1.5}/sphinx/_build/html/_static/css/fonts/fontawesome-webfont.woff +0 -0
- {flamo-0.1.3 → flamo-0.1.5}/sphinx/_build/html/_static/css/fonts/fontawesome-webfont.woff2 +0 -0
- {flamo-0.1.3 → flamo-0.1.5}/sphinx/_build/html/_static/css/fonts/lato-bold-italic.woff +0 -0
- {flamo-0.1.3 → flamo-0.1.5}/sphinx/_build/html/_static/css/fonts/lato-bold-italic.woff2 +0 -0
- {flamo-0.1.3 → flamo-0.1.5}/sphinx/_build/html/_static/css/fonts/lato-bold.woff +0 -0
- {flamo-0.1.3 → flamo-0.1.5}/sphinx/_build/html/_static/css/fonts/lato-bold.woff2 +0 -0
- {flamo-0.1.3 → flamo-0.1.5}/sphinx/_build/html/_static/css/fonts/lato-normal-italic.woff +0 -0
- {flamo-0.1.3 → flamo-0.1.5}/sphinx/_build/html/_static/css/fonts/lato-normal-italic.woff2 +0 -0
- {flamo-0.1.3 → flamo-0.1.5}/sphinx/_build/html/_static/css/fonts/lato-normal.woff +0 -0
- {flamo-0.1.3 → flamo-0.1.5}/sphinx/_build/html/_static/css/fonts/lato-normal.woff2 +0 -0
- {flamo-0.1.3 → flamo-0.1.5}/sphinx/_build/html/_static/css/theme.css +0 -0
- {flamo-0.1.3 → flamo-0.1.5}/sphinx/_build/html/_static/custom.css +0 -0
- {flamo-0.1.3 → flamo-0.1.5}/sphinx/_build/html/_static/doctools.js +0 -0
- {flamo-0.1.3 → flamo-0.1.5}/sphinx/_build/html/_static/documentation_options.js +0 -0
- {flamo-0.1.3 → flamo-0.1.5}/sphinx/_build/html/_static/file.png +0 -0
- {flamo-0.1.3 → flamo-0.1.5}/sphinx/_build/html/_static/fonts/Lato/lato-bold.eot +0 -0
- {flamo-0.1.3 → flamo-0.1.5}/sphinx/_build/html/_static/fonts/Lato/lato-bold.ttf +0 -0
- {flamo-0.1.3 → flamo-0.1.5}/sphinx/_build/html/_static/fonts/Lato/lato-bold.woff +0 -0
- {flamo-0.1.3 → flamo-0.1.5}/sphinx/_build/html/_static/fonts/Lato/lato-bold.woff2 +0 -0
- {flamo-0.1.3 → flamo-0.1.5}/sphinx/_build/html/_static/fonts/Lato/lato-bolditalic.eot +0 -0
- {flamo-0.1.3 → flamo-0.1.5}/sphinx/_build/html/_static/fonts/Lato/lato-bolditalic.ttf +0 -0
- {flamo-0.1.3 → flamo-0.1.5}/sphinx/_build/html/_static/fonts/Lato/lato-bolditalic.woff +0 -0
- {flamo-0.1.3 → flamo-0.1.5}/sphinx/_build/html/_static/fonts/Lato/lato-bolditalic.woff2 +0 -0
- {flamo-0.1.3 → flamo-0.1.5}/sphinx/_build/html/_static/fonts/Lato/lato-italic.eot +0 -0
- {flamo-0.1.3 → flamo-0.1.5}/sphinx/_build/html/_static/fonts/Lato/lato-italic.ttf +0 -0
- {flamo-0.1.3 → flamo-0.1.5}/sphinx/_build/html/_static/fonts/Lato/lato-italic.woff +0 -0
- {flamo-0.1.3 → flamo-0.1.5}/sphinx/_build/html/_static/fonts/Lato/lato-italic.woff2 +0 -0
- {flamo-0.1.3 → flamo-0.1.5}/sphinx/_build/html/_static/fonts/Lato/lato-regular.eot +0 -0
- {flamo-0.1.3 → flamo-0.1.5}/sphinx/_build/html/_static/fonts/Lato/lato-regular.ttf +0 -0
- {flamo-0.1.3 → flamo-0.1.5}/sphinx/_build/html/_static/fonts/Lato/lato-regular.woff +0 -0
- {flamo-0.1.3 → flamo-0.1.5}/sphinx/_build/html/_static/fonts/Lato/lato-regular.woff2 +0 -0
- {flamo-0.1.3 → flamo-0.1.5}/sphinx/_build/html/_static/fonts/RobotoSlab/roboto-slab-v7-bold.eot +0 -0
- {flamo-0.1.3 → flamo-0.1.5}/sphinx/_build/html/_static/fonts/RobotoSlab/roboto-slab-v7-bold.ttf +0 -0
- {flamo-0.1.3 → flamo-0.1.5}/sphinx/_build/html/_static/fonts/RobotoSlab/roboto-slab-v7-bold.woff +0 -0
- {flamo-0.1.3 → flamo-0.1.5}/sphinx/_build/html/_static/fonts/RobotoSlab/roboto-slab-v7-bold.woff2 +0 -0
- {flamo-0.1.3 → flamo-0.1.5}/sphinx/_build/html/_static/fonts/RobotoSlab/roboto-slab-v7-regular.eot +0 -0
- {flamo-0.1.3 → flamo-0.1.5}/sphinx/_build/html/_static/fonts/RobotoSlab/roboto-slab-v7-regular.ttf +0 -0
- {flamo-0.1.3 → flamo-0.1.5}/sphinx/_build/html/_static/fonts/RobotoSlab/roboto-slab-v7-regular.woff +0 -0
- {flamo-0.1.3 → flamo-0.1.5}/sphinx/_build/html/_static/fonts/RobotoSlab/roboto-slab-v7-regular.woff2 +0 -0
- {flamo-0.1.3 → flamo-0.1.5}/sphinx/_build/html/_static/github-banner.svg +0 -0
- {flamo-0.1.3 → flamo-0.1.5}/sphinx/_build/html/_static/jquery.js +0 -0
- {flamo-0.1.3 → flamo-0.1.5}/sphinx/_build/html/_static/js/badge_only.js +0 -0
- {flamo-0.1.3 → flamo-0.1.5}/sphinx/_build/html/_static/js/theme.js +0 -0
- {flamo-0.1.3 → flamo-0.1.5}/sphinx/_build/html/_static/js/versions.js +0 -0
- {flamo-0.1.3 → flamo-0.1.5}/sphinx/_build/html/_static/language_data.js +0 -0
- {flamo-0.1.3 → flamo-0.1.5}/sphinx/_build/html/_static/minus.png +0 -0
- {flamo-0.1.3 → flamo-0.1.5}/sphinx/_build/html/_static/plus.png +0 -0
- {flamo-0.1.3 → flamo-0.1.5}/sphinx/_build/html/_static/pygments.css +0 -0
- {flamo-0.1.3 → flamo-0.1.5}/sphinx/_build/html/_static/scripts/bootstrap.js +0 -0
- {flamo-0.1.3 → flamo-0.1.5}/sphinx/_build/html/_static/scripts/bootstrap.js.LICENSE.txt +0 -0
- {flamo-0.1.3 → flamo-0.1.5}/sphinx/_build/html/_static/scripts/bootstrap.js.map +0 -0
- {flamo-0.1.3 → flamo-0.1.5}/sphinx/_build/html/_static/scripts/fontawesome.js +0 -0
- {flamo-0.1.3 → flamo-0.1.5}/sphinx/_build/html/_static/scripts/fontawesome.js.LICENSE.txt +0 -0
- {flamo-0.1.3 → flamo-0.1.5}/sphinx/_build/html/_static/scripts/fontawesome.js.map +0 -0
- {flamo-0.1.3 → flamo-0.1.5}/sphinx/_build/html/_static/scripts/pydata-sphinx-theme.js +0 -0
- {flamo-0.1.3 → flamo-0.1.5}/sphinx/_build/html/_static/scripts/pydata-sphinx-theme.js.map +0 -0
- {flamo-0.1.3 → flamo-0.1.5}/sphinx/_build/html/_static/searchtools.js +0 -0
- {flamo-0.1.3 → flamo-0.1.5}/sphinx/_build/html/_static/sphinx_highlight.js +0 -0
- {flamo-0.1.3 → flamo-0.1.5}/sphinx/_build/html/_static/styles/pydata-sphinx-theme.css +0 -0
- {flamo-0.1.3 → flamo-0.1.5}/sphinx/_build/html/_static/styles/pydata-sphinx-theme.css.map +0 -0
- {flamo-0.1.3 → flamo-0.1.5}/sphinx/_build/html/_static/styles/theme.css +0 -0
- {flamo-0.1.3 → flamo-0.1.5}/sphinx/_build/html/_static/vendor/fontawesome/webfonts/fa-brands-400.ttf +0 -0
- {flamo-0.1.3 → flamo-0.1.5}/sphinx/_build/html/_static/vendor/fontawesome/webfonts/fa-brands-400.woff2 +0 -0
- {flamo-0.1.3 → flamo-0.1.5}/sphinx/_build/html/_static/vendor/fontawesome/webfonts/fa-regular-400.ttf +0 -0
- {flamo-0.1.3 → flamo-0.1.5}/sphinx/_build/html/_static/vendor/fontawesome/webfonts/fa-regular-400.woff2 +0 -0
- {flamo-0.1.3 → flamo-0.1.5}/sphinx/_build/html/_static/vendor/fontawesome/webfonts/fa-solid-900.ttf +0 -0
- {flamo-0.1.3 → flamo-0.1.5}/sphinx/_build/html/_static/vendor/fontawesome/webfonts/fa-solid-900.woff2 +0 -0
- {flamo-0.1.3 → flamo-0.1.5}/sphinx/_build/html/_static/webpack-macros.html +0 -0
- {flamo-0.1.3 → flamo-0.1.5}/sphinx/_build/html/auxiliary/eq.html +0 -0
- {flamo-0.1.3 → flamo-0.1.5}/sphinx/_build/html/auxiliary/filterbank.html +0 -0
- {flamo-0.1.3 → flamo-0.1.5}/sphinx/_build/html/auxiliary/minimize.html +0 -0
- {flamo-0.1.3 → flamo-0.1.5}/sphinx/_build/html/auxiliary/reverb.html +0 -0
- {flamo-0.1.3 → flamo-0.1.5}/sphinx/_build/html/auxiliary/scattering.html +0 -0
- {flamo-0.1.3 → flamo-0.1.5}/sphinx/_build/html/functional.html +0 -0
- {flamo-0.1.3 → flamo-0.1.5}/sphinx/_build/html/genindex.html +0 -0
- {flamo-0.1.3 → flamo-0.1.5}/sphinx/_build/html/index.html +0 -0
- {flamo-0.1.3 → flamo-0.1.5}/sphinx/_build/html/objects.inv +0 -0
- {flamo-0.1.3 → flamo-0.1.5}/sphinx/_build/html/optimize/dataset.html +0 -0
- {flamo-0.1.3 → flamo-0.1.5}/sphinx/_build/html/optimize/loss.html +0 -0
- {flamo-0.1.3 → flamo-0.1.5}/sphinx/_build/html/optimize/trainer.html +0 -0
- {flamo-0.1.3 → flamo-0.1.5}/sphinx/_build/html/optimize/utils.html +0 -0
- {flamo-0.1.3 → flamo-0.1.5}/sphinx/_build/html/processor/dsp.html +0 -0
- {flamo-0.1.3 → flamo-0.1.5}/sphinx/_build/html/processor/system.html +0 -0
- {flamo-0.1.3 → flamo-0.1.5}/sphinx/_build/html/search.html +0 -0
- {flamo-0.1.3 → flamo-0.1.5}/sphinx/_build/html/searchindex.js +0 -0
- {flamo-0.1.3 → flamo-0.1.5}/sphinx/auxiliary/eq.rst +0 -0
- {flamo-0.1.3 → flamo-0.1.5}/sphinx/auxiliary/filterbank.rst +0 -0
- {flamo-0.1.3 → flamo-0.1.5}/sphinx/auxiliary/minimize.rst +0 -0
- {flamo-0.1.3 → flamo-0.1.5}/sphinx/auxiliary/reverb.rst +0 -0
- {flamo-0.1.3 → flamo-0.1.5}/sphinx/auxiliary/scattering.rst +0 -0
- {flamo-0.1.3 → flamo-0.1.5}/sphinx/conf.py +0 -0
- {flamo-0.1.3 → flamo-0.1.5}/sphinx/functional.rst +0 -0
- {flamo-0.1.3 → flamo-0.1.5}/sphinx/index.rst +0 -0
- {flamo-0.1.3 → flamo-0.1.5}/sphinx/make.bat +0 -0
- {flamo-0.1.3 → flamo-0.1.5}/sphinx/optimize/dataset.rst +0 -0
- {flamo-0.1.3 → flamo-0.1.5}/sphinx/optimize/loss.rst +0 -0
- {flamo-0.1.3 → flamo-0.1.5}/sphinx/optimize/trainer.rst +0 -0
- {flamo-0.1.3 → flamo-0.1.5}/sphinx/optimize/utils.rst +0 -0
- {flamo-0.1.3 → flamo-0.1.5}/sphinx/processor/dsp.rst +0 -0
- {flamo-0.1.3 → flamo-0.1.5}/sphinx/processor/system.rst +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: flamo
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.5
|
|
4
4
|
Summary: An Open-Source Library for Frequency-Domain Differentiable Audio Processing
|
|
5
5
|
Project-URL: Homepage, https://github.com/gdalsanto/flamo
|
|
6
6
|
Project-URL: Issues, https://github.com/gdalsanto/flamo/issues
|
|
@@ -38,6 +38,7 @@ Requires-Dist: numpy
|
|
|
38
38
|
Requires-Dist: pydantic
|
|
39
39
|
Requires-Dist: pyfar
|
|
40
40
|
Requires-Dist: pysoundfile
|
|
41
|
+
Requires-Dist: pyyaml
|
|
41
42
|
Requires-Dist: scipy
|
|
42
43
|
Requires-Dist: torch
|
|
43
44
|
Requires-Dist: torchaudio
|
|
@@ -19,6 +19,65 @@ from flamo.optimize.trainer import Trainer
|
|
|
19
19
|
|
|
20
20
|
torch.manual_seed(1)
|
|
21
21
|
|
|
22
|
+
def example_matrix(args) -> None:
|
|
23
|
+
"""
|
|
24
|
+
Test all the different types of matrices available in dsp.Matrix.
|
|
25
|
+
We will create different matrix types and apply them to a multi-channel input signal.
|
|
26
|
+
"""
|
|
27
|
+
# ------------------- Signal Definition --------------------
|
|
28
|
+
in_ch = 4
|
|
29
|
+
out_ch = 4
|
|
30
|
+
|
|
31
|
+
# Input signal - multi-channel noise
|
|
32
|
+
input_sig = signal_gallery(
|
|
33
|
+
signal_type="noise",
|
|
34
|
+
batch_size=1,
|
|
35
|
+
n_samples=args.nfft,
|
|
36
|
+
n=in_ch,
|
|
37
|
+
fs=args.samplerate,
|
|
38
|
+
device=args.device,
|
|
39
|
+
)
|
|
40
|
+
|
|
41
|
+
# Test different matrix types
|
|
42
|
+
matrix_types = ["random", "identity", "orthogonal", "hadamard", "rotation"]
|
|
43
|
+
|
|
44
|
+
fig, axes = plt.subplots(len(matrix_types), out_ch, figsize=(12, 2*len(matrix_types)))
|
|
45
|
+
if len(matrix_types) == 1:
|
|
46
|
+
axes = axes.reshape(1, -1)
|
|
47
|
+
|
|
48
|
+
for i, matrix_type in enumerate(matrix_types):
|
|
49
|
+
print(f"Testing matrix type: {matrix_type}")
|
|
50
|
+
|
|
51
|
+
# ------------------- DSP Definition --------------------
|
|
52
|
+
matrix_filter = dsp.Matrix(
|
|
53
|
+
size=(out_ch, in_ch),
|
|
54
|
+
matrix_type=matrix_type,
|
|
55
|
+
nfft=args.nfft,
|
|
56
|
+
device=args.device,
|
|
57
|
+
)
|
|
58
|
+
|
|
59
|
+
input_layer = dsp.FFT(nfft=args.nfft)
|
|
60
|
+
output_layer = dsp.iFFT(nfft=args.nfft)
|
|
61
|
+
|
|
62
|
+
my_dsp = nn.Sequential(input_layer, matrix_filter, output_layer)
|
|
63
|
+
|
|
64
|
+
# -------------- Apply signal to DSP --------------
|
|
65
|
+
output_sig = my_dsp(input_sig)
|
|
66
|
+
|
|
67
|
+
# ----------------------- Plot ------------------------
|
|
68
|
+
for j in range(out_ch):
|
|
69
|
+
ax = axes[i, j] if out_ch > 1 else axes[i]
|
|
70
|
+
ax.plot(output_sig.squeeze()[:1000, j].cpu().numpy()) # Plot first 1000 samples
|
|
71
|
+
ax.set_xlabel("Samples")
|
|
72
|
+
ax.set_ylabel("Amplitude")
|
|
73
|
+
ax.grid(True)
|
|
74
|
+
ax.set_title(f"{matrix_type.capitalize()} Matrix - Output Ch {j+1}")
|
|
75
|
+
|
|
76
|
+
plt.tight_layout()
|
|
77
|
+
plt.show()
|
|
78
|
+
|
|
79
|
+
return None
|
|
80
|
+
|
|
22
81
|
|
|
23
82
|
def example_delays(args) -> None:
|
|
24
83
|
"""
|
|
@@ -239,5 +298,6 @@ if __name__ == "__main__":
|
|
|
239
298
|
)
|
|
240
299
|
|
|
241
300
|
# Run examples
|
|
301
|
+
example_matrix(args)
|
|
242
302
|
example_delays(args)
|
|
243
303
|
example_biquads(args)
|
|
@@ -26,8 +26,8 @@ def example_fdn(args):
|
|
|
26
26
|
|
|
27
27
|
# FDN parameters
|
|
28
28
|
N = 6 # number of delays
|
|
29
|
-
alias_decay_db =
|
|
30
|
-
delay_lengths = torch.tensor([
|
|
29
|
+
alias_decay_db = 30 # alias decay in dB
|
|
30
|
+
delay_lengths = torch.tensor([887, 911, 941, 1699, 1951, 2053])
|
|
31
31
|
|
|
32
32
|
## ---------------- CONSTRUCT FDN ---------------- ##
|
|
33
33
|
|
|
@@ -35,19 +35,17 @@ def example_fdn(args):
|
|
|
35
35
|
input_gain = dsp.Gain(
|
|
36
36
|
size=(N, 1),
|
|
37
37
|
nfft=args.nfft,
|
|
38
|
-
requires_grad=
|
|
38
|
+
requires_grad=True,
|
|
39
39
|
alias_decay_db=alias_decay_db,
|
|
40
40
|
device=args.device,
|
|
41
41
|
)
|
|
42
|
-
input_gain.assign_value(torch.ones((N, 1), device=args.device) / torch.tensor(N))
|
|
43
42
|
output_gain = dsp.Gain(
|
|
44
43
|
size=(1, N),
|
|
45
44
|
nfft=args.nfft,
|
|
46
|
-
requires_grad=
|
|
45
|
+
requires_grad=True,
|
|
47
46
|
alias_decay_db=alias_decay_db,
|
|
48
47
|
device=args.device,
|
|
49
48
|
)
|
|
50
|
-
output_gain.assign_value(torch.ones((1, N), device=args.device) )
|
|
51
49
|
# Feedback loop with delays
|
|
52
50
|
delays = dsp.parallelDelay(
|
|
53
51
|
size=(N,),
|
|
@@ -60,7 +58,7 @@ def example_fdn(args):
|
|
|
60
58
|
)
|
|
61
59
|
delays.assign_value(delays.sample2s(delay_lengths))
|
|
62
60
|
# Feedback path with orthogonal matrix
|
|
63
|
-
|
|
61
|
+
feedback = dsp.Matrix(
|
|
64
62
|
size=(N, N),
|
|
65
63
|
nfft=args.nfft,
|
|
66
64
|
matrix_type="orthogonal",
|
|
@@ -68,16 +66,6 @@ def example_fdn(args):
|
|
|
68
66
|
alias_decay_db=alias_decay_db,
|
|
69
67
|
device=args.device,
|
|
70
68
|
)
|
|
71
|
-
attenuation = dsp.parallelGain(
|
|
72
|
-
size=(N,),
|
|
73
|
-
nfft=args.nfft,
|
|
74
|
-
requires_grad=False,
|
|
75
|
-
alias_decay_db=alias_decay_db,
|
|
76
|
-
device=args.device,
|
|
77
|
-
)
|
|
78
|
-
attenuation.map = map_gamma(delay_lengths)
|
|
79
|
-
gamma = 6
|
|
80
|
-
attenuation.assign_value(gamma * torch.ones((N,), device=args.device,))
|
|
81
69
|
|
|
82
70
|
# # Feedback path with scattering matrix
|
|
83
71
|
# m_L = torch.randint(low=1, high=int(torch.floor(min(delay_lengths)/2)), size=[N])
|
|
@@ -93,14 +81,6 @@ def example_fdn(args):
|
|
|
93
81
|
# requires_grad=True,
|
|
94
82
|
# device=args.device,
|
|
95
83
|
# )
|
|
96
|
-
feedback = system.Series(
|
|
97
|
-
OrderedDict(
|
|
98
|
-
{
|
|
99
|
-
"attenuation": attenuation,
|
|
100
|
-
"mixing_matrix": mixing_matrix,
|
|
101
|
-
}
|
|
102
|
-
)
|
|
103
|
-
)
|
|
104
84
|
|
|
105
85
|
# Recursion
|
|
106
86
|
feedback_loop = system.Recursion(fF=delays, fB=feedback)
|
|
@@ -118,42 +98,9 @@ def example_fdn(args):
|
|
|
118
98
|
|
|
119
99
|
# Create the model with Shell
|
|
120
100
|
input_layer = dsp.FFT(args.nfft)
|
|
121
|
-
output_layer = dsp.
|
|
101
|
+
output_layer = dsp.Transform(transform=lambda x: torch.abs(x))
|
|
122
102
|
model = system.Shell(core=FDN, input_layer=input_layer, output_layer=output_layer)
|
|
123
103
|
|
|
124
|
-
ir_init = model.get_time_response(identity=False, fs=args.samplerate)
|
|
125
|
-
|
|
126
|
-
time_axis = torch.arange(0, args.nfft) / args.samplerate
|
|
127
|
-
|
|
128
|
-
out = torch.flip(ir_init, dims=[1])
|
|
129
|
-
out = torch.cumsum(out**2, dim=1)
|
|
130
|
-
out = torch.flip(out, dims=[1])
|
|
131
|
-
|
|
132
|
-
# Normalize to 1
|
|
133
|
-
norm_vals = torch.max(out, dim=1, keepdim=True)[0] # per channel
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
edc = out / norm_vals
|
|
137
|
-
|
|
138
|
-
core = model.get_core()
|
|
139
|
-
|
|
140
|
-
# generate a decaying sinusoid
|
|
141
|
-
sine = torch.sin(
|
|
142
|
-
2 * torch.pi * 1000 * time_axis
|
|
143
|
-
) * torch.exp(-time_axis / 0.01) # 1000 Hz, decay time of 0.1 seconds
|
|
144
|
-
sine = sine.unsqueeze(0).unsqueeze(-1) # add batch and channel dimensions
|
|
145
|
-
|
|
146
|
-
out = torch.flip(model(sine), dims=[1])
|
|
147
|
-
out = torch.cumsum(out**2, dim=1)
|
|
148
|
-
out = torch.flip(out, dims=[1])
|
|
149
|
-
|
|
150
|
-
# Normalize to 1
|
|
151
|
-
norm_vals = torch.max(out, dim=1, keepdim=True)[0] # per channel
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
edc_sine = out / norm_vals
|
|
155
|
-
|
|
156
|
-
|
|
157
104
|
# Get initial impulse response
|
|
158
105
|
with torch.no_grad():
|
|
159
106
|
ir_init = model.get_time_response(identity=False, fs=args.samplerate).squeeze()
|
|
@@ -218,7 +165,7 @@ def save_fdn_params(net, filename="parameters"):
|
|
|
218
165
|
|
|
219
166
|
core = net.get_core()
|
|
220
167
|
param = {}
|
|
221
|
-
param["A"] = core.feedback_loop.feedback.
|
|
168
|
+
param["A"] = core.feedback_loop.feedback.param.squeeze().detach().cpu().numpy()
|
|
222
169
|
param["B"] = core.input_gain.param.squeeze().detach().cpu().numpy()
|
|
223
170
|
param["C"] = core.output_gain.param.squeeze().detach().cpu().numpy()
|
|
224
171
|
param["m"] = (
|
|
@@ -236,20 +183,6 @@ def save_fdn_params(net, filename="parameters"):
|
|
|
236
183
|
return param
|
|
237
184
|
|
|
238
185
|
|
|
239
|
-
class map_gamma(torch.nn.Module):
|
|
240
|
-
|
|
241
|
-
def __init__(self, delays):
|
|
242
|
-
super().__init__()
|
|
243
|
-
self.delays = delays.double()
|
|
244
|
-
self.g_min = torch.tensor(0.99, dtype=torch.double, device=delays.device)
|
|
245
|
-
self.g_max = torch.tensor(1, dtype=torch.double, device=delays.device)
|
|
246
|
-
|
|
247
|
-
def forward(self, x):
|
|
248
|
-
return (
|
|
249
|
-
((1 / (1 + torch.exp(-x[0]))) * (self.g_max - self.g_min) + self.g_min)
|
|
250
|
-
** self.delays
|
|
251
|
-
).type_as(x)
|
|
252
|
-
|
|
253
186
|
if __name__ == "__main__":
|
|
254
187
|
|
|
255
188
|
parser = argparse.ArgumentParser()
|
|
@@ -6,7 +6,7 @@ import argparse
|
|
|
6
6
|
import yaml
|
|
7
7
|
from flamo.auxiliary.reverb import HomogeneousFDN, map_gamma, inverse_map_gamma
|
|
8
8
|
from flamo.auxiliary.config.config import HomogeneousFDNConfig
|
|
9
|
-
from flamo.optimize.loss import mse_loss
|
|
9
|
+
from flamo.optimize.loss import mse_loss, mel_mss_loss
|
|
10
10
|
from flamo.optimize.surface import LossProfile, LossConfig, ParameterConfig, LossSurface
|
|
11
11
|
from flamo.functional import signal_gallery, get_magnitude
|
|
12
12
|
|
|
@@ -59,7 +59,7 @@ def example_loss_profile(args):
|
|
|
59
59
|
|
|
60
60
|
loss_profile = LossProfile(FDN.model, loss_config)
|
|
61
61
|
loss = loss_profile.compute_loss(input_signal, target_signal)
|
|
62
|
-
loss_profile.plot_loss(loss
|
|
62
|
+
loss_profile.plot_loss(loss)
|
|
63
63
|
|
|
64
64
|
|
|
65
65
|
def example_loss_surface(args):
|
|
@@ -103,7 +103,7 @@ def example_loss_surface(args):
|
|
|
103
103
|
|
|
104
104
|
# define config structures
|
|
105
105
|
loss_config = LossConfig(
|
|
106
|
-
criteria=[mse_loss(),
|
|
106
|
+
criteria=[mse_loss(), mel_mss_loss()],
|
|
107
107
|
param_config=[attenuation_config, input_gain_config],
|
|
108
108
|
# perturb_param=None,#"output_gain",
|
|
109
109
|
perturb_map=lambda x: x,
|
|
@@ -124,7 +124,7 @@ def example_loss_surface(args):
|
|
|
124
124
|
|
|
125
125
|
loss_profile = LossSurface(FDN.model, loss_config)
|
|
126
126
|
loss = loss_profile.compute_loss(input_signal, target_signal)
|
|
127
|
-
loss_profile.plot_loss(loss
|
|
127
|
+
loss_profile.plot_loss(loss)
|
|
128
128
|
|
|
129
129
|
if __name__ == "__main__":
|
|
130
130
|
|
|
@@ -86,7 +86,8 @@ def geq(
|
|
|
86
86
|
|
|
87
87
|
for band in range(num_bands):
|
|
88
88
|
if band == 0:
|
|
89
|
-
b = torch.
|
|
89
|
+
b = torch.zeros(3, device=device)
|
|
90
|
+
b[0] = db2mag(gain_db[band])
|
|
90
91
|
a = torch.tensor([1, 0, 0], device=device)
|
|
91
92
|
elif band == 1:
|
|
92
93
|
b, a = shelving_filter(
|
|
@@ -129,7 +129,7 @@ class HomogeneousFDN:
|
|
|
129
129
|
size=(self.N,),
|
|
130
130
|
max_len=delay_lines.max(),
|
|
131
131
|
nfft=self.config_dict.nfft,
|
|
132
|
-
isint=
|
|
132
|
+
isint=self.config_dict.is_delay_int,
|
|
133
133
|
requires_grad=self.config_dict.delays_grad,
|
|
134
134
|
alias_decay_db=self.config_dict.alias_decay_db,
|
|
135
135
|
device=self.config_dict.device,
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import torch
|
|
2
|
+
import torch.nn as nn
|
|
2
3
|
import numpy as np
|
|
3
4
|
import scipy.signal
|
|
5
|
+
from typing import Optional
|
|
4
6
|
from flamo.utils import RegularGridInterpolator
|
|
5
7
|
|
|
6
8
|
|
|
@@ -69,6 +71,68 @@ def get_frequency_samples(num: int, device: str | torch.device = None):
|
|
|
69
71
|
return torch.polar(abs, angle * np.pi)
|
|
70
72
|
|
|
71
73
|
|
|
74
|
+
class HadamardMatrix(nn.Module):
|
|
75
|
+
"""
|
|
76
|
+
Generate a Hadamard matrix of size N as a nn.Module.
|
|
77
|
+
"""
|
|
78
|
+
|
|
79
|
+
def __init__(self, N, device: Optional[str] = None):
|
|
80
|
+
super().__init__()
|
|
81
|
+
self.N = N
|
|
82
|
+
self.device = device
|
|
83
|
+
|
|
84
|
+
def forward(self, x):
|
|
85
|
+
U = torch.tensor([[1.0]], device=self.device)
|
|
86
|
+
while U.shape[0] < self.N:
|
|
87
|
+
U = torch.kron(
|
|
88
|
+
U, torch.tensor([[1, 1], [1, -1]], dtype=U.dtype, device=U.device)
|
|
89
|
+
) / torch.sqrt(torch.tensor(2.0, device=U.device))
|
|
90
|
+
return U
|
|
91
|
+
|
|
92
|
+
|
|
93
|
+
class RotationMatrix(nn.Module):
|
|
94
|
+
"""
|
|
95
|
+
Generate a rotation matrix of size N as a nn.Module from a given angle.
|
|
96
|
+
"""
|
|
97
|
+
|
|
98
|
+
def __init__(
|
|
99
|
+
self,
|
|
100
|
+
N: int,
|
|
101
|
+
min_angle: float = 0,
|
|
102
|
+
max_angle: float = torch.pi / 4,
|
|
103
|
+
iter: Optional[int] = None,
|
|
104
|
+
device: Optional[str] = None,
|
|
105
|
+
):
|
|
106
|
+
|
|
107
|
+
super().__init__()
|
|
108
|
+
self.N = N
|
|
109
|
+
self.min_angle = min_angle
|
|
110
|
+
self.max_angle = max_angle
|
|
111
|
+
self.iter = iter
|
|
112
|
+
self.device = device
|
|
113
|
+
|
|
114
|
+
def create_submatrix(self, angles: torch.Tensor, iters: int = 1):
|
|
115
|
+
"""Create a submatrix for each group."""
|
|
116
|
+
X = torch.zeros(2, 2, device=self.device)
|
|
117
|
+
angles[0] = torch.clamp(angles[0], self.min_angle, self.max_angle)
|
|
118
|
+
X.fill_diagonal_(torch.cos(angles[0]))
|
|
119
|
+
X[1, 0] = -torch.sin(torch.tensor(angles[0], device=self.device))
|
|
120
|
+
X[0, 1] = torch.sin(torch.tensor(angles[0], device=self.device))
|
|
121
|
+
|
|
122
|
+
if iters is None:
|
|
123
|
+
iters = torch.log2(torch.tensor(self.N)).int().item() - 1
|
|
124
|
+
for i in range(iters):
|
|
125
|
+
if len(angles) > 1:
|
|
126
|
+
X = torch.kron(X, self.create_submatrix([angles[i]]))
|
|
127
|
+
else:
|
|
128
|
+
X = torch.kron(X, X)
|
|
129
|
+
return X
|
|
130
|
+
|
|
131
|
+
def forward(self, theta):
|
|
132
|
+
|
|
133
|
+
return self.create_submatrix(theta, self.iter)
|
|
134
|
+
|
|
135
|
+
|
|
72
136
|
def biquad2tf(b: torch.Tensor, a: torch.Tensor, nfft: int):
|
|
73
137
|
r"""
|
|
74
138
|
Converts a biquad filter representation to a transfer function.
|
|
@@ -133,10 +197,11 @@ def signal_gallery(
|
|
|
133
197
|
"wgn",
|
|
134
198
|
"exp",
|
|
135
199
|
"reference",
|
|
200
|
+
"noise",
|
|
136
201
|
}
|
|
137
202
|
|
|
138
203
|
if signal_type not in signal_types:
|
|
139
|
-
raise ValueError(f"
|
|
204
|
+
raise ValueError(f"Signal type {signal_type} not recognized.")
|
|
140
205
|
match signal_type:
|
|
141
206
|
case "impulse":
|
|
142
207
|
x = torch.zeros(batch_size, n_samples, n)
|
|
@@ -185,6 +250,8 @@ def signal_gallery(
|
|
|
185
250
|
return torch.tensor(reference, device=device).expand(
|
|
186
251
|
batch_size, n_samples, n
|
|
187
252
|
)
|
|
253
|
+
case "noise":
|
|
254
|
+
return torch.randn((batch_size, n_samples, n), device=device)
|
|
188
255
|
|
|
189
256
|
|
|
190
257
|
def hertz2rad(hertz: torch.Tensor, fs: int):
|
|
@@ -38,7 +38,7 @@ class sparsity_loss(nn.Module):
|
|
|
38
38
|
A = core.feedback_loop.feedback.map(core.feedback_loop.feedback.param)
|
|
39
39
|
except:
|
|
40
40
|
try:
|
|
41
|
-
A = core.feedback_loop.feedback.map(
|
|
41
|
+
A = core.feedback_loop.feedback.mixing_matrix.map(
|
|
42
42
|
core.feedback_loop.feedback.mixing_matrix.param
|
|
43
43
|
)
|
|
44
44
|
except:
|
|
@@ -77,6 +77,7 @@ class mse_loss(nn.Module):
|
|
|
77
77
|
self.nfft = nfft
|
|
78
78
|
self.device = device
|
|
79
79
|
self.mse_loss = nn.MSELoss()
|
|
80
|
+
self.name = "MSE"
|
|
80
81
|
|
|
81
82
|
def forward(self, y_pred, y_true):
|
|
82
83
|
"""
|
|
@@ -8,7 +8,9 @@ from flamo.functional import (
|
|
|
8
8
|
lowpass_filter,
|
|
9
9
|
highpass_filter,
|
|
10
10
|
bandpass_filter,
|
|
11
|
-
rad2hertz
|
|
11
|
+
rad2hertz,
|
|
12
|
+
HadamardMatrix,
|
|
13
|
+
RotationMatrix)
|
|
12
14
|
from flamo.auxiliary.eq import (
|
|
13
15
|
eq_freqs,
|
|
14
16
|
geq,
|
|
@@ -535,11 +537,13 @@ class Matrix(Gain):
|
|
|
535
537
|
nfft: int = 2**11,
|
|
536
538
|
map: callable = lambda x: x,
|
|
537
539
|
matrix_type: str = "random",
|
|
540
|
+
iter: int = 1,
|
|
538
541
|
requires_grad: bool = False,
|
|
539
542
|
alias_decay_db: float = 0.0,
|
|
540
543
|
device: Optional[str] = None,
|
|
541
544
|
):
|
|
542
545
|
self.matrix_type = matrix_type
|
|
546
|
+
self.iter = iter # iterations number for the rotation matrix
|
|
543
547
|
super().__init__(
|
|
544
548
|
size=size,
|
|
545
549
|
nfft=nfft,
|
|
@@ -557,14 +561,31 @@ class Matrix(Gain):
|
|
|
557
561
|
Warning(
|
|
558
562
|
f"you asked for {self.matrix_type} matrix type, map will be overwritten"
|
|
559
563
|
)
|
|
564
|
+
N = self.size[0]
|
|
560
565
|
match self.matrix_type:
|
|
561
566
|
case "random":
|
|
562
567
|
self.map = lambda x: x
|
|
563
568
|
case "orthogonal":
|
|
564
569
|
assert (
|
|
565
|
-
|
|
570
|
+
N == self.size[1]
|
|
566
571
|
), "Matrix must be square to be orthogonal"
|
|
567
572
|
self.map = lambda x: torch.matrix_exp(skew_matrix(x))
|
|
573
|
+
case "hadamard":
|
|
574
|
+
assert (
|
|
575
|
+
N == self.size[1]
|
|
576
|
+
), "Matrix must be square to be Hadamard"
|
|
577
|
+
assert (
|
|
578
|
+
N % 2 == 0
|
|
579
|
+
), "Matrix must have even dimensions to be Hadamard"
|
|
580
|
+
self.map = lambda x: HadamardMatrix(self.size[0], device=self.device)(x)
|
|
581
|
+
case "rotation":
|
|
582
|
+
assert (
|
|
583
|
+
N == self.size[1]
|
|
584
|
+
), "Matrix must be square to be a rotation matrix"
|
|
585
|
+
assert (
|
|
586
|
+
N % 2 == 0
|
|
587
|
+
), "Matrix must have even dimensions to be a rotation matrix"
|
|
588
|
+
self.map = lambda x: RotationMatrix(self.size[0], self.iter, device=self.device)([x[0][0]])
|
|
568
589
|
|
|
569
590
|
def initialize_class(self):
|
|
570
591
|
r"""
|
|
@@ -2722,7 +2743,7 @@ class Delay(DSP):
|
|
|
2722
2743
|
"""
|
|
2723
2744
|
m = self.get_delays()
|
|
2724
2745
|
if self.isint:
|
|
2725
|
-
self.freq_response = lambda param: (self.gamma ** m(param)) * torch.exp(
|
|
2746
|
+
self.freq_response = lambda param: (self.gamma ** m(param).round()) * torch.exp(
|
|
2726
2747
|
-1j
|
|
2727
2748
|
* torch.einsum(
|
|
2728
2749
|
"fo, omn -> fmn",
|
|
@@ -2859,14 +2880,24 @@ class parallelDelay(Delay):
|
|
|
2859
2880
|
Computes the frequency response of the delay module.
|
|
2860
2881
|
"""
|
|
2861
2882
|
m = self.get_delays()
|
|
2862
|
-
self.
|
|
2863
|
-
|
|
2864
|
-
|
|
2865
|
-
|
|
2866
|
-
|
|
2867
|
-
|
|
2883
|
+
if self.isint:
|
|
2884
|
+
self.freq_response = lambda param: (self.gamma ** m(param).round()) * torch.exp(
|
|
2885
|
+
-1j
|
|
2886
|
+
* torch.einsum(
|
|
2887
|
+
"fo, on -> fn",
|
|
2888
|
+
self.omega,
|
|
2889
|
+
m(param).round().unsqueeze(0),
|
|
2890
|
+
)
|
|
2891
|
+
)
|
|
2892
|
+
else:
|
|
2893
|
+
self.freq_response = lambda param: (self.gamma ** m(param)) * torch.exp(
|
|
2894
|
+
-1j
|
|
2895
|
+
* torch.einsum(
|
|
2896
|
+
"fo, on -> fn",
|
|
2897
|
+
self.omega,
|
|
2898
|
+
m(param).unsqueeze(0),
|
|
2899
|
+
)
|
|
2868
2900
|
)
|
|
2869
|
-
)
|
|
2870
2901
|
|
|
2871
2902
|
def get_io(self):
|
|
2872
2903
|
r"""
|
|
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "flamo"
|
|
7
|
-
version = "0.1.
|
|
7
|
+
version = "0.1.5"
|
|
8
8
|
authors = [
|
|
9
9
|
{ name="Gloria Dal Santo", email="gloria.dalsanto@aalto.fi" },
|
|
10
10
|
{ name="Gian Marco De Bortoli", email="gian.debortoli@aalto.fi"},
|
|
@@ -34,6 +34,7 @@ dependencies = [
|
|
|
34
34
|
"pydantic",
|
|
35
35
|
"nnAudio",
|
|
36
36
|
"pyfar",
|
|
37
|
+
"pyyaml"
|
|
37
38
|
]
|
|
38
39
|
|
|
39
40
|
[project.urls]
|