Week 5 – Improvements To Audio Alteration
April 7, 2023
Overview
This week, I found a suitable library for audio alteration and began adapting it for my own project.
Python has a library known as “noisereduce” which, as the name suggests, focuses on reducing noise from audio samples. Through a process called spectral gating, the algorithm computes a spectrogram of a signal and estimates a spread of frequencies (frequency of the noise in a sound). Based on that spread, it will construct a mask that dulls out the noise while preserving the main voice in a particular audio.
Now let’s go through this process with some code.
First, we read in the audio. This library works with .wav files, so for my final product, I will have to convert more common .mp3 files into .wav format.
This particular audio doesn’t have much noise, so for the sake of example, I’ll add some noise by overlapping a standard frequency over the sound.
Now, let’s use the library’s method to actually remove the noise. The method sets a set of ranges of frequencies to eliminate the squeezes the noise out of the sound. As you can see, the important sounds in the full audio are preserved.
Next Steps
Now that I know how to remove noise from audio files, I can actually start working on adapting it to my project. After testing this algorithm on other sounds, I will begin combining this model with my colorization model. This will be the final and most difficult stage of my project, so stay tuned to the upcoming posts!