C library for audio noise reduction and other spectral effects

Related tags

Audio libspecbleach
Overview

libspecbleach

C library for audio noise reduction and other spectral effects

build

Background

This library is based on the algorithms that were used in noise-repellent. These were extracted into a this standalone library to remove the lv2 dependency. It was design to be extensible and modular. It uses the concept of a spectral processor which itself uses a short time Fourier transform (STFT) to process the audio. There are two initial processors in place, one which uses the adaptive part of noise repellent and one that uses the manual capturing profile based denoising. The library could be extended with more spectral processors using any STFT-based algorithm such as de-crackle, de-click and other audio restoration algorithms.

De-noise algorithms

There several techniques implemented in the library that are being used in the denoisers, such as masking thresholds estimation, onset detectors, etc. All these are being used in conjuntion to improve the very basic spectral substraction algorithm. Most of the papers used are listed in the wiki of the project. Also a block diagram is provided to explain the reduction architecture.

Build

If you wish to compile yourself and install the library you will need the a C compiling toolchain, Meson build system, ninja compiler, git and fftw3 library.

Installation:

  git clone https://github.com/lucianodato/noise-repellent.git
  cd noise-repellent
  meson build --buildtype=release --prefix=/usr --libdir=lib (your-os-appropriate-location-fullpath)
  meson compile -C build -v
  sudo meson install -C build

Example

A simple console app example is provided to demonstrate how to use the library. It needs libsndfile to compile successfully. You can use it as follows:

  adenoise_demo <input file name> <output file name>

It will recognize any libsndfile supported format.

Comments
  • Memory issue, Windows

    Memory issue, Windows

    I have compiled this in a 64-Bit Windows MFC DLL, works superbly but I believe the heap is being corrupted. I am so impressed with libspecbleach that I'm spending considerable time trying to try this down. Available via e-mail as [email protected] .

    opened by SimonG4ELI 17
  • Expose more key functionality through the API

    Expose more key functionality through the API

    Hi,

    https://www.vocal.com/noise-reduction/musical-noise/ is an interesting read, it'll take me some days to fully understand it. Would be good to get the musicality removed, I think you effectively have this in libspecbleach, maybe some parameters should be exposed.

    Look at https://www.youtube.com/watch?v=eRIqabVpltM to see libspecbleach in action, sometimes the musicality is pronounced.

    BTW - this is not a complaint!

    work in progress 
    opened by SimonG4ELI 14
  • Quality/Latency tradeoff control? AKA Variable frame size

    Quality/Latency tradeoff control? AKA Variable frame size

    AFAIK noise-repellent has a fixed latency.

    I wonder if there could be a way to control the amount of delay somehow.

    In some cases one could sacrifice some quality to get faster operation for semi-live usage like video live streaming or VoIP.

    I have no idea if this is possible, so let me know.

    dsp enhancement 
    opened by unfa 5
  • Whitening factor in adaptive denoising?

    Whitening factor in adaptive denoising?

    Apologies if this is just a case of me not understanding the core technology, but why isn't whitening factor exported as part of the adaptive denoising API, when it is part of the learning denoising API? Coming from noise-repellent, and unless I'm a loony, whitening definitely worked just as well in adaptive mode there as in learning mode.

    work in progress 
    opened by Yahweasel 3
  • Use of inline

    Use of inline

    Hi,

    I'm using this library in a 64-bit Windows DLL with Visual Studio 2019, the DLL is a mix of C++ (my code) and C (LibSpecBleach).

    The use of inline in general_utils.c and spectral_utils.c results in the functions not being available - the compiler removes them. A good C compiler will inline all suitable functions anyway.

    Would it be possible to remove the use of inline? Every time I use a new download from here I have to edit these two files.

    opened by SimonG4ELI 2
  • Better psycho-acoustic model or rule to apply it

    Better psycho-acoustic model or rule to apply it

    Right now Virag's method is used without the spectral flooring but with the adapted over-subtraction factors. Some suggestions are proposed in "A single channel speech enhancement technique exploiting human auditory masking properties" that can preserve low level details better.

    dsp enhancement 
    opened by lucianodato 2
  • Add noise profile modelling options

    Add noise profile modelling options

    Closes #8

    Added possibility of learn the average, the median and the max profiles. Each of them is more aggressive in the separation than the previous.

    opened by lucianodato 0
  • Explain and implement different modes better

    Explain and implement different modes better

    (Sorry for the somewhat strange-looking title.)

    I just learned by accident that I can choose different values for "Learn noise profile". Neither the README.md nor the Wiki explain them, nor do they acknowledge their existence. How do they work? Some of them appear to be labeled in Spanish. For English, I would prefer simpler labels like

    • 0: "Disabled"
    • 1: "Average"
    • 2: "Median"
    • 3: "Maximum"

    But I do not know whether that would be expressive enough since I do not understand the semantics. Please explain the meaning of the different values (0 to 3) in the Wiki.

    While we are at it: From what I guess the different values are supposed to mean, does that mean that the way noise reduction works depends on the mode chosen during learning? If so, why not just learn for all of the three different modes simultaneously, and then let the user choose the mode to be used afterwards? That way, the user can try and compare different modes without having to try and make Noise Repellent relearn from the exact same noise profile repeatedly.

    In the end, I think of something like this:

    • "Learn noise profile" should have only two values, "0" meaning "Disabled" and "1" meaning "Enabled".
    • There should be a new control "Mode" with the same four different values and labels as enumerated in the list above.
    • Since "Mode" can then be set to "0" meaning "Disabled", there is no need for a separate control "Enable" anymore. Thus, the currently present control "Enable" can be removed.

    The main advantages I see are the following:

    • It is easier for the user to compare different modes by trail and error.
    • Every effect host I have ever seen already features a separate (binary or continuous) dry/wet control for each effect. Thus, removing the current "Enable" control simplifies the interface since it is probably redundant anyway.
    • Given the current implementation, what happens if the user switches "Learn noise profile" from a non-zero value to another non-zero value, e.g. from "2" to "1"? This kind of question (and confusion!) will not arise with the changes proposed here.

    Of course, there are probably reasons as to why the controls are the way they currently are. Maybe what I imagine is too complex to implement or too difficult to use. What do you think?

    P. S.: The control "Reduction strenght" (sic!) should probably read "Reduction strength".

    opened by bergfried 2
  • Increase Coverage

    Increase Coverage

    No unit test at the time. Definitely to be a serious project test should be added. Not sure which test framework should be used or is commonly used across open source C projects. Maybe doing a custom client with no framework is better in this case.

    opened by lucianodato 4
  • Implement FFT partitioning to reduce latency

    Implement FFT partitioning to reduce latency

    Hi,

    I see the frame size is 20ms. If latency and CPU load are not a problem, is there an advantage in using a much bigger frame size, for example 160ms?

    dsp enhancement 
    opened by SimonG4ELI 9
  • Enhance transient detection using a combination of detection criterias

    Enhance transient detection using a combination of detection criterias

    Spectral flux is not enough for low energy transients. Multiband detection using psycho-acoustic bands like bark or mel should work better. This is key in order to use multiresolution processing.

    dsp enhancement 
    opened by lucianodato 0
  • Multi-resolution processing

    Multi-resolution processing

    As codecs do, selecting the right size of each frame would lead to better transients treatment. A new multiband onset detection would be needed and processing would be much more but could be optional.

    dsp enhancement 
    opened by lucianodato 1
  • Better smoothing

    Better smoothing

    Maybe something like proposed in SPECTRAL SUBTRACTION WITH ADAPTIVE AVERAGING OF THE GAIN FUNCTION. Time smoothing between current and past fft_p2 (similar effect to ephraim and malah). Is done by applying a release envelope to signal power spectrum. The best option would be to adaptively smooth 2D spectral components so it will require a bigger buffer as suggested by Lukin in Suppression of Musical Noise Artifacts in Audio Noise Reduction by Adaptive 2D Filtering. Bilateral filter or non local means + DFT (This is the best improvement but it will need a big rehauling of the stft).

    dsp enhancement 
    opened by lucianodato 7
Releases(v0.1.6)
  • v0.1.6(May 19, 2022)

  • v0.1.5(May 13, 2022)

  • v0.1.4(May 10, 2022)

    • Fixes for many invalid read and write issues reported using valgrind.
    • Fixes for some memory leaks
    • Better documentation in header files.
    • Correction of some typos in code comments. Thanks @luzpaz
    Source code(tar.gz)
    Source code(zip)
  • v0.1.3(Apr 27, 2022)

  • v0.1.2(Apr 24, 2022)

  • v0.1.1(Apr 23, 2022)

  • v0.1.0(Apr 22, 2022)

    This is the first release of the library. This library condensates all the lessons learned through noise repellent development plus a good amount of refactoring and better code practices. It implements a modular way of developing STFT based processing algorithms using what's called internally as spectral processors. This allows to extend the library in the future with more algorithms. The library its generic enough that can be used in any type of applications, including RT safe processing. The algorithms were refined and some of them even improved in terms of quality of reduction. After noise-repellent was release many developers had forked the plugin and adapt it to use the algorithms in other contexts. This library effectively removes the lv2 dependency that noise repellent has so it allows the algorithms to be integrated in other type of apps.

    Provided in this release there are two spectral processors

    • An adaptive denoiser that learns the noise profile automatically in each processing frame. It uses a 20 ms frame so latency is appropriate to be used in a live situation.
    • A more intricate denoiser that allow to learn a noise profile and set it externally. This manual denoiser offers much more precise and higher resolution reduction. It's intended to be used as a post processing effect.
    Source code(tar.gz)
    Source code(zip)
Owner
Luciano Dato
Dev, audio-nerd, drummer, sysadmin, etc.
Luciano Dato
Sexy, audio-responsive effects on LED strips.

Striptease Sexy, audio-responsive effects on LED strips. For Teensy 4 with Audio Adapter Board, by PJRC. Quick demo Shooting video of LEDs is very tri

Luca Paolini 35 Jun 19, 2022
Open source digital sound effects based on JACK audio connection kit.

Noiseworks Digital Audio Effects Repository Open source digital sound effects based on JACK audio connection kit. This repository is intended to provi

null 5 Jul 29, 2022
Audacity is an easy-to-use, multi-track audio editor and recorder for Windows, Mac OS X, GNU/Linux and other operating systems

Audacity is an easy-to-use, multi-track audio editor and recorder for Windows, Mac OS X, GNU/Linux and other operating systems. Audacity is open source software licensed under GPL, version 2 or later.

Audacity 8.4k Nov 19, 2022
Sneedacity (formerly Audacity) is an easy-to-use, multi-track audio editor and recorder for Windows, Mac OS X, GNU/Linux and other operating systems.

Sneedacity (formerly Audacity) is an easy-to-use, multi-track audio editor and recorder for Windows, Mac OS X, GNU/Linux and other operating systems. Sneedacity is open source software licensed under GPL, version 2 or later.

Sneed's Feed & Seed 866 Nov 14, 2022
PortAudio is a portable audio I/O library designed for cross-platform support of audio

PortAudio is a cross-platform, open-source C language library for real-time audio input and output.

PortAudio 750 Nov 19, 2022
BYOD is a guitar distortion plugin with a customisable signal chain that allows users to create their own guitar distortion effects.

BYOD is a guitar distortion plugin with a customisable signal chain that allows users to create their own guitar distortion effects. The plugin contains a wide variety of distortion effects from analog modelled circuits to purely digital creations, along with some musical tone-shaping filters, and a handful of other useful processing blocks.

null 206 Nov 22, 2022
cute_dsp is a C API for various DSP effects suitable for video games

cute_dsp is a C API for various DSP effects suitable for video games and meant to interface directly with the cute_sound library created by Randy Gaul

Matt Rosen 13 May 29, 2021
C++ library for audio and music analysis, description and synthesis, including Python bindings

Essentia Essentia is an open-source C++ library for audio analysis and audio-based music information retrieval released under the Affero GPL license.

Music Technology Group - Universitat Pompeu Fabra 2.2k Nov 25, 2022
eSpeak NG is a compact open source software text-to-speech synthesizer for Linux, Windows, Android and other operating systems

eSpeak NG is an open source speech synthesizer that supports more than hundred languages and accents.

null 1.6k Nov 22, 2022
A simple C++ library for reading and writing audio files.

AudioFile A simple header-only C++ library for reading and writing audio files. Current supported formats: WAV AIFF Author AudioFile is written and ma

Adam Stark 667 Nov 22, 2022
A C library for reading and writing sound files containing sampled audio data.

libsndfile libsndfile is a C library for reading and writing files containing sampled audio data. Authors The libsndfile project was originally develo

null 1.1k Nov 15, 2022
C library for cross-platform real-time audio input and output

libsoundio C library providing cross-platform audio input and output. The API is suitable for real-time software such as digital audio workstations as

Andrew Kelley 1.6k Nov 22, 2022
C++ Audio and Music DSP Library

_____ _____ ___ __ _ _____ __ __ __ ____ ____ / \\_ \\ \/ / |/ \| | | | \_ \/ \ | Y Y \/ /_ \> <| | Y Y \ | |_|

Mick Grierson 1.4k Nov 26, 2022
Single file audio playback and capture library written in C.

A single file library for audio playback and capture. Example - Documentation - Supported Platforms - Backends - Major Features - Building - Unofficia

David Reid 2.5k Nov 25, 2022
a library for audio and music analysis

aubio is a library to label music and sounds. It listens to audio signals and attempts to detect events. For instance, when a drum is hit, at which frequency is a note, or at what tempo is a rhythmic melody.

aubio 2.8k Nov 15, 2022
Single file C library for decoding MPEG1 Video and MP2 Audio

PL_MPEG - MPEG1 Video decoder, MP2 Audio decoder, MPEG-PS demuxer Single-file MIT licensed library for C/C++ See pl_mpeg.h for the documentation. Why?

Dominic Szablewski 589 Nov 17, 2022
A simple and easy-to-use audio library based on miniaudio

raudio A simple and easy-to-use audio library based on miniaudio raudio forks from raylib.audio module to become an standalone library. Actually, it w

Ray 61 Oct 5, 2022
C++17 library for creating macOS Audio Server plugins.

libASPL Synopsis Instructions Versioning API reference Example driver Quick start Object model Types of setters Customization Thread and realtime safe

Victor Gaydov 31 Nov 25, 2022