##### Personal tools
•
You are here: Home Computer Assignment 2

# Computer Assignment 2

##### Document Actions
Objective:  The objective of this lab is to deepen understanding of asynchronous demodulation principles for sinusoidal amplitude modulation through building simulation systems and visualizing intermediate signals.

Envelope Detection
1. Our first task is to develop a Simulink model of an envelope detector.  The circuit diagram of an envelope detector is as follows.

2. Roughly the operation of this circuit is as follows.  When the input voltage is greater than the output voltage, the output voltage tracks the input.  When the input voltage falls below the output voltage, the output voltage decays exponentially with time constant 1/RC.  This functionality is easy to build into a Simulink model as shown below.

3. The parameters for the MATLAB Fcn block are as shown here.

4. The value ToverRC in the exponential is the value of T/RC where T=1/fs is the time between samples.  The matlab function implements the logic described above--output the input if the input is greater than the output otherwise output a decayed version of the previous output.  This was described in step 2 above.
5. Note that the operation of the diode has been replaced by the Abs function.  This means that we are tracking the envelope of the absolute value of the signal rather than the positive part of the signal.
6. Add the rest of the blocks as shown below.

7. Set the sample rate to fs = 1000 Hz and the frequency of the sinusoidal signal to fc = 10 Hz.  Set ToverRC =  5/fs.  Run the simulation for 1 seconds.
8. Bring up the scope and you should see this.
9. The cyan signal is the sinusoidal input, the purple signal is the absolute value of the sinusoid, the yellow signal is the envelope detector output.  This shows that the envelope detector is working correctly.

Asynchronous Amplitude Modulation and Demodulation with Sinusoidal Carriers
10. Add to your simulink model a carrier modulated signal.  Let the information signal also be a sinusoid.  Because demodulation will be performed asynchronously, add a constant to the information signal before carrier modulation.  Your model should look something like this.  I have added a MUX and a scope in order to visualize the important signals in this system.

11. The envelope detector is colored in light blue.
12. A low pass filter has been added to smooth out the ripples left over by the envelop detector.
13. Use the following simulation parameters:
• Sample rate:  fs = 3000 Hz
• Carrier frequency:  fc = pi*100 Hz (irriational frequency)
• Information source frequency:  fm = 10 Hz
• Modulation index:  m = 0.5 (50% modulation)
• Duration of simulation:  6 seconds
14. You will need to reset the ToverRC parameter so that the envelop detector output tracks the envelope of the information signal which is a sinusoid in this case.
15. The low pass filter needs to be designed.  The highest frequency in the information signal is fm = 10 Hz.  Therefore, the pass band of the low pass filter must be at least 10 Hz.  Let's use the butter function (which designs butterworth low-pass filters) as follows:
16. [lpfn,lpfd] = butter(6,2*fm/(fs/2));
17. Here is a look at the four signals:  information signal, modulated signal, envelope detector output, and demodulated signal (low pass filtered version of envelope detector output).

18. Since it is difficult to see what is going on, in this figure, consider the figure below which is zoomed in to the important part.

As can be seen, the demodulated signal does not match exactly the information signal.  There is a small delay which is due to delay through the low pass filter and there is a small attenuation.

19. Here is a look at the same four signals in the frequency domain.  The figure below is the information signal after adding on the DC offset, which makes asynchronous demodulation possible.  The upper plot shows the full scale spectrum and the lower plot shows the spectrum from -20 to +20 Hertz.  When zoomed in, you can see the three signal components:  two due to the sinusoidal information and one due to the DC offset.

20. The spectra below are for the modulated signal.

21. The figure below shows the spectra of the envelope dectector output.  The ripples on the time domain waveform give rise to the low replicas of the desired signal.

22. Finally, the figure below shows the output of the low pass filter that follows the envelope detector.  Can you see why the low pass filter was designed with a transition band from 10 Hz to 90 Hz?

23. The purpose of the low pass filter is to pass the baseband spectrum and reject the strong spectral components.  It appears that the low pass filter that we designed does accomplish this objective.  The original information signal is accurately recovered.

24. To complete this lab, do the following.
• Print a copy of your model.
• Print spectral plots of the four signals.
• Print plots of the four signals in the time domain.  Zoom in to show just one period of the information signal.
• Explain why the constant was added to the information signal before carrier modulation?
• Change the constant to 0.5 and run the simulation over again.  The information signal is not recovered.  Why not?
• What does the additive constant do to the spectrum of the modulated signal?
• Explain how the passband and stopband edge frequencies should be chosen for the lowpass filter that follows the envelope detector?
• In what way is the lowpass filter that follows an evenlope detector the same or different from the lowpass filter used in the synchronous demodulator in Lab 1?
Copyright 2008, by the Contributing Authors. Cite/attribute Resource . admin. (2006, June 28). Computer Assignment 2. Retrieved January 07, 2011, from Free Online Course Materials — USU OpenCourseWare Web site: http://ocw.usu.edu/Electrical_and_Computer_Engineering/Communication_Systems_I/lab2.html. This work is licensed under a Creative Commons License