Docstoc

Lab _5 Amplitude Modulation

Document Sample
Lab _5 Amplitude Modulation Powered By Docstoc
					SYSC 3500                            Signals and Systems                              Fall 2010

                        Lab #5         Amplitude Modulation

Objectives:
   •   To appreciate the effects of lowpass filtering on audio signals.
   •   To gain an understanding of amplitude modulation and frequency division multiplexing.
   •   To increase familiarity with signal processing in MATLAB.

Introduction:
This lab involves the processing of audio signals in MATLAB. To begin, you should use the
provided microphones to record two different five-second audio clips, sampled at f s = 16000
samples per second. The following MATLAB commands can be used to make a recording (put
these commands in a .m file):
       Fs = 16000;                     % sampling rate (Hz)
       rec = audiorecorder(Fs, 16, 1); % create recording device

       % record the signal for 5 seconds
       disp('Record your message now, and press ENTER when done.');
       recordblocking(rec, 5);

       % get the signal from the recording device
       msg = getaudiodata(rec, 'double')';

       % normalize the signal by ensuring its peak absolute value is one
       msg = msg / max(abs(msg));

       % play back the signal
       sound(msg, Fs);
You should run this code twice to create two different audio recordings. Store them as variables
msg1 and msg2, and save them to disk using
       >> save msgs.mat msg1 msg2
You can reload them later using
       >> load msgs.mat

If you don’t have a microphone you can use the pre-recorded signals in the file msgs.mat
provided on the course website.

Part I: Lowpass filtering of audio signals
1) Plot msg1 vs. time (in seconds). Can you see a correlation between what you recorded and
   the plot? Note that the audio recorder may not have recorded a full five-second clip. The
   actual duration of your clip is length(msg1)/Fs seconds.
2) Convert your recording to the frequency domain and plot the spectrum vs. frequency (in Hz).
   What range of frequencies is represented by your sampled data? Over what range of
   frequencies is the signal most strong?
3) Filter your recording with a lowpass filter with a cutoff frequency of 2000 Hz. You may find
   that frequency-domain filtering is easiest, as you’ll just need to set the high-frequency
   components of your signal to zero. Plot the spectrum of your filtered signal. Play your
   filtered signal and compare it to the original. Do they sound the same? Note: When
   converting your signal back to the time domain for play back, you will likely need to take
   just the real part of the signal produced by ifft( ). That is, if S is the frequency domain
   version of your filtered signal, the time domain version is:
               >> s = real(ifft(fftshift(S)));
   Also, you should normalize your signal after filtering. Because the sound card in your
   computer clips amplitudes bigger than one, you should scale your signal so that it’s biggest
   value is one, by using:
               >> s = s / max(abs(s));
4) Repeat Question I.3 with cutoff frequencies for 1000 Hz, 500 Hz, and 250 Hz.
5) Filter msg1 and msg2 with a lowpass filter with a cutoff frequency of 2000 Hz. Save your
   filtered signals for use in Part II.

Part II: Amplitude Modulation
1) Use your filtered version of msg1 to modulate the amplitude of a carrier wave with a
   frequency of f c = 100 Hz. Mathematically, if s (t ) is your lowpass signal, the modulated
   carrier would be:
       sc (t ) = s (t )cos(2π f ct )
   Play back your modulated signal. Does it sound different than the original?
2) Repeat Question II.1 with carrier frequencies of 200 Hz and 500 Hz.
3) Repeat Question II.1 with a carrier frequency for 3000 Hz. Plot the spectrum of the signal.
   How does it compare with the spectrum of the original signal as found in Question I.3? This
   type of signal (albeit with a higher carrier frequency) is very similar to the signals transmitted
   to AM radios. The AM radio receiver demodulates this signal to recover the original
   baseband signal.
4) Demodulate the signal from Question II.3 by multiplying it by another carrier wave with the
   same frequency (3000 Hz). Plot and discuss the spectrum of the signal. Play back the signal.
   How does it sound compared to the original?
5) Pass the signal from Question II.4 through a low-pass filter with a cutoff frequency of 2000
   Hz. Plot the spectrum of the signal and compare it to the original. How does the signal
   sound?

Part III: Frequency Division Multiplexing
1) Using the method described in Part II, use your filtered version of msg1 to modulate the
   amplitude of a carrier wave with a frequency of 2000 Hz, and use your filtered version of
   msg2 to modulate the amplitude of a carrier wave with a frequency of 6000 Hz. Add the two
   signals together, and plot the result in the time domain. Play back the combined signal. Can
   you hear both messages?
2) Plot the spectrum of your combined signal from Question III.1. Discuss this figure.
3) Demodulate the signal from Question III.1 by multiplying it by a carrier wave with a
   frequency of 2000 Hz and filtering it with a cutoff frequency of 2000 Hz. Play the resulting
   signal. Discuss what you hear.
4) Demodulate the signal from Question III.1 by multiplying it by a carrier wave with a
   frequency of 6000 Hz and filtering it with a cutoff frequency of 2000 Hz. Play the resulting
   signal. Discuss what you hear.

Part IV: Bonus Question
The file bonus.mat on the course website contains two signals that are frequency division
multiplexed together, one at 2000 Hz and one at 5500 Hz. Using the techniques from Part III,
play back both messages.