next up previous
Next: About this document

EE 643 Project #1 Spring 1999


Assigned: 4/7/99     Due: 4/14/99

Sampling Rate Changes

This project will investigate methods for changing the sampling rate in the discrete-time domain.

Getting Started

  1. Run user-setup and select math/matlab/5.3.
  2. Edit your .cshrc file. In the personal customization area, add the line:
    setenv MATLABPATH /home/sigproc/sjreeves/matlab/teaching
    
  3. To make these changes go into effect without having to logout and log back in, type
    % source .cshrc
    
    at the command line of the window in which you are working.
  4. Invoke Matlab by typing matlab at the command line.
  5. To become familiar with some of the ``gee-whiz'' capabilities of Matlab, try running demo and then clicking on ``Mathematical examples'' and then ``Fourier Series''. Pay attention to the text that is generated in the window. This text shows the Matlab commands that were used to generate the examples. You may also wish to explore some of the other examples by clicking on different buttons.
  6. Run intro to get an idea of the basic capabilities of Matlab.
  7. You can type doc at any time to get a hypertext version of the Matlab Reference Guide or help <cmd> to get help on specific commands.

Exercises

  1. Sample the waveform at a sampling frequency of 8 KHz for one second. Plot the magnitude (use abs of the DFT (use fft Is this what you would expect? Explain.
  2. Downsample the discrete signal by a factor of 2. Explain the appearance of the DFT magnitude.
  3. Decimate the discrete signal by a factor of 2. View the DFT magnitude of the result, and explain what you see.
  4. Read in the audio file /opt/demo/audio/feel-good.au using auread Downsample by a factor of 4. Decimate by a factor of 4. Compare the original DFT magnitude to the DFT magnitudes of the two modified signals.
  5. Interpolate (interp) the downsampled and the decimated audio signals so that they have the same sampling rate as the original. Listen to the original and the two modified signals using sound NOTE: If you can't listen on the workstation where you are, go to a PC being used as an X server. Save the file using wavwrite, then click on the file in Windows Explorer to listen on the PC. Describe and explain the differences in what you hear.
  6. Write a simple m-file that implements the decimate function, using only index manipulation, the filter function, and the fir1 function.
  7. Write a simple m-file that implements the interpolate function, using only index manipulation, the filter function, and the fir1 function.
  8. Write a simple m-file that will change the sampling rate by a rational factor. (It can be built using the m-files above.) The function should be of the form my_resample(x,L,M). Resample the audio signal at a new sampling rate that is 3/2 the original rate, using your m-file as well as the Matlab command resample. Compare the sound of the two results as well as the execution speed of the two resampling routines (using cputime Speculate on any differences you observe.

Write a short report describing your findings. The report should contain a concise description of your results. Include listings of your function. Be sure to answer all questions. You are not expected to include in the report all plots which you were required to do; instead, you should summarize in your report the important features of the unincluded plots.

For further help:





next up previous
Next: About this document



Stan Reeves
Thu Apr 8 10:42:14 CDT 1999