๐ TorchFX: Audio Filters Powered by PyTorch#
An open-source academic project at the intersection of audio DSP, performance, and modern machine learning tooling.
๐ Why TorchFX?#
TorchFX was born from a very concrete research and industry need.
During my PhD, while collaborating with an industrial partner, I needed fast, flexible, and expressive software to prototype audio filters. Existing DSP tools were powerful but often rigid, CPU-bound, or disconnected from the rapidly evolving deep learning ecosystem.
So I asked a simple question:
What if we built audio filters on top of PyTorch instead of NumPy / SciPy?
TorchFX is my answer.
โก The Core Idea#
The idea behind TorchFX is intentionally simple:
Use PyTorch as the computational backend
Treat audio filters as first-class differentiable operators
Enable:
๐ GPU acceleration
๐งฎ Automatic differentiation
๐งต Efficient multithreaded CPU execution
๐ฌ Seamless integration with deep learning workflows
Even when running on CPU, PyTorch often outperforms NumPy thanks to its optimized multithreading. And while tools like Numba can provide performance boosts, I found them:
harder to install and maintain across systems
less aligned with the fast-moving deep learning ecosystem
PyTorch, instead, gives us access to a huge and growing ecosystem of tools, libraries, and researchers โ making TorchFX future-proof by design.
๐ง Differentiable Audio DSP#
With TorchFX, audio filters are not just fast โ they are differentiable.
This unlocks exciting possibilities:
Gradient-based optimization of filter parameters
End-to-end learning systems that include classical DSP blocks
Hybrid models combining signal processing and neural networks
TorchFX is designed for:
audio researchers
DSP practitioners
ML engineers working with sound
anyone interested in bridging classic audio DSP and modern ML
๐ From Research to Open Source#
TorchFX is not just a library โ it is also a research contribution.
๐ The accompanying paper has been accepted at DAFx 2025
๐งพ A preprint is available on arXiv ๐ (link to be added)
Releasing the preprint immediately sparked interest in the audio research community. TorchFX even appeared among the trending projects on Papers With Code (RIP ๐ โ but we remember).
This response confirmed something important to me:
There is a real need for open, performant, and differentiable audio DSP tools.
๐ฑ An Open-Source Academic Project#
TorchFX is proudly:
๐งช academic
๐ open source
๐ค open to contributions
My hope is that TorchFX will grow into a shared platform for experimenting, prototyping, and researching audio filters โ whether for classic DSP, machine learning, or something in between.
If you are curious, excited, or skeptical โ Iโd love for you to try it, break it, and improve it.
๐ Project Links#
๐ฆ GitHub repository: matteospanio/torchfx
๐ Documentation: https://matteospanio.github.io/torchfx/
๐งพ arXiv preprint: https://arxiv.org/abs/2504.08624
๐ Looking Ahead#
TorchFX is just getting started.
The future Iโm excited about is one where:
audio DSP is fully differentiable
prototypes are fast and expressive
researchers and practitioners share tools, not silos
Thanks for being here at the beginning ๐ Letโs build the future of audio processing โ together.