Coder Social home page Coder Social logo

noisereduction's Introduction

Introduction

The aim of this project is isolating the audacity Noise Reduction plugin so that it can be executed as a command line application.

Reverse Engineering

Structure

Effect class

Audacity effects are implemented by extending the class Effect which provides several methods to be extended. Audacity uses the common interface to polimorphycally invoke and configure plugins through their base clase.

In this case the Effect class does not implement the logic of the Noise Reduction Algorithm which is implemented within the Worker inner class. The Effect is a container for the effect which orchestrates the creation and interactions between inner classes (Settings, Statistics, Dialog and Worker).

Dialog class

Normally plugins also implement a Dialog class which is used to implement the effect pop up window through which the user introduces parameters and executes actions for these specific effect.

Statistics class

An instance of Statistics class is created when profiling the noise. Apart from several generic parameters like window size or rate, there are two (three depending on compilation options) Float Vectors containing statistical data on profiled sound window.

Settings class

Settings class containing parameters used by the algorithm and read from the plugin pop up window:

  • bool mDoProfile = indicate if we are profling noise or reducing noise
  • double mNewSensitivity; // - log10 of a probability... yeah.
  • double mFreqSmoothingBands; // really an integer
  • double mNoiseGain; // in dB, positive
  • double mAttackTime; // in secs
  • double mReleaseTime; // in secs
  • double mOldSensitivity; // in dB, plus or minus
  • int mNoiseReductionChoice;
  • int mWindowTypes;
  • int mWindowSizeChoice;
  • int mStepsPerWindowChoice;
  • int mMethod;

Worker class (The Mother of the Lamb)

Behaviour

Main Entry point methods to the effect are:

  • PromptUser: Pops up the dialog to the user requesting parameters and actions and fills the class Settings with the values introduced.
  • Init: Method devoted to initialize internal values. In the case of Noise Reduction it does nothing.
  • Process: This is the main method. Basically it will do the follwing actions:
    • Get a reference to the track
    • It will identify if we are profiling the noise or actually reducing it.
    • It creates a worker class and calls process method of the worker
    • Then it seems to iteratively process fixed size windows (2048 samples each)
    • The method processOne processes one window and for each one, statistics are calculated (GatherStatistics) and Noise Reduction is applied (ReduceNoise).

Dependencies

The effect has several dependencies. Some of them are an independent file which can be used as is and it does not link to 3rd files. Several other dependencies are hardly linking the effect to audacity and these ones have to be broken or some fake dependency needs to be created to avoid depending on audacity code.

  • Wx widgets graphic library
  • MemoryX header
  • Effect class
  • WaveTrack class
  • ...

Tasks

  • Make NoiseReduction not derive from Effect DONE
  • Adapt calls to base class methods PENDING
  • Break dependency between MemoryX and wxMin wxMax function DONE (it can be improved)
  • Delete Dialog class DONE
  • Fill Settings class with hardcoded default values DONE
  • Make a fake WaveTrack class (PENDING)
  • Make a main method creating noise reduction PENDING
  • Discover format of wav files and how they are translated to float arrays PENDING
  • Delete Dialog class DONE
  • Transform wx chars to chars DONE
  • Transform wxAsserts to normal asserts DONE
  • Transform calls to MessageBox to std::cout DONE

noisereduction's People

Contributors

jametller avatar

Stargazers

Veipin avatar jrodden1 avatar David Kahler avatar She Jiayu avatar Riccardo Giuntoli EA4343URE avatar  avatar Hector Socas-Navarro avatar

Watchers

Hector Socas-Navarro avatar  avatar  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.