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:

@misc{spanio2025torchfxmodernapproachaudio,
  title={TorchFX: A modern approach to Audio DSP with PyTorch and GPU acceleration},
  author={Matteo Spanio and Antonio Rodà},
  year={2025},
  eprint={2504.08624},
  archivePrefix={arXiv},
  primaryClass={eess.AS},
  url={https://arxiv.org/abs/2504.08624},
}

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.3.tar.gz (607.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.5.3-cp314-cp314-win_amd64.whl (575.4 kB view details)

Uploaded CPython 3.14Windows x86-64

torchfx-0.5.3-cp314-cp314-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl (363.5 kB view details)

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

torchfx-0.5.3-cp314-cp314-macosx_11_0_arm64.whl (242.1 kB view details)

Uploaded CPython 3.14macOS 11.0+ ARM64

torchfx-0.5.3-cp313-cp313-win_amd64.whl (562.3 kB view details)

Uploaded CPython 3.13Windows x86-64

torchfx-0.5.3-cp313-cp313-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl (363.5 kB view details)

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

torchfx-0.5.3-cp313-cp313-macosx_11_0_arm64.whl (242.0 kB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

torchfx-0.5.3-cp312-cp312-win_amd64.whl (562.3 kB view details)

Uploaded CPython 3.12Windows x86-64

torchfx-0.5.3-cp312-cp312-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl (363.6 kB view details)

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

torchfx-0.5.3-cp312-cp312-macosx_11_0_arm64.whl (241.9 kB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

torchfx-0.5.3-cp311-cp311-win_amd64.whl (561.4 kB view details)

Uploaded CPython 3.11Windows x86-64

torchfx-0.5.3-cp311-cp311-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl (363.0 kB view details)

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

torchfx-0.5.3-cp311-cp311-macosx_11_0_arm64.whl (241.1 kB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

torchfx-0.5.3-cp310-cp310-win_amd64.whl (560.5 kB view details)

Uploaded CPython 3.10Windows x86-64

torchfx-0.5.3-cp310-cp310-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl (362.9 kB view details)

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

torchfx-0.5.3-cp310-cp310-macosx_11_0_arm64.whl (239.7 kB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

File details

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

File metadata

  • Download URL: torchfx-0.5.3.tar.gz
  • Upload date:
  • Size: 607.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.5.3.tar.gz
Algorithm Hash digest
SHA256 a77230d33fcdbc202efdb218b681e87faa81616471c70602ceba10700117554c
MD5 5b3a6d088e158c215a42e18b43eaa1a2
BLAKE2b-256 186f88749355133f2098051d3c8a8a88c00f686fe1d1ba584d5a30f8a7e37e44

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: torchfx-0.5.3-cp314-cp314-win_amd64.whl
  • Upload date:
  • Size: 575.4 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.3-cp314-cp314-win_amd64.whl
Algorithm Hash digest
SHA256 1acd4a1c110123b1eecd381f38de57b8b8abfb5360961c81b5422f649091c6b9
MD5 8dad20fd6395d6a88bc032968cf56fa8
BLAKE2b-256 0d28d21abf1ba5efdb71f02548a2efe296a535bffeb09b3b9c423e150699297e

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for torchfx-0.5.3-cp314-cp314-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 2560a417c01bb93fcc51839cf4e82e2805d8b13bf3581b1a5afe50a637fa9b88
MD5 7b7f35025006c6adf8d50e253b484ee1
BLAKE2b-256 d526d1f9c31a8168502108cbc7969dedef2430e0d970354105b801a0690deacc

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for torchfx-0.5.3-cp314-cp314-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 4953c4ae04bfeb9b110eef1be17de0aaf3543d6180575db0304f6c185f5b23b0
MD5 c6ca39cd67dc3f9edddf5d91ed6a7431
BLAKE2b-256 e9982680855b7a38f8add75d45bda8aa679aed6b58846a129188d887d39969bf

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: torchfx-0.5.3-cp313-cp313-win_amd64.whl
  • Upload date:
  • Size: 562.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.5.3-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 51dd3d295996abb8867edd7aeec2c7a4ee28b5b2e3bc743876b10475d4520a02
MD5 2ffa68dddf4b90a4767dcfa60634905a
BLAKE2b-256 91abd4991f40e4c1529c9c6f6f3c85d6357af1ef1479be4c1b178146fe531450

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for torchfx-0.5.3-cp313-cp313-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 ad184f0c2567670f537ef8b05056355d14216aff49ac2a0ae107a158f492139d
MD5 fac8e2d27b43c64b3a54913913bf731b
BLAKE2b-256 785756834aa83f6eb3cb09de5dd8479cd1dd943b1f392dd705c175f8fb5f9368

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for torchfx-0.5.3-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 fb005c1596b416e56cdb48c4ad067d0a01711b260c0aff12400dd0a9f2f004a7
MD5 6192966cde1ee14f1d6e0638af2b2700
BLAKE2b-256 75feb06c68e3cd9bb43a8770823b74d63dca7ba38201e4e9b1baa68841aa48f2

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: torchfx-0.5.3-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 562.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.5.3-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 ed9eb5efc7ef3d4bc0684291010e30b06c4640a0ab4ce80d215ca374d1a8e174
MD5 19d3b81a082df4090ecc9b4a68b38559
BLAKE2b-256 dbf58881ba9619824690ca4e2de3192b41cd31a81d1d7455228da5dc138c8171

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for torchfx-0.5.3-cp312-cp312-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 fbce9429fb0471faf884ea6048c7e6b84dd7a606fce706786d6b004e28412316
MD5 17ef0b61539f2cd488ab78261a236817
BLAKE2b-256 982a9149561e82cafdcbe23e3410d9bd8929f2fb906f14112983c843a42d4a9a

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for torchfx-0.5.3-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 34dcf68a791ad817f592aac1e15eb8e5046a7de901a1f69841e7264cf823f063
MD5 b0bd7e95ec474d2b736e4fce55ace9e1
BLAKE2b-256 c1ead25164533bb3044599266c88cb671f1404167b10cda1013211c8843d0d6d

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: torchfx-0.5.3-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 561.4 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.3-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 60818076f35649e128cdb4b5b697ad80c2f0b3a8f1780f30a2c15563395fb0ce
MD5 58b5f5fe7894c4d2d326122ec1493f41
BLAKE2b-256 2f6a15556c64feb884d8803f746572d3911ff38cfd3cff66cbcb1b98124ef204

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for torchfx-0.5.3-cp311-cp311-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 2dfb51fe180b918335f55e5768ab476a4db82343386906aa82b41c40f515afff
MD5 5e5df1b1a1d01edc9bb4b5d6897827b3
BLAKE2b-256 939860d1a3359c321c9404069927e69267aae914992452f63823c80ffe72b4a8

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for torchfx-0.5.3-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 b72233348b2a981e05b7656fa1e6d78c8f1a15bb321f8f9f056fd89ac3cc2463
MD5 c578518d268313334d9f2801afd94a82
BLAKE2b-256 a59d4cdd91c332285ffad7a8e56c7d7199894dfe94c56d3429933f6c04e05a38

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: torchfx-0.5.3-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 560.5 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.3-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 cbba0f581172f21a694d515e3c7d51b9844bd992fbc9a3ce3291d99a87b59ad3
MD5 a93feb7b2f6f95e80389dba8e673323e
BLAKE2b-256 5baf355cfe8cfd6d3f569289b6a74ac15b29bb8232304a63716bb41138b3b0c8

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for torchfx-0.5.3-cp310-cp310-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 c901a4caa21fc5b0b0c9c497923790b2fea63244659b1aee80827a476f5da47b
MD5 4795238863a90af0abafdbbbca2b30a8
BLAKE2b-256 7008bd1ee934abcd85e45beac41558c0f6e551ced997d489ffcf80fa8734f07d

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for torchfx-0.5.3-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 470c877bc12976dcca2d90bedbc0e184ab261a2807b54961ccf4f64017f1e693
MD5 3eea8c1a960a80e6258e7df2e12d0656
BLAKE2b-256 a32bf073cfb8fe5c850e7dbdf3e3727a5ec8fddb8a3cc564ce63de60ab057a6c

See more details on using hashes here.

Provenance

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