GithubHelp home page GithubHelp logo

road2018 / torchsubband Goto Github PK

View Code? Open in Web Editor NEW

This project forked from haoheliu/torchsubband

0.0 0.0 0.0 418 KB

Pytorch implementation of subband decomposition

Home Page: https://haoheliu.github.io/torchsubband/

License: MIT License

Python 46.06% HTML 53.94%

torchsubband's Introduction

PyPI version

torchsubband

This's a package for subband decomposition.

It can transform waveform into three kinds of revertable subband feature representations, which are potentially useful features for music source separation or similar tasks.

488zR0.png

Usage

Installation

pip install torchsubband

A simple example:

from torchsubband import SubbandDSP
import torch

# nn.Module
model = SubbandDSP(subband=2) # You can choose 1,2,4, or 8 
batchsize=3 # any int number
channel=1 # any int number
length = 44100*2 # any int number
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)

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 running the following test script. It will give you some evaluation output.

from torchsubband import test
test()

Citation

If you find our code useful for your research, please consider citing:

    @misc{liu2021cwspresunet,
        title={CWS-PResUNet: Music Source Separation with Channel-wise Subband Phase-aware ResUNet},
        author={Haohe Liu and Qiuqiang Kong and Jiafeng Liu},
        year={2021},
        eprint={2112.04685},
        archivePrefix={arXiv},
        primaryClass={cs.SD}
    }
    @inproceedings{Liu2020,   
      author={Haohe Liu and Lei Xie and Jian Wu and Geng Yang},   
      title={{Channel-Wise Subband Input for Better Voice and Accompaniment Separation on High Resolution Music}},   
      year=2020,   
      booktitle={Proc. Interspeech 2020},   
      pages={1241--1245},   
      doi={10.21437/Interspeech.2020-2555},   
      url={http://dx.doi.org/10.21437/Interspeech.2020-2555}   
    }

torchsubband's People

Contributors

haoheliu avatar iver56 avatar yoyololicon avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.