Skip to content

bosukeme/remove_background_noise

Repository files navigation

remove_background_noise

Table of Contents

Introduction

Noise reduction in audio processing involves the removal or reduction of unwanted background noise or interference from an audio signal. You can achieve noise reduction in Python using various libraries and techniques.

The remove_background_noise is a Flask application that reduces noise from an input recording file and returns several reduced noise audio files (wav) from several noise reducing methods

  • Noisereduce is a noise reduction algorithm in python that reduces noise in a method called "spectral gating" which is a form of Noise Gate. It works by computing a spectrogram of a signal (and optionally a noise signal) and estimating a noise threshold (or gate) for each frequency band of that signal/noise. That threshold is used to compute a mask, which gates noise below the frequency-varying threshold.

  • In audio processing with the Librosa library in Python, you can reduce noise using spectral centroid-based thresholding. This calculates high and low spectral centroid thresholds, and then applies a noise reduction filter using the pysndfx library based on those thresholds. The result is a denoised version of the input audio, which is saved as a new WAV file.

  • To perform noise reduction using MFCC (Mel-frequency cepstral coefficients) in Python, you can use the python_speech_features library to extract MFCC features from the audio signal and then apply thresholding to reduce noise.

Sources:


Technologies used
  • Backend: Python & Flask
  • REST API documentation: Swagger UI
  • Testing: Pytest
  • CI: Github Actions
  • Containerization: Docker
  • File Storage: Cloudinary

Getting Started

To run this web application on your local machine, follow the steps below:

Prerequisites

Before getting started, ensure that you have the following software installed on your machine:

Installation

Step-by-step guide on how to install the project and its dependencies.

  1. Clone the repository to your local machine using Git:
    HTTPS
git clone https://github.com/bosukeme/remove_background_noise.git

SSH

git clone [email protected]:bosukeme/remove_background_noise.git

  1. Navigate to the project directory
cd remove_background_noice

Before you start the application, you need to set up an environment variables. Here's how you can do it:

CLOUD_NAME=
API_KEY=
API_SECRET=

Create a file called .env file at the root folder of the project with the environmental variables above.

You can create your cloudinary key and secret by signing up on https://cloudinary.com/

  1. Install the project dependencies contained inside the requirements.txt file using PIP(Package Manager):
pip install -r requirements.txt

Running the web application

Once you have installed the dependencies, you can start the web application using

Linux, Windows "WSL" , MAC

gunicorn -c "gunicorn_config.py" "wsgi:app"

Windows "CMD", "POWERSHELL"

python run.py

Running Tests

Once you have installed the dependencies, and your flask app is running, you can run test within the directory

  • run pytest
pytest

Run docker

navigate to the root directory

docker-compose up --build

To stop the containers

docker-compose stop

API documentation

Access API documentation via Swagger UI using the link below after starting up the application

http://localhost:8001/api/v1.0/remove-noise/doc/

Usage

License

This project is licensed under the MIT License.

Authors

Contributors names and contact info

Ukeme Wilson

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •