Giter Site home page Giter Site logo

rattlesnake's Introduction

rattlesnake

A python application that does noise cancellation

Motive

During the spring semester of 2017 I had to do a project for my studies at university. The topic was to think of experiments regarding audio, sound, sonic waves etc. that we could prepare for fellow students to experience during future lectures with the goal of imparting acoustics to the students. During this project I came up with the idea of demonstrating Active Noise Cancellation with a custom script.

Explanation

This python tool can do Active Noise Cancellation (ANC) respectively Active Noise Reduction (ANR). It reads in a stream of audio, either live or from a pre-recorded file and calculates an inverted signal for every byte of the data stream utilizing an XOR operation.
After the execution is finished the program calculates a median of the difference levels which reflects the results of the algorithm. It also plots a graph with the results and displays it afterwards.

More details soon to follow

Installation

Clone the repo and install the requirements via pip:
pip install -r requirements.txt

Usage

Run the python script from your terminal and specify the mode you want to use:
python3 rattlesnake.py --mode --result nth_iteration filename.wav

Every argument type only accepts one at a time.

Argument Description
--live (-l) This is the 'live-mode' which expects a wave audio file (.wav) as the fourth argument. It then cancels noise captured by a connected microphone while playing back an audio file. This way it functions like noise-cancelling headphones. (--mode)
--file (-f) This is the more basic 'file-mode' which expects a wave audio file (.wav) as the fourth argument. It then plays back the original file as well as the inverted audio to effectively cancel both out. (--mode)
--playback (-p) This is the 'playback-mode' that does exactly what one would expect. It can be used to test an existing file. (--mode)
--decibel (-db) This argument will cause the 'decibels' to be plotted at the end. (--result)
--waves (-wv) This argument will cause the 'waves' to be plotted at the end. (--result)
nth_iteration This argument is required and needs to be a number. It specifies on which nth iterations data is saved for calculating and plotting the results. The lower the value, the more precise the results.

License

MIT

rattlesnake's People

Contributors

loehnertz 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.