Digital Signal Processing - Exercise 1

Removing interference from audio


First set your PATH to include my ``bin'' directory, so you can access my executables:

    PATH=$PATH:/usr/fisher/mipsbin
    export PATH
This file contains an extract from a film sound-track. (I'm told it's ``Return of the Jedi''.) It can be played by
    play corrupt.au
if you're logged on to an Indy; if not you'll have to take my word for it. The data can be written as a sequence of Ascii floats on standard output by
    aucat corrupt.au
and the inverse function is provided by:
    autac file.au
which reads a sequence of Ascii floats on standard input and creates a file in .au format containing the audio data.

The audio in corrupt.au has been corrupted by the addition of a small amount of white noise, some clicks, and a constant tone.

You are asked to perform the following steps.

  1. Using the FFT program provided, measure the frequency of the interfering tone. The executable is in my $PATH so you don't need to compile it, but have a look at the source anyway. You could start by trying
        aucat corrupt.au | head -1024 | fft -pw | plotit
    
  2. Write a program called notch which implements an IIR notch filter, tuned to the frequency identified in Step 1 above. Use mkfilter. The main program will have the form
        for (;;)
          { read a value x;
    	if (end of file) break;
    	pass x through notch filter to give y;
    	write out y;
          }
    
  3. Insert your notch filter program into the pipeline:
        aucat corrupt.au | head -1024 | notch | fft -pw | plotit
    
    and check that the tone has gone, while the wanted signal (and, unfortunately, the noise) remain. If you've got it right, the tone should be undetectable on an FFT. If you're on an Indy, listen to the result:
        aucat corrupt.au | notch | autac temp.au
        play temp.au
    
  4. Experiment with different Q values, etc.

  5. If time allows, consider performing the FFT as part of your program and adjusting the centre frequency of the notch filter dynamically.
The original (uncorrupted) version of the sound-track is here.


Tony Fisher / fisher@minster.york.ac.uk