GithubHelp home page GithubHelp logo

varunsingh87 / ambient-noise-remover Goto Github PK

View Code? Open in Web Editor NEW
12.0 0.0 3.0 836 KB

A Java program that removes ambient noise from an audio file

Home Page: https://varunsingh87.github.io/Ambient-Noise-Remover

License: GNU General Public License v3.0

Java 100.00%
kalman-filter java java-sound-api noise-detection noise-cancellation

ambient-noise-remover's Introduction

Ambient Noise Remover

Ambient Noise Remover is a Java program that removes ambient noise from an audio file. It uses the multidimensional Kalman Filter to estimate the positions of the ambient noise in an inputted audio file and the Java Sound API to remove it from the sound file. It then outputs a new file with removed ambient noise.

Motivation

Communication applications, such as Telegram, Signal, Discord, and Skype, automatically remove background noise during video and voice calls as part of their software, before the sound reaches the recipient. In my project, I wanted to do what they were doing, just in an audio file rather than incoming sound.

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

Ambient-Noise-Remover uses the Maven Dependency Management System to store and update dependencies and version the software. To install Maven, go to their website and download it.

Maven Dependency Management System

Run

mvn -v

to make sure it is configured correctly.

Understanding of the Kalman Filter

Before writing code for or reading code in this repository, you need to understand how the one dimensional and multidimensional Kalman Filter works. I suggest the following resources:

Installing

Install the Maven dependencies for this project

mvn install

To see the program in action, find background heavy audio files and place them in data. Then edit the file path inside the main method of AmbientNoiseRemover.java

Running the Tests

To run the tests, enter mvn test in the command line. You can also use the features of your IDE or code editor if it has a GUI for tests. The project currently only has Unit Tests.

Unit Tests

The WaveFormTest class tests the WaveForm class and is important for making sure the methods that manipulate the waveform function correctly

@Test
public void testInvert() {
    byte[] firstByteArr = { 1, 0, -86, 124 };

    byte[] actualInversion = new WaveForm(firstByteArr).invert().getAudioData();

    assertArrayEquals(new byte[] { -1, 0, 86, -124 }, actualInversion);
}

The kalmanfilter test package tests all estimation algorithms from the kalmanfilter package. These are important in making sure the predicted positions and byte data that will be removed is correct.

@Test
public void testVelocityStateUpdateEquation() {
    double result = KalmanFilterEquations.useVelocityStateUpdateEquation(
        previousStateEstimate,
        previousVelocityEstimate, 
        BETA_FILTER, 
        measurement, 
        5
    );
    assertEquals(expectedVelocityEstimate, result, 0.1);
}

Coding Style Tests

The Coding Style tests will test to make sure the right method bracket style is used.

Give an example

Deployment

Ambient-Noise-Remover is a console program runnable as a JAR file on Windows, Mac, and Linux. There is currently no web version, GUI, or mobile app that hosts, displays, or runs this project.

Built With

  • Java - The language used
  • Maven - Dependency Management System
  • Java Sound API - The API for manipulating the sound

Contributing

Please read CONTRIBUTING.md for details on our code of conduct, and the process for submitting pull requests to me.

Versioning

I use SemVer for versioning. For the versions available, see the tags on this repository.

Author

I, Varun Singh, did the research and wrote the software.

License

This project is licensed under the GNU General Public License - see the LICENSE file for details

ambient-noise-remover's People

Contributors

varunsingh87 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ambient-noise-remover's Issues

Complete linearalgebra package

The com.varunsingh.linearalgebra package must be completed so it is not updated again and the higher level packages can be focused on.

Implement inverse Fourier transform

Convert analyzed and modified sound waves and frequencies back into sound

Used in all speech enhancement algorithms that use the Fourier transform

Redesign kalmanfilter package to better represent algorithm

The current kalmanfilter package design is based on a lack of understanding of the algorithm. It groups all equations in one class, MultiDimensionalKalmanFilterParameterFactory, covariance matrices in another, CovarianceMatrixSet, and simply plugs in values of the equations in the MultiDimensionalKalmanFilter class.

The Kalman Filter is a two-step process, and its subalgorithms should be grouped as such.

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.