Asteroid's filterbanks is a Python library providing various filterbank implementations for audio signal processing within deep learning contexts, primarily using PyTorch. It is designed to be a modular toolkit for researchers working on audio source separation. The library is actively maintained with frequent updates, particularly concerning PyTorch compatibility, with the current version being 0.4.0.
pip install asteroid-filterbanksVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to instantiate a `FreeFB` filterbank, wrap it with an `Encoder` to transform a waveform into a time-frequency representation, and then use a `Decoder` to reconstruct the waveform. This is a common pattern for learnable front-ends in audio processing models.
Upgrade PyTorch to version 1.8.0 or newer (e.g., `pip install torch>=1.8.0`).
Update code to handle complex number outputs from `torch.fft` (e.g., using `abs()` or `torch.view_as_real()` if magnitude/phase is needed) and retrain models if necessary to adapt to the new FFT behavior.
To create a custom filterbank, inherit from `asteroid_filterbanks.Filterbank` and implement its abstract methods. Then, instantiate `Encoder(my_custom_filterbank_instance)` or `Decoder(my_custom_filterbank_instance)`.
Consult the `make_enc_dec` documentation for correct usage of `who_is_pinv` (e.g., 'encoder', 'decoder') or manually set `is_pinv=True` on the appropriate wrapper if building the pair separately.
After installation, explicitly restart the kernel or Python process if you encounter import errors.
Thoroughly test `TorchSTFTFB` with your specific `torch.stft` parameters if ONNX export or exact matching is critical, and review its documentation for current limitations.
Install the package using pip: 'pip install asteroid-filterbanks'.
Use the correct import statement: 'from asteroid_filterbanks.stft_fb import STFTFB'.
Use the correct import statement: 'from asteroid_filterbanks.enc_dec import Encoder'.
Ensure to provide the 'n_filters' argument when initializing: 'fb = Filterbank(n_filters=64, kernel_size=16)'.
Set 'n_filters' to a positive integer: 'fb = Filterbank(n_filters=64, kernel_size=16)'.