Separate noise from audio with linear filter
This project shows how we can apply spectra analysis technicals to create a digital filter that filter away the unwanted frequency in audio.
Input Audio
Output Audio
By plotting the frequency spectrum of the input signal, we can identify that the noise lies at 835Hz, 1530Hz.
Since sampling frequency is 44100Hz and normalised frequency is calculated by 2* pi * frequency/ sampling frequency, the noise component lie at angular frquency 0.11(835Hz), 0.22(1530Hz). Poles and zeros should be placed at amplitude*e^(angular frequency) on the Pole Zero diagram as shown below. Amplitude of Zeros should be larger than pole in order to attenuate the signal.
The filter will then behave as follows. Normalised frquency is calculated by frequency/ sampling frequency. Therefore, we saw a dip in amplitude at normalised frequency 0.01(835Hz) and 0.03(1530Hz) in the filter amplitude response graph.
Upon applying the filter to the input signal, we can compare the difference between the input and output frequency spectrum. Noise component (835Hz, 1530Hz) no longer exist in the frequency spectrum of the output signal!
The detailed code is as follows:
1 | [xn fs]=audioread('input.wav'); |