I have created a simple plot of waveforms using matplotlib of 2 wave files on python. Here is the code:
import matplotlib.pyplot as plt import numpy as np from statistics import mean import wave import sys plt.figure(1) class Audio: def __init__(self, audio): self.audio = wave.open(audio,'r') self.signal = self.audio.readframes(-1) self.signal = np.fromstring(self.signal, 'Int16') self.fr = self.audio.getframerate() self.time = np.linspace(0, 100, num=(len(self.signal))) self.fft = np.fft.fft(self.signal) def plot(self): plt.title("Audio waveforms") plt.plot(self.time, self.signal, '.') gana = Audio('gana.wav') humm = Audio('humm.wav') gana.plot() humm.plot() plt.show()
What I want to do is remove the noise from both the files. I have seen many examples that use FFT to remove noise. I have taken out the fft of the signals of these wave files but the problems I am having is I have no idea of what to do after taking out the FFT. Do I have to plot the FFT or do something else?
P.S The noise in the green wave form is hiss and in the blue is background sound. So is there any way that I could get rid of both of these noises? Thanks.