{"id":17521813,"url":"https://github.com/loehnertz/rattlesnake","last_synced_at":"2025-08-21T12:31:03.018Z","repository":{"id":38816621,"uuid":"95152813","full_name":"loehnertz/rattlesnake","owner":"loehnertz","description":"A Python application that does noise cancellation","archived":false,"fork":false,"pushed_at":"2022-12-12T06:24:30.000Z","size":34,"stargazers_count":142,"open_issues_count":10,"forks_count":51,"subscribers_count":11,"default_branch":"master","last_synced_at":"2023-11-07T17:25:22.187Z","etag":null,"topics":["active-noise-control","active-noise-reduction","antischall","noise-cancellation","python"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/loehnertz.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-06-22T20:14:03.000Z","updated_at":"2023-11-06T09:42:34.000Z","dependencies_parsed_at":"2023-01-27T15:01:21.422Z","dependency_job_id":null,"html_url":"https://github.com/loehnertz/rattlesnake","commit_stats":null,"previous_names":[],"tags_count":1,"template":null,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/loehnertz%2Frattlesnake","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/loehnertz%2Frattlesnake/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/loehnertz%2Frattlesnake/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/loehnertz%2Frattlesnake/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/loehnertz","download_url":"https://codeload.github.com/loehnertz/rattlesnake/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":230511483,"owners_count":18237658,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["active-noise-control","active-noise-reduction","antischall","noise-cancellation","python"],"created_at":"2024-10-20T12:07:03.845Z","updated_at":"2024-12-19T23:15:26.233Z","avatar_url":"https://github.com/loehnertz.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# rattlesnake\nA python application that does noise cancellation\n\n\n## Motive\nDuring the spring semester of 2017 I had to do a project for my studies at university.\nThe topic was to think of experiments regarding audio, sound, sonic waves etc. that we could prepare for fellow students\nto experience during future lectures with the goal of imparting acoustics to the students.\nDuring this project I came up with the idea of demonstrating *Active Noise Cancellation* with a custom script.\n\n\n## Explanation\nThis python tool can do *Active Noise Cancellation (ANC)* respectively *Active Noise Reduction (ANR)*.\nIt reads in a stream of audio, either live or from a pre-recorded file and calculates an inverted signal for every byte\nof the data stream utilizing an XOR operation.    \nAfter the execution is finished the program calculates a median of the difference levels which reflects\nthe results of the algorithm. It also plots a graph with the results and displays it afterwards.    \n    \n*More details soon to follow*\n\n\n## Installation\nClone the repo and install the requirements via pip:    \n`pip install -r requirements.txt`\n\n\n## Usage\nRun the python script from your terminal and specify the mode you want to use:    \n`python3 rattlesnake.py --mode --result nth_iteration filename.wav`    \n\nEvery argument type only accepts one at a time.\n\nArgument        | Description\n--------        | -----------\n--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)\n--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)\n--playback (-p) | This is the 'playback-mode' that does exactly what one would expect. It can be used to test an existing file. (--mode)\n--decibel (-db) | This argument will cause the 'decibels' to be plotted at the end. (--result)\n--waves (-wv)   | This argument will cause the 'waves' to be plotted at the end. (--result)\nnth_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.\n\n\n## License\n[MIT](LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Floehnertz%2Frattlesnake","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Floehnertz%2Frattlesnake","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Floehnertz%2Frattlesnake/lists"}