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.0.tar.gz (734.9 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.0-cp314-cp314-win_amd64.whl (651.8 kB view details)

Uploaded CPython 3.14Windows x86-64

torchfx-0.7.0-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.0-cp314-cp314-macosx_11_0_arm64.whl (313.1 kB view details)

Uploaded CPython 3.14macOS 11.0+ ARM64

torchfx-0.7.0-cp313-cp313-win_amd64.whl (637.7 kB view details)

Uploaded CPython 3.13Windows x86-64

torchfx-0.7.0-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.0-cp313-cp313-macosx_11_0_arm64.whl (313.0 kB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

torchfx-0.7.0-cp312-cp312-win_amd64.whl (637.7 kB view details)

Uploaded CPython 3.12Windows x86-64

torchfx-0.7.0-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.0-cp312-cp312-macosx_11_0_arm64.whl (313.0 kB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

torchfx-0.7.0-cp311-cp311-win_amd64.whl (636.1 kB view details)

Uploaded CPython 3.11Windows x86-64

torchfx-0.7.0-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.0-cp311-cp311-macosx_11_0_arm64.whl (312.0 kB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

torchfx-0.7.0-cp310-cp310-win_amd64.whl (635.0 kB view details)

Uploaded CPython 3.10Windows x86-64

torchfx-0.7.0-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.0-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.0.tar.gz.

File metadata

  • Download URL: torchfx-0.7.0.tar.gz
  • Upload date:
  • Size: 734.9 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.0.tar.gz
Algorithm Hash digest
SHA256 d9660aa6429bbfd60da53b5a7603095597851943026206ec06183f200af92c8b
MD5 517e0feee34564069111d93fb305339e
BLAKE2b-256 46898dd5bdb483e04f8f06c3d507484c1ed9b540c6dadbd2a249f0a5c3a76e52

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: torchfx-0.7.0-cp314-cp314-win_amd64.whl
  • Upload date:
  • Size: 651.8 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.0-cp314-cp314-win_amd64.whl
Algorithm Hash digest
SHA256 0d2a3cb6884f80fb54c70bd79d67387bcf969ffcec0ea33d4e0561aa2c398b81
MD5 4a984be08dc7b1a8de25d5865a84c5be
BLAKE2b-256 2f1607faf498e3b8117e86490124bded6df1d1245e213150911868c9b81d4ffd

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for torchfx-0.7.0-cp314-cp314-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 78e6284fafa8b49d217e0e8d14d6af159a83ca269eec44a4de3beb4937236cc0
MD5 a076fa68ce86a913b6fa94f5fc9f4763
BLAKE2b-256 a8ec946dbb033d3a22a667503032477713871f7afbec28d30ae6143cda647588

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for torchfx-0.7.0-cp314-cp314-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 add018d8c55bbf313639d27151641daa77c68adc18b256865c17c2e0a0fc18cc
MD5 322df2d63abfa9b19de8956f12ff2fc8
BLAKE2b-256 8758dc054a48ea5741c36be76c45d6d9d6ac93c4b84c82966df998155c8f5722

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: torchfx-0.7.0-cp313-cp313-win_amd64.whl
  • Upload date:
  • Size: 637.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.7.0-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 8ab006e4afcf68bd261daff721efc8dabe200b9d96b13a8283fd6231f4687c8d
MD5 c45d3d6ab6199a33e55e08f703c109df
BLAKE2b-256 dbdeb924e6300155e28aedf173a71e72a21efbdef1e074176e2385655970d8fd

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for torchfx-0.7.0-cp313-cp313-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 997a6410c2b0a094b95637fb5898097d032f9c3a0c512d47230999c25dfd9629
MD5 3bde1a438e0d48aaf0967d44bcce9251
BLAKE2b-256 4da29c69260ca595dbeb148259f5f0090b780c4c50925ca068832301e92d7902

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for torchfx-0.7.0-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 f6366241774d99d2b9336463f00088e7f540602ebffe6056e7137b57f4808c16
MD5 fd3b8e8d7326e664219af2e49fcf09ac
BLAKE2b-256 fdf8bbc4dd80ff1f37924071b2dfe7254556d5b20109c2953f49ae17d20348ae

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: torchfx-0.7.0-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 637.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.7.0-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 a4240b9e95681ccff2df7678901363d8eb139b4c835501e5bb8d8f4a8db9e4b3
MD5 065472d23cdf45c372d8a3b03b88209d
BLAKE2b-256 ca80cdb2aa01a52b3374a02114ff7d1eff878a3ce3730a9ee7ccf06aa7845c98

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for torchfx-0.7.0-cp312-cp312-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 3119062581949eff4385539604582b9ea4f1a549472cf44302fef2b808601819
MD5 77481d1b973f004e1e0497ea7134921a
BLAKE2b-256 cb583bfadcfcaa3727dcd31fe44d9394c9e7ea2f3b81df9ace3e7e5c2ff44806

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for torchfx-0.7.0-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 80680ef2da7bceca61b3c918903675f6505a1deec4d21c9e8b3a970dec1c51e3
MD5 6b5c32f6bc668feb563ae3c4213625e4
BLAKE2b-256 f6c03e87b477374b7ec7c7656a54fa6e163bda28cc90bf3070f30851f0294144

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: torchfx-0.7.0-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 636.1 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.0-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 41706664f857c3b51dbd1ce5ae0491376c8a2c0ace64a931a159471a9f2ee271
MD5 70723696ce5ecb09093670c3a0019a1b
BLAKE2b-256 fc93dc1d23db5259a6bfedabab3297d9b47db40308a812b3766ff56e64762b7c

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for torchfx-0.7.0-cp311-cp311-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 11df0ae8e1be787ebc7010a0bcded273d29935e13b54165718ee3165c4f28043
MD5 e7aea69bb580c070020c01b9970ddf72
BLAKE2b-256 39568fec22ab10ea87401acccf3ab39558525156849f0003d51c273995023c8b

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for torchfx-0.7.0-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 c4253963f10e9719a3ee8e4277d93c39164794aa6daf6778e39bba08fa4ea085
MD5 b45577e67f434292c2cf8c3c2292b125
BLAKE2b-256 9bd1b7e391e5f31fdaa788fa4d0825e1211b7d8405a49b3e36b1f5a44de85c90

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: torchfx-0.7.0-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 635.0 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.0-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 508f7dccbbeac522f377613d84e267c6460e94312496c7d8ad49eaee25c482a6
MD5 009129224ac2dd641eedf9d685c8962c
BLAKE2b-256 e806fbf29906c13710e1299b8d8cf9c91901991287204ba3209004de8879193d

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for torchfx-0.7.0-cp310-cp310-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 f7798ac13f1e15db7e63c6a1dfff8b3fc5c38b4450bbe702273e54b1e3dcbf3c
MD5 1aa53a046c9dd7f8ea0ef01b4550de13
BLAKE2b-256 9f48ec3b9273ca30f9e97da5e0f387315a68c8d27b06263a8e6d2fd5d4805c6b

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for torchfx-0.7.0-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 4788d53a74e1d9ffcfceffded3d7de653c75680e9716fd86269a78f66b72e630
MD5 3a4a16be630455d046b03a5f3f60fe3f
BLAKE2b-256 5753f40446027c0ae9c126b9f2991f05ecde413acc321e0a6c06495e74cdf05a

See more details on using hashes here.

Provenance

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