
## About
This repository contains the official implementations of [HybrA](https://arxiv.org/abs/2408.17358) and [ISAC](https://arxiv.org/abs/2505.07709). ISAC is an invertible and stable auditory filterbank with customizable kernel size, and HybrA extends ISAC via an additional set of learnable kernels. The two filterbanks are implemented as PyTorch nn.Module and therefore easily integrable into any neural network. As an essential mathematical foundation for the construction of ISAC and HybrA, the repository contains many fast frame-theoretic functions, such as the computation of framebounds, aliasing terms, and regularizers for tightening.
## Documentation
[https://github.com/danedane-haider/HybrA-Filterbanks](https://danedane-haider.github.io/HybrA-Filterbanks/main/)
## Installation
We publish all releases on PyPi. You can install the current version by running:
```
pip install hybra
```
## Usage
Construct an ISAC and HybrA filterbank, and plot the filter frequency responses. Transform an input audio signal into the corresponding learnable time-frequency representation, and plot it.
```python
import torchaudio
from hybra import ISAC, HybrA, ISACgram
x, fs = torchaudio.load("your_audio.wav")
x = torch.tensor(x, dtype=torch.float32).unsqueeze(0)
L = x.shape[-1]
isac_fb = ISAC(kernel_size=1024, num_channels=128, L=L, fs=fs)
isac_fb.plot_response()
```
Condition number: 1.01
<img src="https://github.com/danedane-haider/HybrA-Filterbanks/blob/main/plots/ISAC_response.png?raw=true" width="100%">
```python
y = isac_fb(x)
x_tilde = isac_fb.decoder(y)
ISACgram(y, isac_fb.fc, L=L, fs=fs)
```
<img src="https://github.com/danedane-haider/HybrA-Filterbanks/blob/main/plots/ISAC_coeff.png?raw=true" width="100%">
```python
hybra_fb = HybrA(kernel_size=1024, learned_kernel_size=23, num_channels=128, L=L, fs=fs, tighten=True)
hybra_fb.plot_response()
```
Condition number: 1.06
<img src="https://github.com/danedane-haider/HybrA-Filterbanks/blob/main/plots/HybrA_response.png?raw=true" width="100%">
```python
y = hybra_fb(x)
x_tilde = hybra_fb.decoder(y)
ISACgram(y, hybra_fb.fc, L=L, fs=fs)
```
<img src="https://github.com/danedane-haider/HybrA-Filterbanks/blob/main/plots/HybrA_coeff.png?raw=true" width="100%">
It is also straightforward to include them in any model, e.g., as an encoder/decoder pair.
```python
import torch
import torch.nn as nn
import torchaudio
from hybra import HybrA
class Net(nn.Module):
def __init__(self):
super().__init__()
self.linear_before = nn.Linear(40, 400)
self.gru = nn.GRU(
input_size=400,
hidden_size=400,
num_layers=2,
batch_first=True,
)
self.linear_after = nn.Linear(400, 600)
self.linear_after2 = nn.Linear(600, 600)
self.linear_after3 = nn.Linear(600, 40)
def forward(self, x):
x = x.permute(0, 2, 1)
x = torch.relu(self.linear_before(x))
x, _ = self.gru(x)
x = torch.relu(self.linear_after(x))
x = torch.relu(self.linear_after2(x))
x = torch.sigmoid(self.linear_after3(x))
x = x.permute(0, 2, 1)
return x
class HybridfilterbankModel(nn.Module):
def __init__(self):
super().__init__()
self.nsnet = Net()
self.fb = HybrA()
def forward(self, x):
x = self.fb(x)
mask = self.nsnet(torch.log10(torch.max(x.abs()**2, 1e-8 * torch.ones_like(x, dtype=torch.float32))))
return self.fb.decoder(x*mask)
if __name__ == '__main__':
audio, fs = torchaudio.load('your_audio.wav')
model = HybridfilterbankModel()
model(audio)
```
## Citation
If you find our work valuable and use HybrA or ISAC in your work, please cite
```
@inproceedings{haider2024holdmetight,
author = {Haider, Daniel and Perfler, Felix and Lostanlen, Vincent and Ehler, Martin and Balazs, Peter},
booktitle = {Annual Conference of the International Speech Communication Association (Interspeech)},
year = {2024},
title = {Hold me tight: Stable encoder/decoder design for speech enhancement},
}
@inproceedings{haider2025isac,
author = {Haider, Daniel and Perfler, Felix and Balazs, Peter and Hollomey, Clara and Holighaus, Nicki},
title = {{ISAC}: An Invertible and Stable Auditory Filter
Bank with Customizable Kernels for ML Integration},
booktitle = {International Conference on Sampling Theory and Applications (SampTA)},
year = {2025}
}
```
Raw data
{
"_id": null,
"home_page": null,
"name": "hybra",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.10",
"maintainer_email": null,
"keywords": "Filberbank, Learned Filterbanks, Feauture Extraction, Hybrid Filterbanks, Encoder, Decoder, Auditory, Frames",
"author": "The hybra project maintainers",
"author_email": null,
"download_url": "https://files.pythonhosted.org/packages/ab/e0/52430382cb94ce99ca93f2869b81162cab25c8f47b03b9c92b176c11c225/hybra-2025.7.4.tar.gz",
"platform": null,
"description": "\n\n## About\nThis repository contains the official implementations of [HybrA](https://arxiv.org/abs/2408.17358) and [ISAC](https://arxiv.org/abs/2505.07709). ISAC is an invertible and stable auditory filterbank with customizable kernel size, and HybrA extends ISAC via an additional set of learnable kernels. The two filterbanks are implemented as PyTorch nn.Module and therefore easily integrable into any neural network. As an essential mathematical foundation for the construction of ISAC and HybrA, the repository contains many fast frame-theoretic functions, such as the computation of framebounds, aliasing terms, and regularizers for tightening. \n\n## Documentation\n[https://github.com/danedane-haider/HybrA-Filterbanks](https://danedane-haider.github.io/HybrA-Filterbanks/main/)\n\n## Installation\nWe publish all releases on PyPi. You can install the current version by running:\n```\npip install hybra\n```\n\n## Usage\nConstruct an ISAC and HybrA filterbank, and plot the filter frequency responses. Transform an input audio signal into the corresponding learnable time-frequency representation, and plot it.\n```python\nimport torchaudio\nfrom hybra import ISAC, HybrA, ISACgram\n\nx, fs = torchaudio.load(\"your_audio.wav\")\nx = torch.tensor(x, dtype=torch.float32).unsqueeze(0)\nL = x.shape[-1]\n\nisac_fb = ISAC(kernel_size=1024, num_channels=128, L=L, fs=fs)\nisac_fb.plot_response()\n```\nCondition number: 1.01\n<img src=\"https://github.com/danedane-haider/HybrA-Filterbanks/blob/main/plots/ISAC_response.png?raw=true\" width=\"100%\">\n\n```python\ny = isac_fb(x)\nx_tilde = isac_fb.decoder(y)\nISACgram(y, isac_fb.fc, L=L, fs=fs)\n```\n\n<img src=\"https://github.com/danedane-haider/HybrA-Filterbanks/blob/main/plots/ISAC_coeff.png?raw=true\" width=\"100%\">\n\n```python\n\nhybra_fb = HybrA(kernel_size=1024, learned_kernel_size=23, num_channels=128, L=L, fs=fs, tighten=True)\nhybra_fb.plot_response()\n```\nCondition number: 1.06\n<img src=\"https://github.com/danedane-haider/HybrA-Filterbanks/blob/main/plots/HybrA_response.png?raw=true\" width=\"100%\">\n\n```python\ny = hybra_fb(x)\nx_tilde = hybra_fb.decoder(y)\nISACgram(y, hybra_fb.fc, L=L, fs=fs)\n```\n\n<img src=\"https://github.com/danedane-haider/HybrA-Filterbanks/blob/main/plots/HybrA_coeff.png?raw=true\" width=\"100%\">\n\n\nIt is also straightforward to include them in any model, e.g., as an encoder/decoder pair.\n```python\nimport torch\nimport torch.nn as nn\nimport torchaudio\nfrom hybra import HybrA\n\nclass Net(nn.Module):\n def __init__(self):\n super().__init__()\n\n self.linear_before = nn.Linear(40, 400)\n\n self.gru = nn.GRU(\n input_size=400,\n hidden_size=400,\n num_layers=2,\n batch_first=True,\n )\n\n self.linear_after = nn.Linear(400, 600)\n self.linear_after2 = nn.Linear(600, 600)\n self.linear_after3 = nn.Linear(600, 40)\n\n\n def forward(self, x):\n\n x = x.permute(0, 2, 1)\n x = torch.relu(self.linear_before(x))\n x, _ = self.gru(x)\n x = torch.relu(self.linear_after(x))\n x = torch.relu(self.linear_after2(x))\n x = torch.sigmoid(self.linear_after3(x))\n x = x.permute(0, 2, 1)\n\n return x\n\nclass HybridfilterbankModel(nn.Module):\n def __init__(self):\n super().__init__()\n\n self.nsnet = Net()\n self.fb = HybrA()\n\n def forward(self, x):\n x = self.fb(x)\n mask = self.nsnet(torch.log10(torch.max(x.abs()**2, 1e-8 * torch.ones_like(x, dtype=torch.float32))))\n return self.fb.decoder(x*mask)\n\nif __name__ == '__main__':\n audio, fs = torchaudio.load('your_audio.wav') \n model = HybridfilterbankModel()\n model(audio)\n```\n\n## Citation\n\nIf you find our work valuable and use HybrA or ISAC in your work, please cite\n\n```\n@inproceedings{haider2024holdmetight,\n author = {Haider, Daniel and Perfler, Felix and Lostanlen, Vincent and Ehler, Martin and Balazs, Peter},\n booktitle = {Annual Conference of the International Speech Communication Association (Interspeech)},\n year = {2024},\n title = {Hold me tight: Stable encoder/decoder design for speech enhancement},\n}\n@inproceedings{haider2025isac,\n author = {Haider, Daniel and Perfler, Felix and Balazs, Peter and Hollomey, Clara and Holighaus, Nicki},\n title = {{ISAC}: An Invertible and Stable Auditory Filter\n Bank with Customizable Kernels for ML Integration},\n booktitle = {International Conference on Sampling Theory and Applications (SampTA)},\n year = {2025}\n}\n```\n",
"bugtrack_url": null,
"license": null,
"summary": "A module for trainable encoder/decoder filterbanks with auditory bias.",
"version": "2025.7.4",
"project_urls": {
"Repository": "https://github.com/danedane-haider/Hybrid-Auditory-Filterbanks.git"
},
"split_keywords": [
"filberbank",
" learned filterbanks",
" feauture extraction",
" hybrid filterbanks",
" encoder",
" decoder",
" auditory",
" frames"
],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "7cfc7c224382423bc17c42d6de18d8c0ea645cc3c702ac16bd6e92e5c536d61e",
"md5": "13ad597ba487e8ef16ab43335b884a05",
"sha256": "16a0374c906d950f9673bf867c6ee567f00849afd69de35fbd8c6bdc8bd8f499"
},
"downloads": -1,
"filename": "hybra-2025.7.4-py3-none-any.whl",
"has_sig": false,
"md5_digest": "13ad597ba487e8ef16ab43335b884a05",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.10",
"size": 19056,
"upload_time": "2025-07-27T22:33:18",
"upload_time_iso_8601": "2025-07-27T22:33:18.728698Z",
"url": "https://files.pythonhosted.org/packages/7c/fc/7c224382423bc17c42d6de18d8c0ea645cc3c702ac16bd6e92e5c536d61e/hybra-2025.7.4-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "abe052430382cb94ce99ca93f2869b81162cab25c8f47b03b9c92b176c11c225",
"md5": "1ef54bbbada0da80dc57377d37edce72",
"sha256": "d7cdb539979704f4b70f9f630699847730996cef5f7033ba965f024ab40d85ce"
},
"downloads": -1,
"filename": "hybra-2025.7.4.tar.gz",
"has_sig": false,
"md5_digest": "1ef54bbbada0da80dc57377d37edce72",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.10",
"size": 17502,
"upload_time": "2025-07-27T22:33:20",
"upload_time_iso_8601": "2025-07-27T22:33:20.317162Z",
"url": "https://files.pythonhosted.org/packages/ab/e0/52430382cb94ce99ca93f2869b81162cab25c8f47b03b9c92b176c11c225/hybra-2025.7.4.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-07-27 22:33:20",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "danedane-haider",
"github_project": "Hybrid-Auditory-Filterbanks",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "hybra"
}