Skip to main content

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.

488zR0.png

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


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)

Uploaded Source

Built Distribution

torchsubband-0.0.5-py3-none-any.whl (20.7 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page