flamo 0.1.4__tar.gz → 0.1.6__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.
Files changed (271) hide show
  1. {flamo-0.1.4 → flamo-0.1.6}/PKG-INFO +3 -2
  2. {flamo-0.1.4 → flamo-0.1.6}/README.md +1 -1
  3. flamo-0.1.6/examples/e1_vn.py +63 -0
  4. {flamo-0.1.4 → flamo-0.1.6}/examples/e8_colorless_fdn.py +7 -74
  5. {flamo-0.1.4 → flamo-0.1.6}/examples/e8_fdn.py +4 -4
  6. {flamo-0.1.4 → flamo-0.1.6}/examples/e9_loss_profile.py +4 -4
  7. {flamo-0.1.4 → flamo-0.1.6}/flamo/auxiliary/config/config.py +2 -1
  8. {flamo-0.1.4 → flamo-0.1.6}/flamo/auxiliary/eq.py +2 -1
  9. {flamo-0.1.4 → flamo-0.1.6}/flamo/auxiliary/reverb.py +1 -1
  10. {flamo-0.1.4 → flamo-0.1.6}/flamo/auxiliary/scattering.py +1 -3
  11. flamo-0.1.6/flamo/auxiliary/velvet.py +114 -0
  12. {flamo-0.1.4 → flamo-0.1.6}/flamo/optimize/loss.py +1 -0
  13. {flamo-0.1.4 → flamo-0.1.6}/flamo/processor/dsp.py +163 -12
  14. flamo-0.1.6/notebooks/e8_colorless_fdn.ipynb +333 -0
  15. {flamo-0.1.4 → flamo-0.1.6}/pyproject.toml +2 -1
  16. flamo-0.1.4/losses.py +0 -721
  17. flamo-0.1.4/notebooks/e8_colorless_fdn.ipynb +0 -550
  18. flamo-0.1.4/rirs/lrf/fdn_target_ir.wav +0 -0
  19. flamo-0.1.4/rirs/lrf/target_ir.wav +0 -0
  20. flamo-0.1.4/run.py +0 -387
  21. flamo-0.1.4/test_fdn.py +0 -437
  22. flamo-0.1.4/test_fdn_2.py +0 -466
  23. flamo-0.1.4/test_fdn_3.py +0 -399
  24. flamo-0.1.4/test_fdn_4.py +0 -465
  25. flamo-0.1.4/test_fdn_5.py +0 -407
  26. flamo-0.1.4/test_fdn_6.py +0 -423
  27. flamo-0.1.4/test_fdn_6_wgn.py +0 -424
  28. flamo-0.1.4/test_peq.py +0 -219
  29. flamo-0.1.4/test_prop_peak.py +0 -56
  30. {flamo-0.1.4 → flamo-0.1.6}/.gitignore +0 -0
  31. {flamo-0.1.4 → flamo-0.1.6}/2025_FLAMO_ICASSP_DalSantoDeBortoli_poster.pdf +0 -0
  32. {flamo-0.1.4 → flamo-0.1.6}/LICENSE +0 -0
  33. {flamo-0.1.4 → flamo-0.1.6}/examples/e0_siso.py +0 -0
  34. {flamo-0.1.4 → flamo-0.1.6}/examples/e1_mimo.py +0 -0
  35. {flamo-0.1.4 → flamo-0.1.6}/examples/e2_chaining_filters.py +0 -0
  36. {flamo-0.1.4 → flamo-0.1.6}/examples/e3_series_class.py +0 -0
  37. {flamo-0.1.4 → flamo-0.1.6}/examples/e4_recursion.py +0 -0
  38. {flamo-0.1.4 → flamo-0.1.6}/examples/e4_recursion_nn.py +0 -0
  39. {flamo-0.1.4 → flamo-0.1.6}/examples/e5_shell.py +0 -0
  40. {flamo-0.1.4 → flamo-0.1.6}/examples/e6_anti_aliasing.py +0 -0
  41. {flamo-0.1.4 → flamo-0.1.6}/examples/e7_biquad.py +0 -0
  42. {flamo-0.1.4 → flamo-0.1.6}/examples/e7_biquad_nn.py +0 -0
  43. {flamo-0.1.4 → flamo-0.1.6}/examples/e7_geq.py +0 -0
  44. {flamo-0.1.4 → flamo-0.1.6}/examples/e7_peq.py +0 -0
  45. {flamo-0.1.4 → flamo-0.1.6}/examples/e7_svf.py +0 -0
  46. {flamo-0.1.4 → flamo-0.1.6}/examples/e8_active_acoustics.py +0 -0
  47. {flamo-0.1.4 → flamo-0.1.6}/examples/e8_colorless_sfdn.py +0 -0
  48. {flamo-0.1.4 → flamo-0.1.6}/examples/run_all.py +0 -0
  49. {flamo-0.1.4 → flamo-0.1.6}/flamo/__init__.py +0 -0
  50. {flamo-0.1.4 → flamo-0.1.6}/flamo/auxiliary/__init__.py +0 -0
  51. {flamo-0.1.4 → flamo-0.1.6}/flamo/auxiliary/filterbank.py +0 -0
  52. {flamo-0.1.4 → flamo-0.1.6}/flamo/auxiliary/minimize.py +0 -0
  53. {flamo-0.1.4 → flamo-0.1.6}/flamo/functional.py +0 -0
  54. {flamo-0.1.4 → flamo-0.1.6}/flamo/optimize/__init__.py +0 -0
  55. {flamo-0.1.4 → flamo-0.1.6}/flamo/optimize/dataset.py +0 -0
  56. {flamo-0.1.4 → flamo-0.1.6}/flamo/optimize/surface.py +0 -0
  57. {flamo-0.1.4 → flamo-0.1.6}/flamo/optimize/trainer.py +0 -0
  58. {flamo-0.1.4 → flamo-0.1.6}/flamo/optimize/utils.py +0 -0
  59. {flamo-0.1.4 → flamo-0.1.6}/flamo/processor/__init__.py +0 -0
  60. {flamo-0.1.4 → flamo-0.1.6}/flamo/processor/system.py +0 -0
  61. {flamo-0.1.4 → flamo-0.1.6}/flamo/utils.py +0 -0
  62. {flamo-0.1.4 → flamo-0.1.6}/notebooks/e7_biquad.ipynb +0 -0
  63. {flamo-0.1.4 → flamo-0.1.6}/rirs/Otala-2024.05.10/mic1_speaker1.wav +0 -0
  64. {flamo-0.1.4 → flamo-0.1.6}/rirs/Otala-2024.05.10/mic1_speaker10.wav +0 -0
  65. {flamo-0.1.4 → flamo-0.1.6}/rirs/Otala-2024.05.10/mic1_speaker11.wav +0 -0
  66. {flamo-0.1.4 → flamo-0.1.6}/rirs/Otala-2024.05.10/mic1_speaker12.wav +0 -0
  67. {flamo-0.1.4 → flamo-0.1.6}/rirs/Otala-2024.05.10/mic1_speaker13.wav +0 -0
  68. {flamo-0.1.4 → flamo-0.1.6}/rirs/Otala-2024.05.10/mic1_speaker14.wav +0 -0
  69. {flamo-0.1.4 → flamo-0.1.6}/rirs/Otala-2024.05.10/mic1_speaker2.wav +0 -0
  70. {flamo-0.1.4 → flamo-0.1.6}/rirs/Otala-2024.05.10/mic1_speaker3.wav +0 -0
  71. {flamo-0.1.4 → flamo-0.1.6}/rirs/Otala-2024.05.10/mic1_speaker5.wav +0 -0
  72. {flamo-0.1.4 → flamo-0.1.6}/rirs/Otala-2024.05.10/mic1_speaker6.wav +0 -0
  73. {flamo-0.1.4 → flamo-0.1.6}/rirs/Otala-2024.05.10/mic1_speaker7.wav +0 -0
  74. {flamo-0.1.4 → flamo-0.1.6}/rirs/Otala-2024.05.10/mic1_speaker8.wav +0 -0
  75. {flamo-0.1.4 → flamo-0.1.6}/rirs/Otala-2024.05.10/mic1_speaker9.wav +0 -0
  76. {flamo-0.1.4 → flamo-0.1.6}/rirs/Otala-2024.05.10/mic2_speaker1.wav +0 -0
  77. {flamo-0.1.4 → flamo-0.1.6}/rirs/Otala-2024.05.10/mic2_speaker10.wav +0 -0
  78. {flamo-0.1.4 → flamo-0.1.6}/rirs/Otala-2024.05.10/mic2_speaker11.wav +0 -0
  79. {flamo-0.1.4 → flamo-0.1.6}/rirs/Otala-2024.05.10/mic2_speaker12.wav +0 -0
  80. {flamo-0.1.4 → flamo-0.1.6}/rirs/Otala-2024.05.10/mic2_speaker13.wav +0 -0
  81. {flamo-0.1.4 → flamo-0.1.6}/rirs/Otala-2024.05.10/mic2_speaker14.wav +0 -0
  82. {flamo-0.1.4 → flamo-0.1.6}/rirs/Otala-2024.05.10/mic2_speaker2.wav +0 -0
  83. {flamo-0.1.4 → flamo-0.1.6}/rirs/Otala-2024.05.10/mic2_speaker3.wav +0 -0
  84. {flamo-0.1.4 → flamo-0.1.6}/rirs/Otala-2024.05.10/mic2_speaker5.wav +0 -0
  85. {flamo-0.1.4 → flamo-0.1.6}/rirs/Otala-2024.05.10/mic2_speaker6.wav +0 -0
  86. {flamo-0.1.4 → flamo-0.1.6}/rirs/Otala-2024.05.10/mic2_speaker7.wav +0 -0
  87. {flamo-0.1.4 → flamo-0.1.6}/rirs/Otala-2024.05.10/mic2_speaker8.wav +0 -0
  88. {flamo-0.1.4 → flamo-0.1.6}/rirs/Otala-2024.05.10/mic2_speaker9.wav +0 -0
  89. {flamo-0.1.4 → flamo-0.1.6}/rirs/Otala-2024.05.10/mic3_speaker1.wav +0 -0
  90. {flamo-0.1.4 → flamo-0.1.6}/rirs/Otala-2024.05.10/mic3_speaker10.wav +0 -0
  91. {flamo-0.1.4 → flamo-0.1.6}/rirs/Otala-2024.05.10/mic3_speaker11.wav +0 -0
  92. {flamo-0.1.4 → flamo-0.1.6}/rirs/Otala-2024.05.10/mic3_speaker12.wav +0 -0
  93. {flamo-0.1.4 → flamo-0.1.6}/rirs/Otala-2024.05.10/mic3_speaker13.wav +0 -0
  94. {flamo-0.1.4 → flamo-0.1.6}/rirs/Otala-2024.05.10/mic3_speaker14.wav +0 -0
  95. {flamo-0.1.4 → flamo-0.1.6}/rirs/Otala-2024.05.10/mic3_speaker2.wav +0 -0
  96. {flamo-0.1.4 → flamo-0.1.6}/rirs/Otala-2024.05.10/mic3_speaker3.wav +0 -0
  97. {flamo-0.1.4 → flamo-0.1.6}/rirs/Otala-2024.05.10/mic3_speaker5.wav +0 -0
  98. {flamo-0.1.4 → flamo-0.1.6}/rirs/Otala-2024.05.10/mic3_speaker6.wav +0 -0
  99. {flamo-0.1.4 → flamo-0.1.6}/rirs/Otala-2024.05.10/mic3_speaker7.wav +0 -0
  100. {flamo-0.1.4 → flamo-0.1.6}/rirs/Otala-2024.05.10/mic3_speaker8.wav +0 -0
  101. {flamo-0.1.4 → flamo-0.1.6}/rirs/Otala-2024.05.10/mic3_speaker9.wav +0 -0
  102. {flamo-0.1.4 → flamo-0.1.6}/rirs/Otala-2024.05.10/mic4_speaker1.wav +0 -0
  103. {flamo-0.1.4 → flamo-0.1.6}/rirs/Otala-2024.05.10/mic4_speaker10.wav +0 -0
  104. {flamo-0.1.4 → flamo-0.1.6}/rirs/Otala-2024.05.10/mic4_speaker11.wav +0 -0
  105. {flamo-0.1.4 → flamo-0.1.6}/rirs/Otala-2024.05.10/mic4_speaker12.wav +0 -0
  106. {flamo-0.1.4 → flamo-0.1.6}/rirs/Otala-2024.05.10/mic4_speaker13.wav +0 -0
  107. {flamo-0.1.4 → flamo-0.1.6}/rirs/Otala-2024.05.10/mic4_speaker14.wav +0 -0
  108. {flamo-0.1.4 → flamo-0.1.6}/rirs/Otala-2024.05.10/mic4_speaker2.wav +0 -0
  109. {flamo-0.1.4 → flamo-0.1.6}/rirs/Otala-2024.05.10/mic4_speaker3.wav +0 -0
  110. {flamo-0.1.4 → flamo-0.1.6}/rirs/Otala-2024.05.10/mic4_speaker5.wav +0 -0
  111. {flamo-0.1.4 → flamo-0.1.6}/rirs/Otala-2024.05.10/mic4_speaker6.wav +0 -0
  112. {flamo-0.1.4 → flamo-0.1.6}/rirs/Otala-2024.05.10/mic4_speaker7.wav +0 -0
  113. {flamo-0.1.4 → flamo-0.1.6}/rirs/Otala-2024.05.10/mic4_speaker8.wav +0 -0
  114. {flamo-0.1.4 → flamo-0.1.6}/rirs/Otala-2024.05.10/mic4_speaker9.wav +0 -0
  115. {flamo-0.1.4 → flamo-0.1.6}/rirs/Otala-2024.05.10/mic5_speaker1.wav +0 -0
  116. {flamo-0.1.4 → flamo-0.1.6}/rirs/Otala-2024.05.10/mic5_speaker10.wav +0 -0
  117. {flamo-0.1.4 → flamo-0.1.6}/rirs/Otala-2024.05.10/mic5_speaker11.wav +0 -0
  118. {flamo-0.1.4 → flamo-0.1.6}/rirs/Otala-2024.05.10/mic5_speaker12.wav +0 -0
  119. {flamo-0.1.4 → flamo-0.1.6}/rirs/Otala-2024.05.10/mic5_speaker13.wav +0 -0
  120. {flamo-0.1.4 → flamo-0.1.6}/rirs/Otala-2024.05.10/mic5_speaker14.wav +0 -0
  121. {flamo-0.1.4 → flamo-0.1.6}/rirs/Otala-2024.05.10/mic5_speaker2.wav +0 -0
  122. {flamo-0.1.4 → flamo-0.1.6}/rirs/Otala-2024.05.10/mic5_speaker3.wav +0 -0
  123. {flamo-0.1.4 → flamo-0.1.6}/rirs/Otala-2024.05.10/mic5_speaker5.wav +0 -0
  124. {flamo-0.1.4 → flamo-0.1.6}/rirs/Otala-2024.05.10/mic5_speaker6.wav +0 -0
  125. {flamo-0.1.4 → flamo-0.1.6}/rirs/Otala-2024.05.10/mic5_speaker7.wav +0 -0
  126. {flamo-0.1.4 → flamo-0.1.6}/rirs/Otala-2024.05.10/mic5_speaker8.wav +0 -0
  127. {flamo-0.1.4 → flamo-0.1.6}/rirs/Otala-2024.05.10/mic5_speaker9.wav +0 -0
  128. {flamo-0.1.4 → flamo-0.1.6}/rirs/arni_35_3541_4_2.wav +0 -0
  129. {flamo-0.1.4 → flamo-0.1.6}/rirs/s3_r4_o.wav +0 -0
  130. {flamo-0.1.4 → flamo-0.1.6}/sphinx/Makefile +0 -0
  131. {flamo-0.1.4 → flamo-0.1.6}/sphinx/_build/doctrees/auxiliary/eq.doctree +0 -0
  132. {flamo-0.1.4 → flamo-0.1.6}/sphinx/_build/doctrees/auxiliary/filterbank.doctree +0 -0
  133. {flamo-0.1.4 → flamo-0.1.6}/sphinx/_build/doctrees/auxiliary/minimize.doctree +0 -0
  134. {flamo-0.1.4 → flamo-0.1.6}/sphinx/_build/doctrees/auxiliary/reverb.doctree +0 -0
  135. {flamo-0.1.4 → flamo-0.1.6}/sphinx/_build/doctrees/auxiliary/scattering.doctree +0 -0
  136. {flamo-0.1.4 → flamo-0.1.6}/sphinx/_build/doctrees/environment.pickle +0 -0
  137. {flamo-0.1.4 → flamo-0.1.6}/sphinx/_build/doctrees/functional.doctree +0 -0
  138. {flamo-0.1.4 → flamo-0.1.6}/sphinx/_build/doctrees/index.doctree +0 -0
  139. {flamo-0.1.4 → flamo-0.1.6}/sphinx/_build/doctrees/optimize/dataset.doctree +0 -0
  140. {flamo-0.1.4 → flamo-0.1.6}/sphinx/_build/doctrees/optimize/loss.doctree +0 -0
  141. {flamo-0.1.4 → flamo-0.1.6}/sphinx/_build/doctrees/optimize/trainer.doctree +0 -0
  142. {flamo-0.1.4 → flamo-0.1.6}/sphinx/_build/doctrees/optimize/utils.doctree +0 -0
  143. {flamo-0.1.4 → flamo-0.1.6}/sphinx/_build/doctrees/processor/dsp.doctree +0 -0
  144. {flamo-0.1.4 → flamo-0.1.6}/sphinx/_build/doctrees/processor/system.doctree +0 -0
  145. {flamo-0.1.4 → flamo-0.1.6}/sphinx/_build/html/.buildinfo +0 -0
  146. {flamo-0.1.4 → flamo-0.1.6}/sphinx/_build/html/.buildinfo.bak +0 -0
  147. {flamo-0.1.4 → flamo-0.1.6}/sphinx/_build/html/.nojekyll +0 -0
  148. {flamo-0.1.4 → flamo-0.1.6}/sphinx/_build/html/_sources/auxiliary/eq.rst.txt +0 -0
  149. {flamo-0.1.4 → flamo-0.1.6}/sphinx/_build/html/_sources/auxiliary/filterbank.rst.txt +0 -0
  150. {flamo-0.1.4 → flamo-0.1.6}/sphinx/_build/html/_sources/auxiliary/minimize.rst.txt +0 -0
  151. {flamo-0.1.4 → flamo-0.1.6}/sphinx/_build/html/_sources/auxiliary/reverb.rst.txt +0 -0
  152. {flamo-0.1.4 → flamo-0.1.6}/sphinx/_build/html/_sources/auxiliary/scattering.rst.txt +0 -0
  153. {flamo-0.1.4 → flamo-0.1.6}/sphinx/_build/html/_sources/functional.rst.txt +0 -0
  154. {flamo-0.1.4 → flamo-0.1.6}/sphinx/_build/html/_sources/index.rst.txt +0 -0
  155. {flamo-0.1.4 → flamo-0.1.6}/sphinx/_build/html/_sources/optimize/dataset.rst.txt +0 -0
  156. {flamo-0.1.4 → flamo-0.1.6}/sphinx/_build/html/_sources/optimize/loss.rst.txt +0 -0
  157. {flamo-0.1.4 → flamo-0.1.6}/sphinx/_build/html/_sources/optimize/trainer.rst.txt +0 -0
  158. {flamo-0.1.4 → flamo-0.1.6}/sphinx/_build/html/_sources/optimize/utils.rst.txt +0 -0
  159. {flamo-0.1.4 → flamo-0.1.6}/sphinx/_build/html/_sources/processor/dsp.rst.txt +0 -0
  160. {flamo-0.1.4 → flamo-0.1.6}/sphinx/_build/html/_sources/processor/system.rst.txt +0 -0
  161. {flamo-0.1.4 → flamo-0.1.6}/sphinx/_build/html/_static/_sphinx_javascript_frameworks_compat.js +0 -0
  162. {flamo-0.1.4 → flamo-0.1.6}/sphinx/_build/html/_static/alabaster.css +0 -0
  163. {flamo-0.1.4 → flamo-0.1.6}/sphinx/_build/html/_static/basic.css +0 -0
  164. {flamo-0.1.4 → flamo-0.1.6}/sphinx/_build/html/_static/css/badge_only.css +0 -0
  165. {flamo-0.1.4 → flamo-0.1.6}/sphinx/_build/html/_static/css/fonts/Roboto-Slab-Bold.woff +0 -0
  166. {flamo-0.1.4 → flamo-0.1.6}/sphinx/_build/html/_static/css/fonts/Roboto-Slab-Bold.woff2 +0 -0
  167. {flamo-0.1.4 → flamo-0.1.6}/sphinx/_build/html/_static/css/fonts/Roboto-Slab-Regular.woff +0 -0
  168. {flamo-0.1.4 → flamo-0.1.6}/sphinx/_build/html/_static/css/fonts/Roboto-Slab-Regular.woff2 +0 -0
  169. {flamo-0.1.4 → flamo-0.1.6}/sphinx/_build/html/_static/css/fonts/fontawesome-webfont.eot +0 -0
  170. {flamo-0.1.4 → flamo-0.1.6}/sphinx/_build/html/_static/css/fonts/fontawesome-webfont.svg +0 -0
  171. {flamo-0.1.4 → flamo-0.1.6}/sphinx/_build/html/_static/css/fonts/fontawesome-webfont.ttf +0 -0
  172. {flamo-0.1.4 → flamo-0.1.6}/sphinx/_build/html/_static/css/fonts/fontawesome-webfont.woff +0 -0
  173. {flamo-0.1.4 → flamo-0.1.6}/sphinx/_build/html/_static/css/fonts/fontawesome-webfont.woff2 +0 -0
  174. {flamo-0.1.4 → flamo-0.1.6}/sphinx/_build/html/_static/css/fonts/lato-bold-italic.woff +0 -0
  175. {flamo-0.1.4 → flamo-0.1.6}/sphinx/_build/html/_static/css/fonts/lato-bold-italic.woff2 +0 -0
  176. {flamo-0.1.4 → flamo-0.1.6}/sphinx/_build/html/_static/css/fonts/lato-bold.woff +0 -0
  177. {flamo-0.1.4 → flamo-0.1.6}/sphinx/_build/html/_static/css/fonts/lato-bold.woff2 +0 -0
  178. {flamo-0.1.4 → flamo-0.1.6}/sphinx/_build/html/_static/css/fonts/lato-normal-italic.woff +0 -0
  179. {flamo-0.1.4 → flamo-0.1.6}/sphinx/_build/html/_static/css/fonts/lato-normal-italic.woff2 +0 -0
  180. {flamo-0.1.4 → flamo-0.1.6}/sphinx/_build/html/_static/css/fonts/lato-normal.woff +0 -0
  181. {flamo-0.1.4 → flamo-0.1.6}/sphinx/_build/html/_static/css/fonts/lato-normal.woff2 +0 -0
  182. {flamo-0.1.4 → flamo-0.1.6}/sphinx/_build/html/_static/css/theme.css +0 -0
  183. {flamo-0.1.4 → flamo-0.1.6}/sphinx/_build/html/_static/custom.css +0 -0
  184. {flamo-0.1.4 → flamo-0.1.6}/sphinx/_build/html/_static/doctools.js +0 -0
  185. {flamo-0.1.4 → flamo-0.1.6}/sphinx/_build/html/_static/documentation_options.js +0 -0
  186. {flamo-0.1.4 → flamo-0.1.6}/sphinx/_build/html/_static/file.png +0 -0
  187. {flamo-0.1.4 → flamo-0.1.6}/sphinx/_build/html/_static/fonts/Lato/lato-bold.eot +0 -0
  188. {flamo-0.1.4 → flamo-0.1.6}/sphinx/_build/html/_static/fonts/Lato/lato-bold.ttf +0 -0
  189. {flamo-0.1.4 → flamo-0.1.6}/sphinx/_build/html/_static/fonts/Lato/lato-bold.woff +0 -0
  190. {flamo-0.1.4 → flamo-0.1.6}/sphinx/_build/html/_static/fonts/Lato/lato-bold.woff2 +0 -0
  191. {flamo-0.1.4 → flamo-0.1.6}/sphinx/_build/html/_static/fonts/Lato/lato-bolditalic.eot +0 -0
  192. {flamo-0.1.4 → flamo-0.1.6}/sphinx/_build/html/_static/fonts/Lato/lato-bolditalic.ttf +0 -0
  193. {flamo-0.1.4 → flamo-0.1.6}/sphinx/_build/html/_static/fonts/Lato/lato-bolditalic.woff +0 -0
  194. {flamo-0.1.4 → flamo-0.1.6}/sphinx/_build/html/_static/fonts/Lato/lato-bolditalic.woff2 +0 -0
  195. {flamo-0.1.4 → flamo-0.1.6}/sphinx/_build/html/_static/fonts/Lato/lato-italic.eot +0 -0
  196. {flamo-0.1.4 → flamo-0.1.6}/sphinx/_build/html/_static/fonts/Lato/lato-italic.ttf +0 -0
  197. {flamo-0.1.4 → flamo-0.1.6}/sphinx/_build/html/_static/fonts/Lato/lato-italic.woff +0 -0
  198. {flamo-0.1.4 → flamo-0.1.6}/sphinx/_build/html/_static/fonts/Lato/lato-italic.woff2 +0 -0
  199. {flamo-0.1.4 → flamo-0.1.6}/sphinx/_build/html/_static/fonts/Lato/lato-regular.eot +0 -0
  200. {flamo-0.1.4 → flamo-0.1.6}/sphinx/_build/html/_static/fonts/Lato/lato-regular.ttf +0 -0
  201. {flamo-0.1.4 → flamo-0.1.6}/sphinx/_build/html/_static/fonts/Lato/lato-regular.woff +0 -0
  202. {flamo-0.1.4 → flamo-0.1.6}/sphinx/_build/html/_static/fonts/Lato/lato-regular.woff2 +0 -0
  203. {flamo-0.1.4 → flamo-0.1.6}/sphinx/_build/html/_static/fonts/RobotoSlab/roboto-slab-v7-bold.eot +0 -0
  204. {flamo-0.1.4 → flamo-0.1.6}/sphinx/_build/html/_static/fonts/RobotoSlab/roboto-slab-v7-bold.ttf +0 -0
  205. {flamo-0.1.4 → flamo-0.1.6}/sphinx/_build/html/_static/fonts/RobotoSlab/roboto-slab-v7-bold.woff +0 -0
  206. {flamo-0.1.4 → flamo-0.1.6}/sphinx/_build/html/_static/fonts/RobotoSlab/roboto-slab-v7-bold.woff2 +0 -0
  207. {flamo-0.1.4 → flamo-0.1.6}/sphinx/_build/html/_static/fonts/RobotoSlab/roboto-slab-v7-regular.eot +0 -0
  208. {flamo-0.1.4 → flamo-0.1.6}/sphinx/_build/html/_static/fonts/RobotoSlab/roboto-slab-v7-regular.ttf +0 -0
  209. {flamo-0.1.4 → flamo-0.1.6}/sphinx/_build/html/_static/fonts/RobotoSlab/roboto-slab-v7-regular.woff +0 -0
  210. {flamo-0.1.4 → flamo-0.1.6}/sphinx/_build/html/_static/fonts/RobotoSlab/roboto-slab-v7-regular.woff2 +0 -0
  211. {flamo-0.1.4 → flamo-0.1.6}/sphinx/_build/html/_static/github-banner.svg +0 -0
  212. {flamo-0.1.4 → flamo-0.1.6}/sphinx/_build/html/_static/jquery.js +0 -0
  213. {flamo-0.1.4 → flamo-0.1.6}/sphinx/_build/html/_static/js/badge_only.js +0 -0
  214. {flamo-0.1.4 → flamo-0.1.6}/sphinx/_build/html/_static/js/theme.js +0 -0
  215. {flamo-0.1.4 → flamo-0.1.6}/sphinx/_build/html/_static/js/versions.js +0 -0
  216. {flamo-0.1.4 → flamo-0.1.6}/sphinx/_build/html/_static/language_data.js +0 -0
  217. {flamo-0.1.4 → flamo-0.1.6}/sphinx/_build/html/_static/minus.png +0 -0
  218. {flamo-0.1.4 → flamo-0.1.6}/sphinx/_build/html/_static/plus.png +0 -0
  219. {flamo-0.1.4 → flamo-0.1.6}/sphinx/_build/html/_static/pygments.css +0 -0
  220. {flamo-0.1.4 → flamo-0.1.6}/sphinx/_build/html/_static/scripts/bootstrap.js +0 -0
  221. {flamo-0.1.4 → flamo-0.1.6}/sphinx/_build/html/_static/scripts/bootstrap.js.LICENSE.txt +0 -0
  222. {flamo-0.1.4 → flamo-0.1.6}/sphinx/_build/html/_static/scripts/bootstrap.js.map +0 -0
  223. {flamo-0.1.4 → flamo-0.1.6}/sphinx/_build/html/_static/scripts/fontawesome.js +0 -0
  224. {flamo-0.1.4 → flamo-0.1.6}/sphinx/_build/html/_static/scripts/fontawesome.js.LICENSE.txt +0 -0
  225. {flamo-0.1.4 → flamo-0.1.6}/sphinx/_build/html/_static/scripts/fontawesome.js.map +0 -0
  226. {flamo-0.1.4 → flamo-0.1.6}/sphinx/_build/html/_static/scripts/pydata-sphinx-theme.js +0 -0
  227. {flamo-0.1.4 → flamo-0.1.6}/sphinx/_build/html/_static/scripts/pydata-sphinx-theme.js.map +0 -0
  228. {flamo-0.1.4 → flamo-0.1.6}/sphinx/_build/html/_static/searchtools.js +0 -0
  229. {flamo-0.1.4 → flamo-0.1.6}/sphinx/_build/html/_static/sphinx_highlight.js +0 -0
  230. {flamo-0.1.4 → flamo-0.1.6}/sphinx/_build/html/_static/styles/pydata-sphinx-theme.css +0 -0
  231. {flamo-0.1.4 → flamo-0.1.6}/sphinx/_build/html/_static/styles/pydata-sphinx-theme.css.map +0 -0
  232. {flamo-0.1.4 → flamo-0.1.6}/sphinx/_build/html/_static/styles/theme.css +0 -0
  233. {flamo-0.1.4 → flamo-0.1.6}/sphinx/_build/html/_static/vendor/fontawesome/webfonts/fa-brands-400.ttf +0 -0
  234. {flamo-0.1.4 → flamo-0.1.6}/sphinx/_build/html/_static/vendor/fontawesome/webfonts/fa-brands-400.woff2 +0 -0
  235. {flamo-0.1.4 → flamo-0.1.6}/sphinx/_build/html/_static/vendor/fontawesome/webfonts/fa-regular-400.ttf +0 -0
  236. {flamo-0.1.4 → flamo-0.1.6}/sphinx/_build/html/_static/vendor/fontawesome/webfonts/fa-regular-400.woff2 +0 -0
  237. {flamo-0.1.4 → flamo-0.1.6}/sphinx/_build/html/_static/vendor/fontawesome/webfonts/fa-solid-900.ttf +0 -0
  238. {flamo-0.1.4 → flamo-0.1.6}/sphinx/_build/html/_static/vendor/fontawesome/webfonts/fa-solid-900.woff2 +0 -0
  239. {flamo-0.1.4 → flamo-0.1.6}/sphinx/_build/html/_static/webpack-macros.html +0 -0
  240. {flamo-0.1.4 → flamo-0.1.6}/sphinx/_build/html/auxiliary/eq.html +0 -0
  241. {flamo-0.1.4 → flamo-0.1.6}/sphinx/_build/html/auxiliary/filterbank.html +0 -0
  242. {flamo-0.1.4 → flamo-0.1.6}/sphinx/_build/html/auxiliary/minimize.html +0 -0
  243. {flamo-0.1.4 → flamo-0.1.6}/sphinx/_build/html/auxiliary/reverb.html +0 -0
  244. {flamo-0.1.4 → flamo-0.1.6}/sphinx/_build/html/auxiliary/scattering.html +0 -0
  245. {flamo-0.1.4 → flamo-0.1.6}/sphinx/_build/html/functional.html +0 -0
  246. {flamo-0.1.4 → flamo-0.1.6}/sphinx/_build/html/genindex.html +0 -0
  247. {flamo-0.1.4 → flamo-0.1.6}/sphinx/_build/html/index.html +0 -0
  248. {flamo-0.1.4 → flamo-0.1.6}/sphinx/_build/html/objects.inv +0 -0
  249. {flamo-0.1.4 → flamo-0.1.6}/sphinx/_build/html/optimize/dataset.html +0 -0
  250. {flamo-0.1.4 → flamo-0.1.6}/sphinx/_build/html/optimize/loss.html +0 -0
  251. {flamo-0.1.4 → flamo-0.1.6}/sphinx/_build/html/optimize/trainer.html +0 -0
  252. {flamo-0.1.4 → flamo-0.1.6}/sphinx/_build/html/optimize/utils.html +0 -0
  253. {flamo-0.1.4 → flamo-0.1.6}/sphinx/_build/html/processor/dsp.html +0 -0
  254. {flamo-0.1.4 → flamo-0.1.6}/sphinx/_build/html/processor/system.html +0 -0
  255. {flamo-0.1.4 → flamo-0.1.6}/sphinx/_build/html/search.html +0 -0
  256. {flamo-0.1.4 → flamo-0.1.6}/sphinx/_build/html/searchindex.js +0 -0
  257. {flamo-0.1.4 → flamo-0.1.6}/sphinx/auxiliary/eq.rst +0 -0
  258. {flamo-0.1.4 → flamo-0.1.6}/sphinx/auxiliary/filterbank.rst +0 -0
  259. {flamo-0.1.4 → flamo-0.1.6}/sphinx/auxiliary/minimize.rst +0 -0
  260. {flamo-0.1.4 → flamo-0.1.6}/sphinx/auxiliary/reverb.rst +0 -0
  261. {flamo-0.1.4 → flamo-0.1.6}/sphinx/auxiliary/scattering.rst +0 -0
  262. {flamo-0.1.4 → flamo-0.1.6}/sphinx/conf.py +0 -0
  263. {flamo-0.1.4 → flamo-0.1.6}/sphinx/functional.rst +0 -0
  264. {flamo-0.1.4 → flamo-0.1.6}/sphinx/index.rst +0 -0
  265. {flamo-0.1.4 → flamo-0.1.6}/sphinx/make.bat +0 -0
  266. {flamo-0.1.4 → flamo-0.1.6}/sphinx/optimize/dataset.rst +0 -0
  267. {flamo-0.1.4 → flamo-0.1.6}/sphinx/optimize/loss.rst +0 -0
  268. {flamo-0.1.4 → flamo-0.1.6}/sphinx/optimize/trainer.rst +0 -0
  269. {flamo-0.1.4 → flamo-0.1.6}/sphinx/optimize/utils.rst +0 -0
  270. {flamo-0.1.4 → flamo-0.1.6}/sphinx/processor/dsp.rst +0 -0
  271. {flamo-0.1.4 → flamo-0.1.6}/sphinx/processor/system.rst +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: flamo
3
- Version: 0.1.4
3
+ Version: 0.1.6
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
@@ -70,7 +71,7 @@ Utilities, system designers, and optimization - in `flamo.processor.system`:
70
71
  - **Shell**: Container class for safe interaction between system, dataset, and loss functions
71
72
 
72
73
  Optimization - in `flamo.optimize`:
73
- - **Trianer** : Handling of the training and validation steps
74
+ - **Trainer** : Handling of the training and validation steps
74
75
  - **Dataset** : Customizable dataset class and helper methods
75
76
 
76
77
  ---
@@ -24,7 +24,7 @@ Utilities, system designers, and optimization - in `flamo.processor.system`:
24
24
  - **Shell**: Container class for safe interaction between system, dataset, and loss functions
25
25
 
26
26
  Optimization - in `flamo.optimize`:
27
- - **Trianer** : Handling of the training and validation steps
27
+ - **Trainer** : Handling of the training and validation steps
28
28
  - **Dataset** : Customizable dataset class and helper methods
29
29
 
30
30
  ---
@@ -0,0 +1,63 @@
1
+ """
2
+ Example usage of velvet noise filters integrated with FLAMO Filter system.
3
+
4
+ This example shows how to use the new Filter-based velvet noise classes
5
+ that are differentiable and can be used within the FLAMO processing chain.
6
+ """
7
+
8
+ import torch.nn as nn
9
+
10
+ import matplotlib.pyplot as plt
11
+ from flamo.auxiliary.velvet import (
12
+ VelvetNoiseFilter,
13
+ )
14
+ from flamo.functional import signal_gallery
15
+ from flamo.processor import dsp
16
+
17
+ def example_velvet_noise_filter():
18
+ """Example using VelvetNoiseFilter."""
19
+ print("=== VelvetNoiseFilter Example ===")
20
+
21
+ in_ch, out_ch = 1, 1
22
+ nfft = 2048 # FFT size for the filter
23
+ length = nfft # Length of the filter
24
+
25
+ # Create a velvet noise filter
26
+ # size = (length, output_channels, input_channels)
27
+ velvet_filter = VelvetNoiseFilter(
28
+ size=(length, out_ch, in_ch), # 1024 samples, 1x1 matrix
29
+ density=1000.0, # 1000 impulses per second
30
+ sample_rate=48000,
31
+ requires_grad=True # Make it differentiable
32
+ )
33
+
34
+ input_layer = dsp.FFT(nfft=nfft)
35
+ output_layer = dsp.iFFT(nfft=nfft)
36
+
37
+ my_dsp = nn.Sequential(input_layer, velvet_filter, output_layer)
38
+
39
+ # -------------- Apply unit impulse to DSP --------------
40
+
41
+ # Input signal
42
+ input_sig = signal_gallery(
43
+ signal_type="impulse",
44
+ batch_size=1,
45
+ n_samples=nfft,
46
+ n=in_ch,
47
+ fs=48000,
48
+ device="cpu",
49
+ )
50
+
51
+ output_vn = my_dsp(input_sig)
52
+ # plot the sequence
53
+ plt.figure(figsize=(12, 4))
54
+ plt.plot(output_vn[0, :, 0].squeeze().numpy())
55
+ for pos in velvet_filter.grid:
56
+ plt.axvline(x=pos.item(), color='r', linestyle='--', alpha=0.5)
57
+ plt.title('Output Velvet Noise Signal')
58
+ plt.xlabel('Samples')
59
+ plt.ylabel('Amplitude')
60
+ plt.grid(True, alpha=0.3)
61
+ plt.tight_layout()
62
+
63
+ return
@@ -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 = 0 # alias decay in dB
30
- delay_lengths = torch.tensor([997, 1153, 1327, 1559, 1801, 2099])
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=False,
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=False,
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
- mixing_matrix = dsp.Matrix(
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.iFFT(args.nfft)
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.mixing_matrix.param.squeeze().detach().cpu().numpy()
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()
@@ -490,8 +490,8 @@ if __name__ == "__main__":
490
490
 
491
491
  parser = argparse.ArgumentParser()
492
492
 
493
- parser.add_argument("--nfft", type=int, default=44100*2, help="FFT size")
494
- parser.add_argument("--samplerate", type=int, default=44100, help="sampling rate")
493
+ parser.add_argument("--nfft", type=int, default=96000, help="FFT size")
494
+ parser.add_argument("--samplerate", type=int, default=48000, help="sampling rate")
495
495
  parser.add_argument("--num", type=int, default=100, help="dataset size")
496
496
  parser.add_argument(
497
497
  "--device", type=str, default="cuda", help="device to use for computation"
@@ -541,6 +541,6 @@ if __name__ == "__main__":
541
541
  )
542
542
  )
543
543
 
544
- example_fdn(args)
544
+ # example_fdn(args)
545
545
  # example_fdn_accurate_geq(args)
546
- # example_fdn_direct(args)
546
+ example_fdn_direct(args)
@@ -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, criterion_name=["MSE"])
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(), torch.nn.L1Loss()],
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, criterion_name=["MSE", "MAE"])
127
+ loss_profile.plot_loss(loss)
128
128
 
129
129
  if __name__ == "__main__":
130
130
 
@@ -33,7 +33,8 @@ class HomogeneousFDNConfig(BaseModel):
33
33
  delays_grad: bool = False
34
34
  mixing_matrix_grad: bool = True
35
35
  attenuation_grad: bool = True
36
-
36
+ is_delay_int: bool = True
37
+
37
38
  def __init__(self, **data):
38
39
  super().__init__(**data)
39
40
  if self.delays is None:
@@ -86,7 +86,8 @@ def geq(
86
86
 
87
87
  for band in range(num_bands):
88
88
  if band == 0:
89
- b = torch.tensor([db2mag(gain_db[band]), 0, 0], device=device)
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=True,
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,
@@ -245,13 +245,11 @@ def get_random_shifts(N, sparsity_vect, pulse_size):
245
245
 
246
246
  def hadamard_matrix(N):
247
247
  """Generate a hadamard matrix of size N"""
248
- X = np.array([[1]])
248
+ X = np.array([[1]])
249
249
  # Create a Hadamard matrix of the specified order
250
- # TODO remove for loop becuase all matrices look the same
251
250
  while X.shape[0] < N:
252
251
  # Kronecker product to generate a larger Hadamard matrix
253
252
  X = np.kron(X, np.array([[1, 1], [1, -1]])) / np.sqrt(2)
254
-
255
253
  return X
256
254
 
257
255
 
@@ -0,0 +1,114 @@
1
+ """
2
+ Velvet Noise implementations for FLAMO
3
+
4
+ Velvet noise is a sparse pseudo-random noise used in artificial reverberation.
5
+ It consists of sample values of +1, -1, and 0, with the non-zero samples
6
+ occurring at pseudo-random locations.
7
+
8
+ References:
9
+ Välimäki, V., & Prawda, K. (2021). Late-Reverberation Synthesis Using
10
+ Interleaved Velvet-Noise Sequences. IEEE/ACM Transactions on Audio,
11
+ Speech, and Language Processing, 29, 1149-1160.
12
+ """
13
+
14
+ import torch
15
+ import torch.nn as nn
16
+ import math
17
+ from typing import Optional
18
+ from flamo.processor.dsp import Filter, parallelFilter
19
+
20
+
21
+ class VelvetNoiseFilter(Filter):
22
+ """
23
+ TODO
24
+ Args:
25
+ size: Size of the filter parameters (length, output_channels, input_channels)
26
+ density: Number of impulses per second
27
+ delta: Scaling factor for impulse range (0 < delta <= 1)
28
+ When delta=0.25, impulses only appear in first 25% of each grid
29
+ sample_rate: Sample rate in Hz (default: 48000)
30
+ nfft: Number of FFT points required to compute the frequency response
31
+ requires_grad: Whether the filter parameters require gradients
32
+ alias_decay_db: The decaying factor in dB for the time anti-aliasing envelope
33
+ device: The device of the constructed tensors
34
+ """
35
+
36
+ def __init__(
37
+ self,
38
+ size: tuple = (1, 1, 1),
39
+ density: float = 1000.0,
40
+ delta: float = 1.0,
41
+ sample_rate: int = 48000,
42
+ nfft: int = 2**11,
43
+ requires_grad: bool = False,
44
+ alias_decay_db: float = 0.0,
45
+ device: Optional[str] = None,
46
+ ):
47
+ self.density = density
48
+ self.sample_rate = sample_rate
49
+ self.Td = sample_rate / density # Average distance between impulses
50
+ if not 0 < delta <= 1:
51
+ raise ValueError("Delta must be in range (0, 1]")
52
+
53
+ self.delta = delta
54
+ # Create mapping function that generates velvet noise
55
+ map = lambda x: self._generate_velvet_impulse_response(x)
56
+ super().__init__(
57
+ size=size,
58
+ nfft=nfft,
59
+ map=map,
60
+ requires_grad=requires_grad,
61
+ alias_decay_db=alias_decay_db,
62
+ device=device,
63
+ )
64
+
65
+ def _generate_velvet_impulse_response(self, param: torch.Tensor) -> torch.Tensor:
66
+ """Generate velvet noise impulse response from parameters."""
67
+ # Calculate grid size (average distance between impulses)
68
+
69
+
70
+ result = torch.zeros_like(param)
71
+
72
+ for out_ch in range(self.param.shape[1]):
73
+ for in_ch in range(self.param.shape[2]):
74
+ # Extract parameters for this channel pair
75
+ result[:, out_ch, in_ch] = self._generate_velvet_sequence()
76
+
77
+ return result
78
+
79
+ def _generate_velvet_sequence(
80
+ self,
81
+ ) -> torch.Tensor:
82
+ """Generate a single velvet noise sequence."""
83
+
84
+ # Add random jitter to each position (uniform distribution)
85
+ jitter_factors = torch.rand(self.floor_impulses)
86
+ impulse_indices = torch.ceil(self.grid + self.delta * jitter_factors * (self.Td - 1)).long()
87
+
88
+ # first impulse is at position 0 and all indices are within bounds
89
+ impulse_indices[0] = 0
90
+ impulse_indices = torch.clamp(impulse_indices, max=self.param.shape[0] - 1)
91
+
92
+ # Generate random signs (+1 or -1)
93
+ signs = 2 * torch.randint(0, 2, (self.floor_impulses,)) - 1
94
+
95
+ # Construct sparse signal
96
+ sequence = torch.zeros(self.size[0], device=self.device)
97
+ sequence[impulse_indices] = signs.float()
98
+
99
+ return sequence
100
+
101
+ def initialize_class(self):
102
+ r"""
103
+ Initializes the Filter module.
104
+
105
+ This method checks the shape of the gain parameters, computes the frequency response of the filter,
106
+ and computes the frequency convolution function.
107
+ """
108
+ self.check_param_shape()
109
+ self.get_io()
110
+ num_impulses = self.param.shape[0] / self.Td
111
+ self.floor_impulses = math.floor(num_impulses)
112
+ self.grid = torch.arange(self.floor_impulses) * self.Td
113
+ self.get_freq_response()
114
+ self.get_freq_convolve()
@@ -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
  """