GithubHelp home page GithubHelp logo

phuntast1c / a-priori-snr-estimator Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 163.72 MB

TCN-Based SNR Estimator

License: Apache License 2.0

Python 6.27% Jupyter Notebook 93.73%
signal-processing single-channel snr speech-enhancement tcn snr-estimation

a-priori-snr-estimator's Introduction

Temporal Convolutional Network-Based SNR Estimation

Description

This repository contains the code to train and test a temporal convolutional network (TCN)-based a-priori signal-to-noise ratio (SNR) estimator. The TCN maps log-magnitude and phase features to an estimate of the compressed SNR in [0, 1]. During training, the compressed SNR according to Eq. (11) in [1] is used. During inference, the compressed SNR is expanded as in Eq. (12). The mean and variance of the SNR in dB required in Eqs. (11) and (12) were estimated using 4000 randomly chosen utterances from the training dataset.

How to run

Installation

First, install dependencies:

# clone project
git clone https://github.com/phuntast1c/a-priori-snr-estimator

# install and activate conda environment
cd a-priori-snr-estimator
conda env create -f environment.yml
conda activate a_priori_snr_estimator

Usage

This repository contains two pre-trained models, one estimating the SNR for all frequency bins and one only estimating the SNR for {1250, 2250, 3500} Hz (fs = 16 kHz). These models were trained on the reverberant ICASSP 2021 Deep Noise Suppression (DNS) challenge dataset, including both simulated and measured room impulse responses. inference.ipynb demonstrates how to use these models for the prediction of the SNR given a noisy single-channel input. run_model.py can be used to save the estimated SNR to a .mat file, e.g. as:

python run_model.py --input test.wav --output test.mat

or, for the second mentioned model, as:

python run_model.py --input test.wav --output test.mat --use_freq_subset

When different settings or a different dataset are desired, the SNR estimator can be trained using the PyTorch Lightning (PL) command-line interface, preferably with an equipped NVIDIA GPU. The available model arguments can be printed using:

python cli.py fit --model.help APrioriSNREstimator

For example, the provided models were trained using:

python cli.py fit --trainer=configs/trainer/trainer.yaml --model=configs/model/240523_a_priori_snr_tcn.yaml --data=configs/data/240206_dns2_reverberant.yaml --model.limit_frequencies=false --model.use_batchnorm=true --model.layer=8 --model.stack=3 &> /dev/null &
python cli.py fit --trainer=configs/trainer/trainer.yaml --model=configs/model/240523_a_priori_snr_tcn.yaml --data=configs/data/240206_dns2_reverberant.yaml --model.limit_frequencies=true --model.use_batchnorm=true --model.layer=8 --model.stack=3 &> /dev/null &

To handle data from the DNS challenge , this repository includes a PL LightningDataModule implementation. For instructions on how to obtain the data, please refer to the official repository, and adjust the paths accordingly. The configuration file used to generate the training dataset can be found in spp/datasets/noisyspeech_synthesizer.cfg.

Reference

[1] Zhang, Q., Nicolson, A. M., Wang, M., Paliwal, K. & Wang, C.-X. DeepMMSE: A Deep Learning Approach to MMSE-based Noise Power Spectral Density Estimation. IEEE/ACM Trans. Audio, Speech and Lang. Proc. 28, 1404โ€“1415 (2020).

a-priori-snr-estimator's People

Contributors

phuntast1c avatar

Watchers

 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.