Code Monkey home page Code Monkey logo

noise-suppressor's Introduction

Here's a brief description of the project's main components and functionalities:

  1. Libraries and Imports: The project starts by importing necessary Python libraries, including NumPy, Librosa, IPython, Matplotlib, and SciPy, to handle audio processing, visualization, and signal manipulation.

  2. Loading Audio: An audio file named "intro4.wav" is loaded using Librosa. It's displayed using IPython's Audio widget, allowing you to listen to the original audio.

  3. Plotting Magnitude Spectrum: The script defines a function called plot_magnitude_spectrum that calculates and plots the magnitude spectrum of the input audio signal. This function is then applied to the loaded audio to visualize its frequency components.

  4. Generating Band-Limited Noise: The project generates band-limited noise and adds it to the audio signal to simulate background noise. The noise is created within a specific frequency range (between 4,000 Hz and 12,000 Hz) and added to the audio clip.

  5. Fourier Transform Analysis: The Fourier transform of the noisy audio signal is computed, and the magnitude of the Fourier coefficients is plotted to visualize the frequency domain characteristics.

  6. Noise Reduction: The core of the project is the removeNoise function, which performs noise reduction on the audio clip. It does the following:

    • Separates the noise and signal components using Short-Time Fourier Transform (STFT).
    • Calculates statistics on the noise and determines a threshold for noise removal.
    • Applies a mask to the signal based on the calculated threshold.
    • Smooths the mask using a filter.
    • Applies the mask to the noisy signal in the frequency domain.
    • Recovers the cleaned signal through inverse STFT.
  7. Visualization: The script includes various visualization functions to display the noisy audio, statistics of the noise, the mask applied to the signal, the masked signal, and the recovered spectrogram.

  8. Output and Playback: After noise reduction, the cleaned audio signal is plotted and played back using IPython's Audio widget.

In summary, this project aims to demonstrate the process of removing noise from an audio clip using signal processing techniques and visualization tools. It utilizes the Librosa library for audio processing and provides visual feedback at various stages of the noise reduction process.

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.