Homework 6 (Due: October 17)

[PDF]

ECE 460: Communication and Information Theory
Prof. B.-P. Paris
Homework 6
Due: October 17, 2018

Reading
Madhow:
  1. Chapter 3
Problems
  1. You are to design an adaptive algorithm to control the gain in a receiver. This is an important problem as the received signal’s power is unknown and variable. It is critical to amplify the received signal before AD conversion so that the full range of the AD converter is being used and severe quantization effects are avoided.

    The diagram below shows a simplified block diagram of the receiver; we are omitting the down-conversion elements since they do not affect the gain control problem. You are to design an adaptive automatic gain control (AGC) algorithm for iteratively adjusting the gain G of the amplifier.

    SVG-Viewer needed.

    Your algorithm must accomplish the following.

    • It measures the average power of the samples r[n] out of the AD converter. The averaging period is N samples.
    • It compares the measured power to a target power level Pt. Formulate a suitable objective function that is minized when the measured power equals the target power.
    • Determine the derivative of your objective function with respect to the amplifier gain G. For this purpose, you must determine how the power in the samples r[n] varies with G.
    • Formulate an iterative update rule for adjusting the gain G.

    Demonstrate that your algorithm works correctly via a simple MATLAB simulation.

  2. Write a MATLAB function that amplitude modulates a baseband signal and produces a passband signal that is suitable for “transmission” through a speaker.
    1. Your MATLAB function must have the following function signature
      function sp = ampModulate(ss, fc, BW, modIndex, fc)
      where
      • sp - samples of the amplitude modulated signal
      • ss - (possibly complex) samples of the baseband signal
      • fc - carrier frequency in Hertz
      • BW - the bandwidth of the baseband signal
      • modIndex - the modulation index; if this is infinite (inf) then the carrier is suppressed.
      • fs - the sampling rate of the system

      Your function must perform the following functions:

      • Verify that fc+BW is less than fs/2. Produce an error message if this condition is violated.
      • Ensure that the baseband signal is bandlimited to bandwidth BW. Pass the samples ss through a low-pass filter with cut-ff frequency BW to achieve this.
      • Normalize the filtered signal so that the smallest sample value equals -1. If the baseband signal is complex valued, take the minimum over both real and imaginary part.
      • Add the carrier so that the specified modulation index is achieved. The carrier is added only to the real (in-phase) part of the signal.
      • Upconvert the signal to the specified carrier frequency.
    2. Verify that your function works correctly by exercising it with the following signals.
      • Use a low frequency sinusoid as the baseband signal. Plot the resulting passband signal for different values of the modulation index. Make sure that you choose values of fs that produce plots that you can actually analyze.
      • Use a speech signal (e.g., the one we used in class) as the baseband signal and compute the spectrum of the passband signal. The MATLAB spectrum function is very helpful for this purpose; it is called like this:
        h = spectrum.welch; % Create a spectrum estimator.
        Hpsd = psd(h,sp,’Fs’,fs); % Calculate the PSD
        plot(Hpsd) % Plot the spectrum
        Ensure that the bandwidth of the passband signal is as expected.
  3. Write a MATLAB function that demodulates an amplitude modulated signal and recovers the original baseband signal.
    1. Your MATLAB function must have the following function signature
      function ss = ampDemodulate(sp, fc, BW, isIQ, fc)
      where the variable names are as above. The logical variable isIQ indicates if the receiver should recover only the I-channel (isIQ is false) or both the I and the Q-channel.
    2. Verify that your function works correctly by demodulating the signals that your amplitude modulator produces.
    3. Bonus: Implement phase and frequency tracking in your demodulator so that signals are recovered even if the received signal has been subject to phase and/or frequency offsets. Verify that your system works correctly.