Skip to main content

A GPU accelerated library for audio DSP based on PyTorch

Project description

TorchFX

GPU-Accelerated Audio DSP with PyTorch

License: GPL v3 arXiv PyPI version PyPI - Status codecov Ask DeepWiki

Documentation | Getting Started | API Reference | Blog


TorchFX is a modern Python library for high-performance digital signal processing in audio, leveraging PyTorch and GPU acceleration. Built for researchers, engineers, and developers who need fast, flexible, and differentiable audio processing.

✨ Key Features

  • GPU Acceleration - Built on PyTorch for high-performance audio processing on CUDA-enabled devices
  • 🔗 Composable Pipelines - Chain filters with the pipe operator (|) for sequential processing
  • Parallel Processing - Combine filters with the add operator (+) for parallel filter combination
  • 🧠 PyTorch Native - All filters are torch.nn.Module subclasses, enabling gradient-based optimization
  • 🎯 Simple & Intuitive - Clean, object-oriented API designed for ease of use
  • ⚙️ Highly Extensible - Create custom filters and effects by extending base classes
  • 📊 Performance Optimized - Substantial performance gains over SciPy for long and multichannel signals

🚀 Quick Start

Installation

pip install torchfx

Or install from source:

git clone https://github.com/matteospanio/torchfx
cd torchfx
pip install -e .

Basic Example

import torch
from torchfx import Wave
from torchfx.filter import LoButterworth, ParametricEQ

# Load audio
wave = Wave.from_file("audio.wav")

# Create filters
lowpass = LoButterworth(cutoff=5000, order=4, fs=wave.fs)
eq = ParametricEQ(frequency=1000, q=2.0, gain=3.0, fs=wave.fs)

# Sequential processing with pipe operator (|)
processed = wave | lowpass | eq

# Parallel processing with add operator (+)
stereo_enhancer = lowpass + eq
enhanced = wave | stereo_enhancer

# Save result
processed.save("output.wav")

📚 Documentation

🛠️ Development

We welcome contributions from everyone! Please read our Contributing Guide to get started.

📖 Citation

If you use TorchFX in your research, please cite our paper:

@conference{Spanio2025torchfx,
	author = {Spanio, Matteo and Rodà, Antonio},
	title = {TORCHFX: A MODERN APPROACH TO AUDIO DSP WITH PYTORCH AND GPU ACCELERATION},
	year = {2025},
	journal = {Proceedings of the International Conference on Digital Audio Effects, DAFx},
	pages = {390 – 395},
	url = {https://www.scopus.com/inward/record.uri?eid=2-s2.0-105028935688&partnerID=40&md5=552e54afc1a074cbd1b7e8ed4ad1c010},
	type = {Conference paper},
}

License

This project is licensed under the terms of the GNU General Public License v3.0. See the LICENSE file for details.

Third-Party Acknowledgments

This project uses the following third-party libraries:

Their respective license texts are included in the licenses/ directory.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

torchfx-0.8.0.tar.gz (749.8 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

torchfx-0.8.0-cp314-cp314-win_amd64.whl (673.1 kB view details)

Uploaded CPython 3.14Windows x86-64

torchfx-0.8.0-cp314-cp314-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl (458.6 kB view details)

Uploaded CPython 3.14manylinux: glibc 2.24+ x86-64manylinux: glibc 2.28+ x86-64

torchfx-0.8.0-cp314-cp314-macosx_11_0_arm64.whl (325.8 kB view details)

Uploaded CPython 3.14macOS 11.0+ ARM64

torchfx-0.8.0-cp313-cp313-win_amd64.whl (659.0 kB view details)

Uploaded CPython 3.13Windows x86-64

torchfx-0.8.0-cp313-cp313-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl (458.5 kB view details)

Uploaded CPython 3.13manylinux: glibc 2.24+ x86-64manylinux: glibc 2.28+ x86-64

torchfx-0.8.0-cp313-cp313-macosx_11_0_arm64.whl (325.7 kB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

torchfx-0.8.0-cp312-cp312-win_amd64.whl (659.0 kB view details)

Uploaded CPython 3.12Windows x86-64

torchfx-0.8.0-cp312-cp312-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl (458.6 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.24+ x86-64manylinux: glibc 2.28+ x86-64

torchfx-0.8.0-cp312-cp312-macosx_11_0_arm64.whl (325.6 kB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

torchfx-0.8.0-cp311-cp311-win_amd64.whl (657.7 kB view details)

Uploaded CPython 3.11Windows x86-64

torchfx-0.8.0-cp311-cp311-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl (457.7 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.24+ x86-64manylinux: glibc 2.28+ x86-64

torchfx-0.8.0-cp311-cp311-macosx_11_0_arm64.whl (324.9 kB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

torchfx-0.8.0-cp310-cp310-win_amd64.whl (656.7 kB view details)

Uploaded CPython 3.10Windows x86-64

torchfx-0.8.0-cp310-cp310-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl (457.5 kB view details)

Uploaded CPython 3.10manylinux: glibc 2.24+ x86-64manylinux: glibc 2.28+ x86-64

torchfx-0.8.0-cp310-cp310-macosx_11_0_arm64.whl (323.4 kB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

File details

Details for the file torchfx-0.8.0.tar.gz.

File metadata

  • Download URL: torchfx-0.8.0.tar.gz
  • Upload date:
  • Size: 749.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for torchfx-0.8.0.tar.gz
Algorithm Hash digest
SHA256 7f6958ae09806ee90c1c6a5fafe700f27b69f5d705e07a0d01619638ea339802
MD5 0ef96909320936e62b0bfea543480acd
BLAKE2b-256 525f57b56f8db65006fa64c97664fdddbb5e8c9a1f3bf72d775f97eeb658d72a

See more details on using hashes here.

Provenance

The following attestation bundles were made for torchfx-0.8.0.tar.gz:

Publisher: wheels.yml on matteospanio/torchfx

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file torchfx-0.8.0-cp314-cp314-win_amd64.whl.

File metadata

  • Download URL: torchfx-0.8.0-cp314-cp314-win_amd64.whl
  • Upload date:
  • Size: 673.1 kB
  • Tags: CPython 3.14, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for torchfx-0.8.0-cp314-cp314-win_amd64.whl
Algorithm Hash digest
SHA256 d8ef851a2027b4ed62d24877f4e0ec5dd108834d1942241a07337a5e0b66f017
MD5 c5798df4a9c02a3bb2f2a20ae069e557
BLAKE2b-256 d97e5f175591932e382450147e9e63a3899fda58958978bf721b1f963c80da10

See more details on using hashes here.

Provenance

The following attestation bundles were made for torchfx-0.8.0-cp314-cp314-win_amd64.whl:

Publisher: wheels.yml on matteospanio/torchfx

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file torchfx-0.8.0-cp314-cp314-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for torchfx-0.8.0-cp314-cp314-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 7652c992e78cf34f8fd1f248030c9d4f83b4dbb96d878e8f7dcab015439140d2
MD5 688117e4661840251bc68dc7c9780b16
BLAKE2b-256 a5a0a59a359ffe37953825739f1828f5309bb8517e03d2c640a54c607f7f76c3

See more details on using hashes here.

Provenance

The following attestation bundles were made for torchfx-0.8.0-cp314-cp314-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl:

Publisher: wheels.yml on matteospanio/torchfx

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file torchfx-0.8.0-cp314-cp314-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for torchfx-0.8.0-cp314-cp314-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 cd795ff197b5e568b991006e20a0ed43acfc264cd98315d901cf1e6e94fae7c8
MD5 bd065d9e63ba4f50d00a5633b00e28b6
BLAKE2b-256 a85ece103ddf0d095a27b4d23f1b3d8e5bfaa5932f71b5b00b681a8d966d0a36

See more details on using hashes here.

Provenance

The following attestation bundles were made for torchfx-0.8.0-cp314-cp314-macosx_11_0_arm64.whl:

Publisher: wheels.yml on matteospanio/torchfx

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file torchfx-0.8.0-cp313-cp313-win_amd64.whl.

File metadata

  • Download URL: torchfx-0.8.0-cp313-cp313-win_amd64.whl
  • Upload date:
  • Size: 659.0 kB
  • Tags: CPython 3.13, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for torchfx-0.8.0-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 b82300d3016b5d02f0dc9e928b425d7ff7546ede53ecfc74dd2470c632940891
MD5 21e03b10e773372df96b233b6646cada
BLAKE2b-256 23b4e0e5ce813644ddc6a0b5d42fc87f92ba9bb0a8234d0a7cbd85fef5fa5f5f

See more details on using hashes here.

Provenance

The following attestation bundles were made for torchfx-0.8.0-cp313-cp313-win_amd64.whl:

Publisher: wheels.yml on matteospanio/torchfx

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file torchfx-0.8.0-cp313-cp313-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for torchfx-0.8.0-cp313-cp313-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 c011c1d28d25a6cc564cfb624720d9fd3a183cade09279819ab50175b32ccdb8
MD5 60b6af0419925b97558a1350beab2c87
BLAKE2b-256 345335df16a0158693fbf31b1490856c602623000c3ce1d53dd0de4e88a09353

See more details on using hashes here.

Provenance

The following attestation bundles were made for torchfx-0.8.0-cp313-cp313-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl:

Publisher: wheels.yml on matteospanio/torchfx

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file torchfx-0.8.0-cp313-cp313-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for torchfx-0.8.0-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 00f4cab51174ba173594e4f4e10f7590c391b02bc6ac492757290d5d28d05822
MD5 8b9ab07e16fe9063dab63d560c1bfcaa
BLAKE2b-256 90b2d1174f618da911952865b6e5125f674f85b8c055b44fed69206821d0629e

See more details on using hashes here.

Provenance

The following attestation bundles were made for torchfx-0.8.0-cp313-cp313-macosx_11_0_arm64.whl:

Publisher: wheels.yml on matteospanio/torchfx

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file torchfx-0.8.0-cp312-cp312-win_amd64.whl.

File metadata

  • Download URL: torchfx-0.8.0-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 659.0 kB
  • Tags: CPython 3.12, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for torchfx-0.8.0-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 d2bca9c0ceea178162f48bd633638e1385132309796514f5cd67813833de009e
MD5 2a6856d8854945f80937bf3394b1eca4
BLAKE2b-256 d97b5f0882392ecbc99f30c2f217e76be26d693d0ea4dbe4b7566ae15192395f

See more details on using hashes here.

Provenance

The following attestation bundles were made for torchfx-0.8.0-cp312-cp312-win_amd64.whl:

Publisher: wheels.yml on matteospanio/torchfx

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file torchfx-0.8.0-cp312-cp312-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for torchfx-0.8.0-cp312-cp312-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 a45fcb3482ceae8b20a3d36f416898fc0fb7a2fdb87a1b45091722e96ea93ec3
MD5 22e15dccd06837d459b69976b58300ed
BLAKE2b-256 19eb81ecff71d11546cce1c87f160671a02b6a04b2fa120eead52608ba51c0ce

See more details on using hashes here.

Provenance

The following attestation bundles were made for torchfx-0.8.0-cp312-cp312-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl:

Publisher: wheels.yml on matteospanio/torchfx

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file torchfx-0.8.0-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for torchfx-0.8.0-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 c21f9a29c9eb770b9d683824bbe10c02fe3030e86882ae0b58595f8228e12d2e
MD5 2ac120704a93e466e372ecef6af7ff82
BLAKE2b-256 05ef713fc2d6715c8af5e0ae31a3b7fb432c2743d4e20cab47dfa664146bef9b

See more details on using hashes here.

Provenance

The following attestation bundles were made for torchfx-0.8.0-cp312-cp312-macosx_11_0_arm64.whl:

Publisher: wheels.yml on matteospanio/torchfx

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file torchfx-0.8.0-cp311-cp311-win_amd64.whl.

File metadata

  • Download URL: torchfx-0.8.0-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 657.7 kB
  • Tags: CPython 3.11, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for torchfx-0.8.0-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 f72f84a8f690c3af4e32fd6dc2380bc827bde31406a4e0c87b1681c2c8ff4ebf
MD5 ea99a45d20a779f0217d521bf7c953bf
BLAKE2b-256 a5d88f010908ce86f57df82428ae2be4e7a5e031cda3131cd792062ed7178aac

See more details on using hashes here.

Provenance

The following attestation bundles were made for torchfx-0.8.0-cp311-cp311-win_amd64.whl:

Publisher: wheels.yml on matteospanio/torchfx

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file torchfx-0.8.0-cp311-cp311-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for torchfx-0.8.0-cp311-cp311-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 bd5b80ebc1b40c5fe07fe649b8626137d0d971a83e5e26251943ca16a872ad75
MD5 ec6f2ce6ed1729458d404f621c152f5a
BLAKE2b-256 8419f94f926e4492ca67886fce39ef616b584c93fccb371125c2f96403078264

See more details on using hashes here.

Provenance

The following attestation bundles were made for torchfx-0.8.0-cp311-cp311-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl:

Publisher: wheels.yml on matteospanio/torchfx

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file torchfx-0.8.0-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for torchfx-0.8.0-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 c12a121416c14ce3fb0d3df67098cc3e0ab3add71b15c13c2199d8922d3099fa
MD5 3a11562dc655ae2230d6dc3449fbac97
BLAKE2b-256 10c257eac4c43113929d4cb1b0c902d4bbe9d2027a6efce991d39ba2d8adf419

See more details on using hashes here.

Provenance

The following attestation bundles were made for torchfx-0.8.0-cp311-cp311-macosx_11_0_arm64.whl:

Publisher: wheels.yml on matteospanio/torchfx

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file torchfx-0.8.0-cp310-cp310-win_amd64.whl.

File metadata

  • Download URL: torchfx-0.8.0-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 656.7 kB
  • Tags: CPython 3.10, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for torchfx-0.8.0-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 8a70acc23900f4a18c3b57ec0083ef9de732fc774a42ea58f76d1ccc00d6a430
MD5 7e204ec73a4226707ae3b0c38910d549
BLAKE2b-256 e3d57167bc7cbe9640a8456b957d1e28ed99637fd9312b6467017d0fbd95f171

See more details on using hashes here.

Provenance

The following attestation bundles were made for torchfx-0.8.0-cp310-cp310-win_amd64.whl:

Publisher: wheels.yml on matteospanio/torchfx

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file torchfx-0.8.0-cp310-cp310-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for torchfx-0.8.0-cp310-cp310-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 7e83fcada66266eaf904128bdf628e587aca7e84bd252c1d3f0d68efa7750551
MD5 b51594d92c4e0095b4b683f0adc22419
BLAKE2b-256 b3a0e7ac7581f78b9fd4c5df431aca28d85882ee240961fe5603e32fb0a65a86

See more details on using hashes here.

Provenance

The following attestation bundles were made for torchfx-0.8.0-cp310-cp310-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl:

Publisher: wheels.yml on matteospanio/torchfx

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file torchfx-0.8.0-cp310-cp310-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for torchfx-0.8.0-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 16a660cb7d999315a25e9cf65add9e0a9f70210fa829deab0c6e49a1e3287829
MD5 770648984dd91d38617b7512a0c6bb13
BLAKE2b-256 ed69c17bb7299854b76c808c163aeb30e3c6450a3e655bee653da3336f8bd6c0

See more details on using hashes here.

Provenance

The following attestation bundles were made for torchfx-0.8.0-cp310-cp310-macosx_11_0_arm64.whl:

Publisher: wheels.yml on matteospanio/torchfx

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page