Homework #8: Audio Filtering

Christopher M. Smemoe , Computer Science 450


Table of Contents

1. Listening to the waveform

2. Fourier transform and power spectrum of the waveform

3. Butterworth filter on the waveform

4. The second waveform (van.ub)

5. The final waveform (evlhmer.ub)

 

 


1. Listening to the waveform

There is a speech waveform, v1, found at ~mtappen/lab9/snikes.ub <van.ub>. Listen to the waveform using send_sound and see if you can recognize the person behind the voice. Who do you think it is?

I think it is Homer Simpson.

Here is a table of the original and final filtered waveforms that you can download:

Original sound file

Vowel out of sound file

Filtered sound file

"snikes"

snikes.ub

snikesvowel.ub

snikesout.ub

"van"

van.ub

vanvowel.ub

vanout.ub

"evlhmer"

evlhmer.ub

evlhmerout.ub

Here is the source code used for this assignment: fouriersound.c butterworth.c

Note: On all graphs, the larger magnitude values at the beginning and end of the transforms/power specta have been taken off to see the smaller-magnitude variations in the plots.

Return to the Table of Contents

 

2. Fourier transform and power spectrum of the waveform

Compute the Fourier Transform, V1, of v1 and report the highest nonzero frequency found in the spectrum. Compute the sampling rate. Does it appear that the signal was digitized at a sufficiently high (i.e. Nyquist) rate? Why or why not?

Fig 1: The real part of the fourier transform of the snikes.ub waveform

Magnitude of highest nonzero frequency: 759288

Frequency cutoff point: about 5000

Fig 2: The real part of the fourier transform of the van.ub waveform

Magnitude of highest nonzero frequency: 4688765

Frequency cutoff point: about 15000

Sampling Rate: 11025 Samples/second

Yes, it appears that the signal was digitized at a sufficiently high rate since all the variations in the input waveform (the digital audio signal) can be heard and the sample is more than 2*the frequency cutoff point. (Possibly not on van.ub)

Plot the Power Spectrum, |V1|^2 of the entire waveform, v1. Also plot a .5 sec portion of a voweled sound in v1. Indicate which voweled sound it is. Include a copy of the plots in your write-up.

Fig 3: The power spectrum of the snikes.ub waveform

Fig 4: The real part of the fourier transform of the "Ho" part of the snikes.ub waveform

Fig 5: The power spectrum of the "Ho" part of the snikes.ub waveform

Fig 6: The power spectrum of the van.ub waveform

Fig 7: The real part of the fourier transform of the "a" part of "van" of the van.ub waveform

Fig 8: The power spectrum of the "a" part of "van" of the snikes.ub waveform

Return to the Table of Contents

 

3. Butterworth filter on the waveform

When transmitting signals (over the internet, for example), it is good to use as little bandwidth as necessary (i.e. bandwidth = $s). To find out how much bandwidth is necessary, low-Pass Filter V1 in the frequency domain - using the Butterworth filter - to produce a filtered spectrum V1'.

Begin with n=1 and uc set to the highest nonzero frequency. Then gradually decrease uc, compute the inverse transform, and listen to the resulting v1'. Repeat this until the filtered speech becomes unintelligible. experiment with n to altar the steepness of the cutoff to see if increasing n will allow you to further decrease uc.

Report your final values for n and uc, and conclude what bandwidth is needed for a speech/phone system? Plot the final Butterworth Filter used to filter V1 and the (filtered) Power Spectrum, |V1'|2. Include a copy of the plots in your write-up.

Butterworth Coefficient Results

Butterworth n-value
Butterworth uc-value

snikes.ub

0.7
500.0

van.ub

0.6
3000.0

evlhmer.ub

0.65
1750.0

Required Bandwidth:

Bandwidth required for full range of frequencies = 11025 samples/sec*8 bits/sample = 86.6 kbps

Bandwidth required for the voice spectrum = about 5% of that required for full range = 4.3 kbps

Fig 9: Butterworth filter used to filter snikes.ub

Fig 10: The power spectrum of the filtered snikes.ub waveform

Fig 11: Butterworth filter used to filter van.ub

Fig 12: The power spectrum of the filtered van.ub waveform

Return to the Table of Contents

 

4. The second waveform (van.ub)

Repeat 1-3 for signal v2 found at ~mtappen/van.ub:

See results above.

Return to the Table of Contents

 

5. The final waveform (evlhmer.ub)

Now, using the average values for n and uc, (found for v1 and v2), apply your Butterworth Filter to one last signal, v3, found at ~mtappen/lab9/evlhmer.ub before actually listening to v3. You will, of course, need to compute V3 first.

Write down what you think is being said in v3'. Then write down what is being said bylistening to v3. What can you conclude about the bandwidth needed to record and transmit speech in general, and v3 in particular?

What is being said: I am evil Homer...I am evil Homer...etc.

The bandwidth required for speech varies, but averages about 5% of the total bandwidth of the original audio stream. This is quite a bit less than what is required if you want the full range of frequencies. Also, you can hear a little more of the lower frequency stuff (cymbals in the background) if you apply the butterworth filter to the speech/music stream in v3.

Fig 13: The power spectrum of the filtered evlhmer.ub waveform

Fig 14: Butterworth filter used to filter evlhmer.ub

Return to the Table of Contents

 


smemoe@byu.edu
Date last modified: 12/1/1999