Personal tools
You are here: Home Electrical and Computer Engineering Communication Systems I Amplitude Modulation, Synchronous Demodulation and Designing Low-pass Filters

Amplitude Modulation, Synchronous Demodulation and Designing Low-pass Filters

Document Actions
  • Content View
  • Bookmarks
  • CourseFeed
  • Create a Matlab function to compute and display the spectra of signals
  • Learn how to design low-pass filters
  • Implement an amplitude modulator
  • Implement a synchronous demodulator
  1. Create a signal by typing the following at the Matlab prompt:
  2. % Sample rate in Hertz
    fs = 256;
    % Number of samples of the signal
    NumSamples = 10^4 + 1;
    % Define a time vector
    t = [-(NumSamples-1)/2:(NumSamples-1)/2].'/fs;
    % "Cut off" frequency of signal
    fco = 4;
    % Create a sinc function
    x = 2*sin(2*pi*fco*t)./t;
    x((NumSamples+1)/2) = 2*2*pi*fco;
    % Chebyshev window for spectral shaping
    win = chebwin(NumSamples,80);
    % Apply the window
    x = x.*win;
  3. Write a function for computing and displaying the spectrum of this signal or download sigspec.m
  4. Display the spectrum of the signal x .  The figure below shows the magnitude spectrum in linear and logarithmic formats.

  5. Since demodulation involves low-pass filtering, we will learn how to use a function for designing low-pass filters.  Remez is a convenient function for designing low-pass filters and is implemented in Matlab.  The syntax is:
  6. h = remez(N,F,A,W);

    • N is the filter order.  The length of the filter will be N+1 .
    • F=[0, fpass, fstop, (fs/2)]/(fs/2) is a vector containing the critical frequencies of the filter:  fpass is the upper edge of the pass band, fstop is the lower edge of the stop band, and fs is the sample rate at which the filter will be used.
    • A=[1, 1, 0, 0] is a vector that tells what the gain of the filter should be at the critical frequencies specified in the F vector.  For example, A=[2, 2, 0, 0] will give a gain of  two in the pass band.
    • W=[wpass, wstop] is a vector of weights that controls the ripple in the pass and stop bands and is an optional argument.  The default is W=[1, 1] .  If the stop band attenuation is not sufficiently low, set W=[1, 10] .
  7. Design a low pass filter with 31 taps with pass and stop band edges at 4 and 60 Hz, that will filter a signal sampled at a rate of 256 samples per second.  The filter should have a gain of two in the pass band and use the weight vector W=[1, 10] .  Using your function for computing and displaying signal spectra, plot the frequency response of the filter you designed.  Linear and log magnitude plots of the filter frequency response are shown below.

  8. In Simulink, build a simple AM modulator and synchronous demodulator using a cosine carrier with carrier frequency 32 Hz.  Modulate the signal x created above.  The highest frequency in x is 4 Hz.  Design an appropriate low-pass filter for the demodulator using the remez function as described above.  Use a sample rate of 256 Hz for the simulation.  A block diagram illustrating the modulator and demodulator is shown below.  HINTS

    • I recommend using "Signal From Workspace", "Signal To Workspace", and "Sine Wave" blocks from the Signal Processing Blockset library.  The "Discrete Filter" block is in the Discrete library and the "Product" block can be found in the Math Operations library.
    • Double click on a block to configure its parameters.
  9. Display the spectrum of the signals at each point in the modulator/demodulator.  The two figures below illustrate the spectra using linear and log magnitude plots.
    • The first plot of the five shows the spectrum of the original signal.  Use the zoom feature in the figure window to verify that the highest frequency is 4 Hz.
    • The second plot illustrates the spectrum of the cosine carrier which consists of a pair of "impulses".
    • The third plot shows the spectrum of the modulated signal.  Does it have have the amplitude of the original spectrum?
    • The fourth plot shows the low pass filter response superimposed on top of the spectrum of z.  As expected, the spectrum of z consists of three replicas of the original spectrum.  Do these replicas have the correct scaling?
    • The fourth plot also shows that the low pass filter attenuates the double frequency components by about 75 dB.
    • The fifth plot shows that the original spectrum is recovered (with negligible distortion) after low pass filtering.

  11. List the information you gave to the remez function to design the low-pass filter for your demodulator.  What is the stop band attenuation and the pass band gain of the filter you designed (see the log magnitude frequency response).
  12. Plot the spectra of the signals and the low-pass filter (linear and log magnitude) as illustrated above.
  13. Explain why the spectra of the demodulator output does not match exactly the original spectrum (see the log magnitude spectrum).
  14. Explain why the spectrum of the carrier in the log magnitude plot is not exactly a pair of delta functions.
Copyright 2008, by the Contributing Authors. Cite/attribute Resource . admin. (2006, June 28). Amplitude Modulation, Synchronous Demodulation and Designing Low-pass Filters. Retrieved January 07, 2011, from Free Online Course Materials — USU OpenCourseWare Web site: This work is licensed under a Creative Commons License Creative Commons License