This package is written for constructing subband features.
Project description
torchsubband
This's a package for subband decomposition.
It can transform waveform into three kinds of subband feature representations.
Reconstruction loss
The following table shows the reconstruction quality. We tried a set of audio to conduct subband decomposition and reconstruction.
Subbands | L1loss | PESQ | SiSDR |
---|---|---|---|
2 | 1e-6 | 4.64 | 61.8 |
4 | 1e-6 | 4.64 | 58.9 |
8 | 5e-5 | 4.64 | 58.2 |
You can also test this program by training the following test script. It will give you some evaluation output.
from torchsubband import test
test()
Usage
from torchsubband import SubbandDSP
import torch
model = SubbandDSP(subband=2) # nn.Module
batchsize=3
channel=1
length = 44100*2
input = torch.randn((batchsize,channel,length))
# Get subband waveform
subwav = model.wav_to_sub(input)
reconstruct_1 = model.sub_to_wav(subwav,length=length)
# Get subband magnitude spectrogram
sub_spec,cos,sin = model.wav_to_mag_phase_sub_spec(input)
reconstruct_2 = model.mag_phase_sub_spec_to_wav(sub_spec,cos,sin,length=length)
# Get subband complex spectrogram
sub_complex_spec = model.wav_to_complex_sub_spec(input)
reconstruct_3 = model.complex_sub_spec_to_wav(sub_complex_spec,length=length)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
torchsubband-0.0.5.tar.gz
(21.7 kB
view hashes)
Built Distribution
Close
Hashes for torchsubband-0.0.5-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 39f379eec0181c43d0b4258d2839138126c7a7233045994c75c598f5f493ad3b |
|
MD5 | 2f0516758837ca055d9256a3b9923a1c |
|
BLAKE2b-256 | ec16e938861b55aad7cb79d24349aeb23c6f0ed7d346213e551a8de8140253b7 |