RepositoryPython
KinWaiCheuk

KinWaiCheuk/nnAudio

Audio processing by using pytorch 1D convolution network

1.1kstars
98forks
21issues
2views

Featured achievements

The project's latest awards

1
TINIX TRENDING·Topic: preprocessing

#1 Repository of the month

1
TINIX TRENDING·Topic: stft

#1 Repository of the month

1
TINIX TRENDING·Topic: cqt-spectrogram

#1 Repository of the month

New version available

A new version of nnAudio has been released

https://github.com/AMAAI-Lab/nnAudio2

It is being actively maintained by my PhD supervisor Dorien Herremans and her lab. Feel free to check it out!

🚨 Maintainers wanted

This project has grown beyond what one person can maintain.

Due to time constraints, the original author is no longer able to do regular code review. We are looking for contributors who can help with:

  • Code review
  • Issue triage
  • Ongoing maintenance

If you're interested, please comment on this issue to introduce yourself.

nnAudio

nnAudio is an audio processing toolbox using PyTorch convolutional neural network as its backend. By doing so, spectrograms can be generated from audio on-the-fly during neural network training and the Fourier kernels (e.g. or CQT kernels) can be trained. Full details of nnAudio can be found in our paper. You can use nnAudio for free, however, if you use this library, please cite the paper as per the reference provided below.

Kapre has a similar concept in which they also use 1D convolutional neural network to extract spectrograms based on Keras. Other GPU audio processing tools are torchaudio and tf.signal. But they are not using a neural network approach, and hence the Fourier basis can not be trained. As of PyTorch 1.6.0, torchaudio is still very difficult to install under the Windows environment due to sox. nnAudio is a more compatible audio processing tool across different operating systems since it relies mostly on PyTorch convolutional neural network. The name of nnAudio comes from torch.nn

Installation

pip install git+https://github.com/KinWaiCheuk/nnAudio.git#subdirectory=Installation

or

pip install nnaudio==0.3.4

Documentation

https://kinwaicheuk.github.io/nnAudio/index.html

Comparison with other libraries

FeaturennAudiotorch.stftkapretorchaudiotf.signaltorch-stftlibrosa
Trainable✅❌✅❌❌✅❌
Differentiable✅✅✅✅✅✅❌
Linear frequency STFT✅✅✅✅✅✅✅
Logarithmic frequency STFT✅❌✅❌❌❌❌
Inverse STFT✅✅✅✅✅✅✅
Griffin-Lim✅❌❌✅✅❌✅
Mel✅❌✅✅✅❌✅
MFCC✅❌❌✅✅❌✅
CQT✅❌❌❌❌❌✅
VQT✅❌❌❌❌❌✅
Gammatone✅❌❌❌❌❌❌
CFP1✅❌❌❌❌❌❌
GPU support✅✅✅✅✅✅❌

✅: Fully support ☑️: Developing (only available in dev version) ❌: Not support

1 Combining Spectral and Temporal Representations for Multipitch Estimation of Polyphonic Music

News & Changelog

To view the full changelog, please go to CHANGELOG.md

version 0.3.1 (24 Dec 2021):

  1. Added VQT feature #113

version 0.3.0 (19 Nov 2021):

  1. Changed module naming. nnAudio.Spectrogram will be replaced by nnAudio.features in the future releases. Currently, various spectrogram types are accessible via both methods.

Please cite nnAudio paper if you use it

The paper describing the release of nnAudio is available on IEEE Access

K. W. Cheuk, H. Anderson, K. Agres and D. Herremans, "nnAudio: An on-the-Fly GPU Audio to Spectrogram Conversion Toolbox Using 1D Convolutional Neural Networks," in IEEE Access, vol. 8, pp. 161981-162003, 2020, doi: 10.1109/ACCESS.2020.3019084.

BibTex

@ARTICLE{9174990,
  author={K. W. {Cheuk} and H. {Anderson} and K. {Agres} and D. {Herremans}},
  journal={IEEE Access}, 
  title={nnAudio: An on-the-Fly GPU Audio to Spectrogram Conversion Toolbox Using 1D Convolutional Neural Networks}, 
  year={2020},
  volume={8},
  number={},
  pages={161981-162003},
  doi={10.1109/ACCESS.2020.3019084}}

Call for Contributions

nnAudio is a fast-growing package. With the increasing number of feature requests, we welcome anyone who is familiar with digital signal processing and neural network to contribute to nnAudio. The current list of pending features includes:

  1. Invertible Constant Q Transform (CQT)

(Quick tips for unit test: cd inside Installation folder, then type pytest. You need at least 1931 MiB GPU memory to pass all the unit tests)

Alternatively, you may also contribute by:

  1. Making a better demonstration code or tutorial

Dependencies

Numpy >= 1.14.5

Scipy >= 1.2.0

PyTorch >= 1.6.0 (Griffin-Lim only available after 1.6.0)

Python >= 3.6

librosa = 0.7.0 (Theoretically nnAudio depends on librosa. But we only need to use a single function mel from librosa.filters. To save users troubles from installing librosa for this single function, I just copy the chunk of functions corresponding to mel in my code so that nnAudio runs without the need to install librosa)

Other similar libraries

Kapre

torch-stft

Similar Projects

Discover other similar projects and AI models.

RepositoryC++
tensorflow/tensorflow

An Open Source Machine Learning Framework for Everyone

201.9k
Dec 1, 2026
Modelsentence-similarity
sentence-transformers/all-MiniLM-L6-v2

all-MiniLM-L6-v2 This is a sentence-transformers(https://www.SBERT.net) model: It maps sentences & paragraphs to a 384 dimensional dense vector space and can be used for tasks like clustering or semantic search. Usage (Sentence-Transformers) Using t...

♥0
156.6M
Jun 1, 2026
RepositoryPython
Anjok07/ultimatevocalremovergui

GUI for a Vocal Remover that uses Deep Neural Networks.

27.5k
Oct 6, 2026
RepositoryPython
huggingface/transformers

🤗 Transformers: the model-definition framework for state-of-the-art machine learning models in text, vision, audio, and multimodal models, for both inference and training.

169.5k
Dec 1, 2026
RepositoryPython
pytorch/pytorch

Tensors and Dynamic neural networks in Python with strong GPU acceleration

105.8k
Dec 1, 2026
RepositoryC++
hqrrr/PerceptoMap

From frequencies to feeling

84
Nov 30, 2026
RepositoryJupyter Notebook
zafarrafii/Zaf-Python

Zafar's Audio Functions in Python for audio signal analysis: STFT, inverse STFT, mel filterbank, mel spectrogram, MFCC, CQT kernel, CQT spectrogram, CQT chromagram, DCT, DST, MDCT, inverse MDCT.

59
Aug 8, 2025
RepositoryPython
Comfy-Org/ComfyUI

The most powerful and modular diffusion model GUI, api and backend with a graph/nodes interface. The fastest local inference engine in the world.

149.8k
Dec 3, 2026
RepositoryPython
vllm-project/vllm

A high-throughput and memory-efficient inference and serving engine for LLMs

98.0k
Dec 2, 2026