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.7.1.tar.gz (735.1 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.7.1-cp314-cp314-win_amd64.whl (661.5 kB view details)

Uploaded CPython 3.14Windows x86-64

torchfx-0.7.1-cp314-cp314-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl (442.7 kB view details)

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

torchfx-0.7.1-cp314-cp314-macosx_11_0_arm64.whl (313.1 kB view details)

Uploaded CPython 3.14macOS 11.0+ ARM64

torchfx-0.7.1-cp313-cp313-win_amd64.whl (647.3 kB view details)

Uploaded CPython 3.13Windows x86-64

torchfx-0.7.1-cp313-cp313-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl (442.5 kB view details)

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

torchfx-0.7.1-cp313-cp313-macosx_11_0_arm64.whl (313.0 kB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

torchfx-0.7.1-cp312-cp312-win_amd64.whl (647.3 kB view details)

Uploaded CPython 3.12Windows x86-64

torchfx-0.7.1-cp312-cp312-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl (442.6 kB view details)

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

torchfx-0.7.1-cp312-cp312-macosx_11_0_arm64.whl (313.0 kB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

torchfx-0.7.1-cp311-cp311-win_amd64.whl (645.7 kB view details)

Uploaded CPython 3.11Windows x86-64

torchfx-0.7.1-cp311-cp311-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl (441.9 kB view details)

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

torchfx-0.7.1-cp311-cp311-macosx_11_0_arm64.whl (312.0 kB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

torchfx-0.7.1-cp310-cp310-win_amd64.whl (644.6 kB view details)

Uploaded CPython 3.10Windows x86-64

torchfx-0.7.1-cp310-cp310-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl (441.9 kB view details)

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

torchfx-0.7.1-cp310-cp310-macosx_11_0_arm64.whl (310.5 kB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

File details

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

File metadata

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

File hashes

Hashes for torchfx-0.7.1.tar.gz
Algorithm Hash digest
SHA256 e246810b86f5766194a5b028deab86238891de9a4eb6829d551274a4455ecb2e
MD5 2cf62e5c1b6c327130d864538d427088
BLAKE2b-256 109165ffad71d8a471113515027050626e8bf7bd4968958777723afd58e7d265

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: torchfx-0.7.1-cp314-cp314-win_amd64.whl
  • Upload date:
  • Size: 661.5 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.7.1-cp314-cp314-win_amd64.whl
Algorithm Hash digest
SHA256 cd28d6fe9460b31c42b8b96da5e2dbaf3d7a0e45f86bf07050bb1051f1592f0f
MD5 fead679e74fa4584e7904db9272a68f4
BLAKE2b-256 8e9714e7c549e3a10213553fa1a28b6cc793da5f3cbdb852e361e4e00ba16183

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for torchfx-0.7.1-cp314-cp314-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 6af4a9329789f97ac2c33aacac95a036aed235d2d94c1efa0ba1998d93c3f450
MD5 6ef8b324a90c92adcbd5ea10560a14d6
BLAKE2b-256 408386fe5d2bde933503ed6cee9bc7e88a007ee82a354dd947bbfeeee5068384

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for torchfx-0.7.1-cp314-cp314-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 504ad37da476830a81d1ddacd9b5e32658d27a2caa0ddc9d96fb6468d2e314c3
MD5 a9185c69c7843e38355b807d261ce29e
BLAKE2b-256 0638cabbea45797e08fc41d69d98f19c7201d34ff65d271ca56e2a1f5db1f604

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: torchfx-0.7.1-cp313-cp313-win_amd64.whl
  • Upload date:
  • Size: 647.3 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.7.1-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 df61e2e90409dab52c6da0468b16f848203576237c392e05f7d22508c8eee0d4
MD5 c6d791c77266774c5af82828a30e7454
BLAKE2b-256 602a9b0af508ef984dc8813c544a1facbeb1224a14c318724a8cab2aab14ffc2

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for torchfx-0.7.1-cp313-cp313-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 7a087105ec4488051a59dc667a2301453fc2ab987b1408b1f212fe294a1d4d39
MD5 083a93b47971300b0746b02f5a591a5e
BLAKE2b-256 9f0eb937fb1a712cb33979838ba3e291ad715a669a97d70d4090cc50f1536516

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for torchfx-0.7.1-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 82bd44adf270c967da68830c247b3ee05a81ba799bd9b5ca5472a447c488e730
MD5 f94b92d09ebce8cd9e9029498570b79d
BLAKE2b-256 4fec21e7824f01a49986f82e22aa51a6ded5f5c6d4f484a422293750f4d580f5

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: torchfx-0.7.1-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 647.3 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.7.1-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 9b81839f38dec78987e4bba0dffb2105788c14aad1ecba981526e6af8df05c69
MD5 fd6c0f46298ce088c75fd25196500e4c
BLAKE2b-256 94612c092d04fb9dc83991194232677a45679ba5f6f8de5fa66a4d26d1268646

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for torchfx-0.7.1-cp312-cp312-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 0d3381068f5026571b328278696cb2c0ab4485ed7c9d48cdb098bad3c4d37dcb
MD5 1572996c6d2eef8a16e248df005ac3d4
BLAKE2b-256 5e26962f68cd80d2fd09d2c6d2c5c3bb49e90515654f98d57392a13027540511

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for torchfx-0.7.1-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 9d2bc821837cafea6b0c76e070d595761b1f2cd34849851081d09169f5b3483c
MD5 97428874d76374ddcec3800ed5ff0ac0
BLAKE2b-256 9b97f2683a3b97f6a9800aac0d330d91ead6fa1d5442880986b9ba67e6c94e6b

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: torchfx-0.7.1-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 645.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.7.1-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 7fc81a3c116c9434b12fc9666312fc2b4c459599b2513d5202cc76b9360b1d19
MD5 cdde3c0225fef3ce53652236801a3108
BLAKE2b-256 ed92aa689b8f117c31e797288f3f607465cfe3fb3c5c73c3819162bf44776409

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for torchfx-0.7.1-cp311-cp311-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 aadd21676dfea8bd6c24a444b6789103fe446b9b11e39fe756b02648096e9a06
MD5 4d6e7a640cbe65c6dd5d30c254108406
BLAKE2b-256 9ca88ad200ac639a6bb94f0be94086fe5507ad1080b55ec4a525c827d2faa3a4

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for torchfx-0.7.1-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 7467e20477b9ee4ea9ad0f5bd9241b87a110d6c6dc6a9561a559634b2f7df9e3
MD5 ae7992defcee528c541494eba15c19f1
BLAKE2b-256 0bb932d499bab6e94eccd625b198dc16c0bed8655abdbbf55386b948d5525260

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: torchfx-0.7.1-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 644.6 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.7.1-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 5e4f13c5afd86a6d06181caa5f1e7e0583b8d53ebc6f3b18d20e572e71f26a85
MD5 dc39b1d91a25b820fa91517528d6b36a
BLAKE2b-256 b5986bf8baa8e392c7d19ac82690394e871d86f55ddac29e9c6114298b68b203

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for torchfx-0.7.1-cp310-cp310-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 0a8ef6137276a149ff83eb206b673ace32a3ecba6d0283e4b672a29a15ab1b1b
MD5 a8013e9cf866cfebc4a29780e4e58cbd
BLAKE2b-256 2bed093487e4adbc43ce60fe95441bb1e00ccb955afdca6bea743e7a1f826b52

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for torchfx-0.7.1-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 e8c4a1accd3da62db2cd9b053117bb55a873ba066092676359c35f9406c6232b
MD5 f0c35f528c636e9a276d57aa417ba78e
BLAKE2b-256 84df894858c0f458b5201d4f59b2d14e6cf10723f2a3c983db54f071ca039165

See more details on using hashes here.

Provenance

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