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 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.5.4.tar.gz (625.0 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.5.4-cp314-cp314-win_amd64.whl (591.9 kB view details)

Uploaded CPython 3.14Windows x86-64

torchfx-0.5.4-cp314-cp314-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl (376.1 kB view details)

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

torchfx-0.5.4-cp314-cp314-macosx_11_0_arm64.whl (252.9 kB view details)

Uploaded CPython 3.14macOS 11.0+ ARM64

torchfx-0.5.4-cp313-cp313-win_amd64.whl (578.7 kB view details)

Uploaded CPython 3.13Windows x86-64

torchfx-0.5.4-cp313-cp313-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl (376.0 kB view details)

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

torchfx-0.5.4-cp313-cp313-macosx_11_0_arm64.whl (252.8 kB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

torchfx-0.5.4-cp312-cp312-win_amd64.whl (578.7 kB view details)

Uploaded CPython 3.12Windows x86-64

torchfx-0.5.4-cp312-cp312-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl (376.1 kB view details)

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

torchfx-0.5.4-cp312-cp312-macosx_11_0_arm64.whl (252.8 kB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

torchfx-0.5.4-cp311-cp311-win_amd64.whl (577.5 kB view details)

Uploaded CPython 3.11Windows x86-64

torchfx-0.5.4-cp311-cp311-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl (375.5 kB view details)

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

torchfx-0.5.4-cp311-cp311-macosx_11_0_arm64.whl (251.9 kB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

torchfx-0.5.4-cp310-cp310-win_amd64.whl (576.4 kB view details)

Uploaded CPython 3.10Windows x86-64

torchfx-0.5.4-cp310-cp310-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl (375.5 kB view details)

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

torchfx-0.5.4-cp310-cp310-macosx_11_0_arm64.whl (250.6 kB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

File details

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

File metadata

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

File hashes

Hashes for torchfx-0.5.4.tar.gz
Algorithm Hash digest
SHA256 f4181201db8e3f01a5179f1bb9b3adbc48a3db500f11535a0308580aba15456d
MD5 e5c44dc40bff8c919f083615c0fde87d
BLAKE2b-256 418959ec6d654c3c942a8d0836fddc7a8123a5deb00a89f0f9d0e1e97d20bcee

See more details on using hashes here.

Provenance

The following attestation bundles were made for torchfx-0.5.4.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.5.4-cp314-cp314-win_amd64.whl.

File metadata

  • Download URL: torchfx-0.5.4-cp314-cp314-win_amd64.whl
  • Upload date:
  • Size: 591.9 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.5.4-cp314-cp314-win_amd64.whl
Algorithm Hash digest
SHA256 dc07fa0df8a1f25ae4f3146f59fbed1e24c58941a71ae270a74595eda221d6f1
MD5 07dfd065b2a58ea21260d9545718c030
BLAKE2b-256 5e4fb3f824513a0a123ece62255475beea003ad0459d9ad3914295146ff50658

See more details on using hashes here.

Provenance

The following attestation bundles were made for torchfx-0.5.4-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.5.4-cp314-cp314-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for torchfx-0.5.4-cp314-cp314-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 54b48c37fb9540d6980af588754895df36e28e4d7a14c10f178557d8ea073984
MD5 9f36e34d2c9751bb350e037bb2611843
BLAKE2b-256 7e2bdcd3d0ba6923f9fe1affe4b828130f99763964853a835235ea39cff9c141

See more details on using hashes here.

Provenance

The following attestation bundles were made for torchfx-0.5.4-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.5.4-cp314-cp314-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for torchfx-0.5.4-cp314-cp314-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 7438eed4d198a872f7c8671fb734c22f5cc036f83b2ab30bbe1a9c2f312ec401
MD5 86b2c0feaef58d05f6fb97a125fd62b4
BLAKE2b-256 830f297895f486f7131955ea3f0e00c2fa0489ceaebec45ed92cce5190654cf5

See more details on using hashes here.

Provenance

The following attestation bundles were made for torchfx-0.5.4-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.5.4-cp313-cp313-win_amd64.whl.

File metadata

  • Download URL: torchfx-0.5.4-cp313-cp313-win_amd64.whl
  • Upload date:
  • Size: 578.7 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.5.4-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 645d8b57e6e1cb26b60898a897e03de7690ffc9be0b61560ee67c6d62178c62b
MD5 38e852ebe61eb3ac4e740e06b2475f86
BLAKE2b-256 4f798e35b3397fb42393684be84d0e772ae70e3e2de01a25f4f3ce9d015a1131

See more details on using hashes here.

Provenance

The following attestation bundles were made for torchfx-0.5.4-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.5.4-cp313-cp313-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for torchfx-0.5.4-cp313-cp313-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 fa486be39b8c5ed0986dbfa861e9e2ea6abfa9067181963cf056229a375076ec
MD5 a757d238180997fbafe1c4aae5f0ad4a
BLAKE2b-256 d2acc8dc39ffa2ddfffdd34ea1fadf3f082611f8720347216e48873e10fbd7e3

See more details on using hashes here.

Provenance

The following attestation bundles were made for torchfx-0.5.4-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.5.4-cp313-cp313-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for torchfx-0.5.4-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 9704188d8b094c66ee935c76dc2ae423978a6160ba07d2769b43eb5bd1c39fc5
MD5 66ecc2b371364f56d56f12894661b1a3
BLAKE2b-256 6cb2c5334b341ba7097d2d088b3bfde0d94de6b7c167b9e81e542705e6d4f94a

See more details on using hashes here.

Provenance

The following attestation bundles were made for torchfx-0.5.4-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.5.4-cp312-cp312-win_amd64.whl.

File metadata

  • Download URL: torchfx-0.5.4-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 578.7 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.5.4-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 4af629a1e6938f89a8cb2225d8f200854cd26a182f0202536dae9fe46a4aad35
MD5 094bbd8c9d0604a0c943a653e690cba8
BLAKE2b-256 4e772164d9ab83761b5c0d0731975fa92a6bbc9a36c548271e1f061d75c64ca6

See more details on using hashes here.

Provenance

The following attestation bundles were made for torchfx-0.5.4-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.5.4-cp312-cp312-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for torchfx-0.5.4-cp312-cp312-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 8ad2f5a1c9590079be11d04617098ffc9cee5a1a2279e7b637a65ef62843d50f
MD5 e270771108d6878a45596533b8c88c48
BLAKE2b-256 f2193e41badf87cdc72c154e225d1a6ddfbf08fd3ebc93365bf1e7713f607f8f

See more details on using hashes here.

Provenance

The following attestation bundles were made for torchfx-0.5.4-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.5.4-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for torchfx-0.5.4-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 de608448e7213910841dd329c59ea8007ded41750beb5476bfea23a03d5cbbb2
MD5 56c39a4a6d9c868133b47816ce7b931e
BLAKE2b-256 8729438632e4977f0b898bd4c04344295b7d77226bc9817a1e1bb6199694b6a3

See more details on using hashes here.

Provenance

The following attestation bundles were made for torchfx-0.5.4-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.5.4-cp311-cp311-win_amd64.whl.

File metadata

  • Download URL: torchfx-0.5.4-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 577.5 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.5.4-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 eebe6dfb62e30de05739642b56a6d60401b9260ba02981d9aace61ca08481916
MD5 69b11014436fbd05fbb263fe4973d686
BLAKE2b-256 0dce4a0af57d0f1d3fe7a01ee1e8a2870f099e7d90428843ed2f3c74882d433b

See more details on using hashes here.

Provenance

The following attestation bundles were made for torchfx-0.5.4-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.5.4-cp311-cp311-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for torchfx-0.5.4-cp311-cp311-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 29237a42735e973577fd525d05717ed1c80cad93c39ada5d38e4d94d10ce2ad8
MD5 45c31a6195611fbe3c4d4aa5053ffa36
BLAKE2b-256 c2a41ba25b94623856a2df251b679876bda5372d0b912ce2980c1425d434ef91

See more details on using hashes here.

Provenance

The following attestation bundles were made for torchfx-0.5.4-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.5.4-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for torchfx-0.5.4-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 b56b07b078409c1ef95da07ac236249279839a3f5a4864c827b01b1c4ccbbf13
MD5 e4f0f6e10b065a4e26827525f931ebfa
BLAKE2b-256 4c72568d2eb6758e3a1715b4e2af11a489e1d163988de5da69a89ef4e814e836

See more details on using hashes here.

Provenance

The following attestation bundles were made for torchfx-0.5.4-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.5.4-cp310-cp310-win_amd64.whl.

File metadata

  • Download URL: torchfx-0.5.4-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 576.4 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.5.4-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 c906c2910c78b96f8c585852f016a68509b02fe36608e551eff42c85bdc62266
MD5 84d07c1a3d44d1338fb6b4a58a4d222f
BLAKE2b-256 1aed8986bf354c26b3eeb50af36dc609b1959c3edf38a211cf34f5aa47f29089

See more details on using hashes here.

Provenance

The following attestation bundles were made for torchfx-0.5.4-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.5.4-cp310-cp310-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for torchfx-0.5.4-cp310-cp310-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 19cd22db4d61e4ca46403f90be647f4a81f32269a3c4a8f40d9cd6ea31c588b9
MD5 56cdd51824192728657db308cd8f2de6
BLAKE2b-256 ce8ba23c97a0840eb54987c8ae42e8fe2576b5db42b7dc277cb00154794fa7b7

See more details on using hashes here.

Provenance

The following attestation bundles were made for torchfx-0.5.4-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.5.4-cp310-cp310-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for torchfx-0.5.4-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 0d0a821291b93e1e13071b7b17f642c27310c253b215034517db05a45a457382
MD5 d68120367e20281a29aa305fa5276851
BLAKE2b-256 a052d218d5dc564aa858b0568cbf7a339ee2a0fa4b98ef9e5bae3fbd98f1bd25

See more details on using hashes here.

Provenance

The following attestation bundles were made for torchfx-0.5.4-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