next up previous
Next: About this document ...

ELEC 5410/6410 Project #3 Fall 2009

Assigned: 9/11/09 Due: 9/18/09

Sampling and Reconstruction

This project will investigate the effects of sampling and reconstruction.

  1. Examine a sampled waveform:
    1. Sample the waveform $x(t) = 2\cos 4000\pi t + \cos 1000\pi t$ at a sampling frequency of 16 kHz for one second:
      t = [0:1/16000:1];
      xc = 2*cos(4000*pi*t) + cos(1000*pi*t);

      We will treat this as though it is a continuous-time signal, since it is sampled without aliasing.

    2. Plot the first 100 points of the signal with an appropriately labeled t axis. (Note that you should use plot for signals that represent continuous time but stem for signals that are to be thought of as discrete. Functions of t and $\omega$ are continuous.)

    3. Plot the Fourier-transform magnitude of $x(t)$ with the following command:
      plot([-8000:7999],fftshift(abs(fft(xc(1:2*8000)))))
      xlabel('frequency (\times 2\pi rad/s)')

    4. Explain how this graph corresponds to the actual Fourier transform of $x(t)$.

  2. Now we will consider the effect of sampling on the original signal.
    1. Sample the waveform $x(t) = 2\cos 4000\pi t + \cos 1000\pi t$ at a sampling frequency of 8 kHz for one second.

    2. Plot using stem the first 100 points of the signal with an appropriately labeled n axis.

    3. Plot the DTFT magnitude:
      plot([-4000:3999]/8000,fftshift(abs(fft(x(1:8000)))))
      xlabel('frequency (\times 2\pi rad/sample)')

      It may also help to plot three repeated copies of the spectrum and try to identify where the spectral components of each original spectrum are in that plot:
      plot([-12000:11999]/8000,repmat(fftshift(abs(fft(x(1:8000)))),[1 3]))
      xlabel('frequency (\times 2\pi rad/sample)')

    4. Does aliasing occur? Explain.

  3. Now consider a different sampling rate:
    1. Sample the waveform in #1 at a sampling frequency of 3 kHz for one second.

    2. Determine how to plot the Fourier magnitude as above. You may also want to plot the repeated spectrum as above to better visualize the original spectrum within the repeated copies.

    3. Explain the differences between this plot and the one in #2 based on the properties of sampling.

    4. Does aliasing occur?

  4. We will now attempt to reconstruct the signal in #1 from the sequence in #2 using zero-order hold.
    1. Form a zero-order hold signal with 2 equal output samples per input sample. Plot the first 100 points.

    2. Plot the FT magnitude using the syntax from #1, and explain what you observe.

    3. Lowpass filter the ZOH signal as follows:
      h = fir1(9,1/2);
      xr = filter(h,1,xzoh);

    4. Plot the first 100 points.

    5. Plot the FT magnitude of the result using the syntax from #1. Explain what you observe. Is the signal in #1 perfectly reconstructed? Justify your answer.

  5. Play the sound from #1, the ZOH sound, and the reconstructed sound using:
    soundsc(x,16000)

    Note any differences in the sounds. (You may need a set of headphones in the lab.)

  6. 6410 and extra credit for 5410: Reconstruct the signal in #1 from the sequence in #2 using linear interpolation. (See p. 70 in Mitra for discussion.) You must use the filter function to get maximum credit. Compare the FT magnitude to the ZOH interpolation and the original. Explain the differences.

Write a short report describing your findings following my format instructions. The text should be no more than two pages of 12-point type with 1.5 line spacing, not including plots. The report should contain a concise description of your results. Include all plots you were required to generate. Include the plots as small as possible within the text of the report, not at the end. Be sure to answer all questions.

NOTE: All out-of-class work is to be done independently. Sharing of programming tips and discussing general concepts is ok. Collaborating on experiments or code-writing is not. Any such collaboration on these assignments will be considered an act of dishonesty and will be treated accordingly.

For further help:




next up previous
Next: About this document ...
Stan Reeves 2009-09-18