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.6.0.tar.gz (690.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.6.0-cp314-cp314-win_amd64.whl (605.7 kB view details)

Uploaded CPython 3.14Windows x86-64

torchfx-0.6.0-cp314-cp314-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl (390.5 kB view details)

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

torchfx-0.6.0-cp314-cp314-macosx_11_0_arm64.whl (266.9 kB view details)

Uploaded CPython 3.14macOS 11.0+ ARM64

torchfx-0.6.0-cp313-cp313-win_amd64.whl (592.5 kB view details)

Uploaded CPython 3.13Windows x86-64

torchfx-0.6.0-cp313-cp313-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl (390.3 kB view details)

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

torchfx-0.6.0-cp313-cp313-macosx_11_0_arm64.whl (266.8 kB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

torchfx-0.6.0-cp312-cp312-win_amd64.whl (592.4 kB view details)

Uploaded CPython 3.12Windows x86-64

torchfx-0.6.0-cp312-cp312-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl (390.4 kB view details)

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

torchfx-0.6.0-cp312-cp312-macosx_11_0_arm64.whl (266.7 kB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

torchfx-0.6.0-cp311-cp311-win_amd64.whl (591.2 kB view details)

Uploaded CPython 3.11Windows x86-64

torchfx-0.6.0-cp311-cp311-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl (390.0 kB view details)

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

torchfx-0.6.0-cp311-cp311-macosx_11_0_arm64.whl (265.9 kB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

torchfx-0.6.0-cp310-cp310-win_amd64.whl (590.1 kB view details)

Uploaded CPython 3.10Windows x86-64

torchfx-0.6.0-cp310-cp310-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl (389.8 kB view details)

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

torchfx-0.6.0-cp310-cp310-macosx_11_0_arm64.whl (264.5 kB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

File details

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

File metadata

  • Download URL: torchfx-0.6.0.tar.gz
  • Upload date:
  • Size: 690.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.6.0.tar.gz
Algorithm Hash digest
SHA256 ed28a348d0f1e73f60d972a9c4a1509c3af05267a93511ef7318bbf719533009
MD5 427a7fa2a5f3aabf32c20b524ce6df7c
BLAKE2b-256 4e489fc6b8a5e572b5f12e76dd3230d22168cd73f37b2a5b0812d94b785f3024

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: torchfx-0.6.0-cp314-cp314-win_amd64.whl
  • Upload date:
  • Size: 605.7 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.6.0-cp314-cp314-win_amd64.whl
Algorithm Hash digest
SHA256 9c31d1d56c1176034564ab1d7e85e089fa8372d4fae61a7a60c3a29c27eb2ae5
MD5 439567832d4fe53c115cd2bf33ae7651
BLAKE2b-256 e2f6536cdba441083b97955141d7c282b87b2437443269c45abd98e9fe16b61e

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for torchfx-0.6.0-cp314-cp314-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 455bd712369c046287d5e8dccf0acd541829554c33d6670d169a5e52d2ae620a
MD5 2c62cd4bb95b0af99c7c663df40f552c
BLAKE2b-256 ac4b82d0f954b5767320b47d3e63b51c5e97f8e7da63e20c13401dbebd072b77

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for torchfx-0.6.0-cp314-cp314-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 19e0efc76f2614001e5858b02ac41207276442a751e5bda156fbb5c540dc7643
MD5 a3a84fc4c686ff657f861027fa9db208
BLAKE2b-256 4181ef9b2ca5ee332407c04609d943a883ccd4c9bbd391ae4203439abe14f5d4

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: torchfx-0.6.0-cp313-cp313-win_amd64.whl
  • Upload date:
  • Size: 592.5 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.6.0-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 0467804f023eb34e4b9b7303d5dbcf9ee5c20e26e0614d898935ba826e361643
MD5 99660c91624ff5b6c83a0213bba41052
BLAKE2b-256 46fca0bb87c357a6f26ff9a76e70b407707501bcf4862cfb6de0251c4783d08d

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for torchfx-0.6.0-cp313-cp313-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 7210dc7e8854bc10be9e8cc8938f0c0e5b41a04d45a2ba8698afddc1ca343d71
MD5 f9933881f8c384b81e43f15df5189d1b
BLAKE2b-256 55a990c20d51feb4ccff38a4af9a22a6df16d593b637b2bbbfd1fe0089827abd

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for torchfx-0.6.0-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 af9d8c6f5c093a8d7ec21ffb6a6fb7697c410493194e30e90148dc19c93b5cd3
MD5 5bad8c4d86f12655c224935de60e2c70
BLAKE2b-256 6d05e426689f52139f9a63b5027e6ba67cdc3a5b9321afc2bc9f3b0517c031ac

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: torchfx-0.6.0-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 592.4 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.6.0-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 7e1f2ca352625e3c187dd01de091f6f76280fee43ed3672b30dd41f5a8b67ff6
MD5 c8e955920d90e744fd7b6af7736f7e5e
BLAKE2b-256 a9460e0accea5d9834b02a86aa92fae4491a712d86fb6d3dc2e7e144a1bac691

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for torchfx-0.6.0-cp312-cp312-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 8aba6458d45ef79a59195565cede5b001d7641e25acc58a3b525a8cd684cf06e
MD5 3baf937ca64a0828fc6b184f580bbf9e
BLAKE2b-256 b40256898fbef7e30e74fa72480c1be0eb7ac3778ec1259fdc41197f5148f6d3

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for torchfx-0.6.0-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 0fecea5823db46ea71d13aa8f312a732e740066a9ea018859beaaa63794361c2
MD5 3c1db94fecf2e14c9463e7189ab2d4c4
BLAKE2b-256 95687a03885956c8618daeb8e1e320bb5ddfa2380ae12efa89ff4dea34635447

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: torchfx-0.6.0-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 591.2 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.6.0-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 e33f2ae3feb9166a599ab60cb885160fcb99688de1b4316aa763e007ae1fdc28
MD5 9273bfa926e2b60c2af0ae3d2489bff7
BLAKE2b-256 4530f73443332e05d13f0b1a5dfa29dddf722ef94c8c13fbe24d01803489f63e

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for torchfx-0.6.0-cp311-cp311-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 0d8690ab92a4455146edcb3cae5973fd54f46475fe50a81289780ff30edbc131
MD5 5e74429e2de0d6141d96933edca2545b
BLAKE2b-256 68df18953b5f5ea990b80139d9d46216fe2475e8fe040d23b57369af5d7bb7c6

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for torchfx-0.6.0-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 ed9f8d4697406732908ea0d9c30ad274534bf777333ac2e5d45960e371ec6871
MD5 c6d5bf72480cdfe364eac001412b47f0
BLAKE2b-256 079a4d10249e978177292ead0634c57685c8635506d5def0c9eeb1d9d33049c7

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: torchfx-0.6.0-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 590.1 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.6.0-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 110879e02bfe3005991fc7a755de55429ae3b8db15930b976809997a8339821b
MD5 a7d3c7bfa3839bbf453b8be8c797e8fd
BLAKE2b-256 d6a04817ecba32d6c18a8b20f24895af09f2d366f9c5ca97bef023fc4ec48059

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for torchfx-0.6.0-cp310-cp310-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 79de6336316432235b7299523452395a59bd02fd82f83f0e3da3dde117eb0d00
MD5 e2fccbda0aa4111d202675ea1ae2f9b4
BLAKE2b-256 10e00e87e33920a9798a01580e9e4ba6f3937e69f2e417d4deb38ca3923db793

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for torchfx-0.6.0-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 83348ea62ab71595e04c90ccf3a18c6fdc0dbe140676cd5dcfb6336c8db881ee
MD5 76d7fd6a53d84b0ac3d9129793d42bdf
BLAKE2b-256 c8c8bf1e0d287c17477b66600a18567e3233e69cfe11659342bdfb3ab0cabb2e

See more details on using hashes here.

Provenance

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