Profile picture

\ \NoIze/ / Demo

Last updated: October 8th, 20192019-10-08Project preview

Imgur

Welcome to our package. Here you can access the project's documentation or code repository. To sum up the project quickly, we use a convolutional neural network (CNN) to classify background noise which a Wiener and post filter will remove from the signal.

To follow along this demo, headphones are recommended to notice small changes in the signals. (Don't forget to turn down the volume first as you can always turn it back up.)

If you just want to read along and hear some audio, ignore the snippets of code. However, I encourage you to fork this notebook so that you can experiment with the examples. You don't have to download or install anything onto your computer. If you don't have an account with 'notebooks.ai', you can create a free one here.

Outline

1) Simple filtering example

  • Wiener filter
  • Wiener filter + post filter
  • Smart noise filter: CNN + Wiener + post filter

2) Complex filtering example

  • Wiener filter
  • Wiener filter + post filter
  • Smart noise filter: CNN + Wiener + post filter
In [2]:
# install what is required to use NoIze:
!pip install -r requirements.txt
import noize

# what is necessary to play audio files in this notebook:
import IPython.display as ipd
from scipy.io.wavfile import read

Set directories for the software

We need to tell the program where to find and also save audio files.

In [3]:
path2filter_files = './audiodata/filtering_files/'

Simple example: rain background noise

In [20]:
file2filter = '{}can_you_hear_the_rain.wav'.format(path2filter_files)
sr, samps_unfiltered = read(file2filter)
ipd.Audio(samps_unfiltered,rate=sr)
Out[20]:

Basic approach:

Apply Wiener filter using beginning 1 sec background noise

In [21]:
duration = 1000 # in milliseconds

outfilename_wiener = '{}filtered_rain_wiener.wav'.format(path2filter_files)
noize.filtersignal(outfilename_wiener, file2filter, duration_ms = duration)
volume adjusted from 1.25 to 0.33
Wavfile saved under: audiodata/filtering_files/filtered_rain_wiener.wav
In [22]:
sr, samps = read(outfilename_wiener)
ipd.Audio(samps,rate=sr)
Out[22]: