Homework 3: Spectral Analysis


Due: 10 am, September 19 (Thursday).

In this week's lab, we will modulate a carrier wave with a PRN code sequence. In particular, we'll look at the signal in the frequency domain. This allows us to see the spread spectrum nature of the GPS signal. First, we need to know how to generate a sine wave, and compute the spectrum of this unmodulated carrier. This is the focus of this week's prelab. Note: this can be a stand-alone program - it does not have to be a function.

Most of you should you have learned rudimentary spectral analysis terms in ASEN 3300. Those who have not taken 3300 or a similar class can drop by my office for additional help.

Generate a sine wave and power spectrum of given characteristics:

Your program must follow these steps:

  1. Define N
  2. Define sampling period Ts (in seconds)
  3. Define sampling frequency Fs = 1/Ts
  4. Use N points and Tsto generate time signal starting from 0.
  5. Define a sine wave function (SWF) using F1 and F2 (SWF = amplitude*sine(2*pi*time*freq)).
  6. Plot the SWF in the time domain between 0 and 0.4 seconds.
  7. Y = fft(SWF) computes the Fast Fourier Transform.
  8. Ps = Y.*conj(Y)/N computes the power spectral density.
  9. F = Fs*(0:N/2-1)/N creates the frequency axis, starting at zero and ending at the Nyquist frequency.
  10. Plot frequency vs. power spectral density (Ps(1:N/2)). Don't worry about the y-axis units, but do define the x-axis units.
Turn in: your code and two plots.