Line 29: Line 29:
 
[[Image:freq_audio.jpg]]
 
[[Image:freq_audio.jpg]]
 
*The code for the above can be obtained here: [[Link title]]
 
*The code for the above can be obtained here: [[Link title]]
*As expected, most of the energy of the signal, in this case the bird's high frequency voice, is concentrated in the frequency band of around 2000 - 8000 Hz.
+
*As expected, most of the energy of the signal, in this case the bird's high frequency voice, is concentrated in the frequency band of around 2000 - 6000 Hz.
 +
*To filter this out, we can apply a low-pass filter with a cutoff frequency of around 2000 Hz.
 +
 
 +
*Here's what the frequency domain looks now.
 +
 
 +
[[Image:filtered_sound_freq.jpg]]

Revision as of 20:56, 13 October 2009

Audio Signal Filtering

Background

  • Audio signals in the digital world are simply 1-D signals that contain the values of the sampled sound v/s an index, say k.
  • Consider the diaphragm on a microphone, that vibrates every time a sound impinges on it.
  • The vibration is converted to an electrical signal by a transducer, which then relays the "analog" signal to an A/D converter.
  • Finally, the A/D converter samples the analog signal, and makes it a train of samples; each box of the train contains a value.
  • This value corresponds to the digital representation of the electrical signal that resulted from the vibration.
  • For example, say the diaphragm vibrated 0.2mm, resulting in a generated voltage of 0.2mV (these values are completely arbitrary).
  • If the A/D converter designated 0V to x00 and 10mV to xFF, then the resolution of designating values to the samples would be 10/255 mV or .04mV. Thus, 0.2 mV would be x05.
  • This value would be stored in the digital sound file, against a time index corresponding to when the A/D received this sample.
  • Since this page focuses on Audio Signal filtering, those interested in the basics of Audio Processing can go to the references on the following wiki:
  • http://en.wikipedia.org/wiki/Digital_audio


Motivation

  • This page took a long time to figure out. Mainly because, for images and sine waves, it's easy to find some that aren't copyrighted.
  • For images you just use your pet dog's best photograph, and for sine waves, you write a line in MATLAB.
  • But for audio signals, almost every recorded sound is copyrighted in some way or the other, and to avoid being sued for copyright infringement, I had to find sounds to play with, and publish online, that weren't "owned", so to speak.
  • Fortunately, however, animals don't take you to court for stealing their sounds, so that's just what I did.
  • On this page, I experiment with two animal sounds; the first is a high-frequency bird pitch, while the second is a low-frequency bear rumble.

The Song-Bird Experiment

  • So, let's begin with the song-bird. Click on the link to here the sound >>Media:song_bird.wav
  • In the following figure, you can see what the sound looks like both in the time domain, and the frequency domain.

Time audio.jpg Freq audio.jpg

  • The code for the above can be obtained here: Link title
  • As expected, most of the energy of the signal, in this case the bird's high frequency voice, is concentrated in the frequency band of around 2000 - 6000 Hz.
  • To filter this out, we can apply a low-pass filter with a cutoff frequency of around 2000 Hz.
  • Here's what the frequency domain looks now.

Filtered sound freq.jpg

Alumni Liaison

Basic linear algebra uncovers and clarifies very important geometry and algebra.

Dr. Paul Garrett