\documentstyle[11pt]{article}
\addtolength{\topmargin}{-1in}
\addtolength{\footskip}{-1in}
\addtolength{\textheight}{2in}
\addtolength{\oddsidemargin}{-.5in}
\addtolength{\evensidemargin}{-.5in}
\addtolength{\textwidth}{1in}

\begin{document}

\begin{center}
{\large 6.003 Project 2: Analog Communication Systems} \\
{\LARGE Amplitude Modulation and Frequency Modulation} \\
{\large Juliet C. Bourne \\ May 7, 1990}
\end{center}

\section{Introduction}

Amplitude modulation and frequency modulation are two ways of
transmitting waveforms along a band-pass spectral region. By limiting
a waveform to a band-pass spectral region, many waveforms can be
transmitted at once (occupying different band-pass spectral regions)
without interfering with each other. 

Amplitude modulation and frequency modulation use sufficiently
different methods that describing and comparing them can be very
informative. The most convenient way to demonstrate AM and FM is with
the Signal Handling Environment (SHE). 

\section{Examples of Low-Pass Modulating Waveforms}

Using SHE, example waveforms can be generated for the purposes of
demonstating amplitude and frequency modulation.

\begin{figure}[h]
\vspace{2.5in}
\caption{Some examples of waveforms to be modulated.}
\end{figure}

\vspace*{-.25in}
\begin{figure} 
\begin{verbatim}
(define sinewave (make-signal 'f '(-3 -3) 0&.5 '(3 3) 0&-.5))
(define squarewave 
   (mul-signals 'f (impulse-train 't 256)
                   (make-signal 't '(-128 0) -1000 '(0 128) 1000)))
(define triwave (mul-signals 'f squarewave squarewave))
(define random (mul-signals 'f noies-signal lpf)
(define noise-signal (noise 10))
(define lpf (make-signal 'f '(-4 4) 1))
\end{verbatim}
\caption{SHE code which generated these waveforms.}
\end{figure}

\section{Double-Sided AM Modulation}

Amplitude modulation consists of multiplying the waveform to be
modulated by a sinusoid at the desired carrier frequency. A constant
is sometimes added to the waveform to be modulated. The SHE code to
simulate this modulation is given in Figure 3.

\begin{figure}[h]
\begin{verbatim}
(define (modulate-signal signal const freq)
   (mul-signals 't (make-signal 'f (list (- freq) (-freq)) 0&.5
                                   (list freq freq) 0&-.5)
                   (add-signals 't signal
                                   (make-signal 't full-span const))))
\end{verbatim}
\caption{SHE code to simulate Amplitude Modulation}
\end{figure}

\subsection{Modulated Waveforms}

Using the code given above, low-pass waveforms such as the ones
described in section 2 can be modulated.

\subsubsection{With a Carrier}

Signals with a carrier are simulated in SHE by specifying a positive,
non-zero number when using \verb+modulate-signal+. The constant should
be chosen so that when it is added to the signal the greatest negative
part of the signal is greater than zero.

\begin{figure}[h]
\vspace{1.3in}
\caption{Modulated sinewave with a constant of 2.}
\end{figure}

\begin{figure}[h]
\vspace{1.3in}
\caption{Modulated squarewave with a constant of 2.}
\end{figure}

\newpage

\begin{figure}[h]
\vspace{1in}
\caption{Modulated ``random'' signal with a constant of 1.}
\end{figure}

As can be seen in these examples, the ``envelope'' of the signals now
lies completely above zero. The envelope describes the entire signal,
so that an envelope detector (see section 3.3) can recover the
complete signal. 

Also, looking at the transforms of these modulated waveforms provides
insight into how they are recovered. The transform of the modulated
signal is two copies (one inverse) of the transform of the signal (see
figure 7). 

\begin{figure}[h]
\vspace{2.5in}
\caption{Fourier transforms of modulated sinewave, squarewave, and
``random'' signals.}
\end{figure}

Either the upper or lower sidebands of these transforms can be
recovered and thus the complete signal can be recovered, which can be
seen by comparing the transforms of the modulated signals with the
transforms of the orginal signals (see figure 8).

\begin{figure}[h]
\vspace{2in}
\caption{Fourier transforms of sinewave, squarewave, and ``random''
signals.} 
\end{figure}

\subsubsection{Overmodulation}

One problem with amplitude modulation with a carrier is that if the carrier
constant is not chosen correctly, the resulting demodulated signal will be
distorted. The fact that the demodulated signal will be distorted can be seen
by just looking at the modulated waveform.  Since the entire envelope is not
above zero, demodulation by envelope detection will fail on the parts of the
signal that are still below zero (see figure 9).

\subsubsection{Without a Carrier}

Signals can also be modulated without first adding a carrier constant.
These have what is called a {\it suppressed carrier}. The signal to be
modulated is simply multiplied by the carrier sinusoid, as can be seen
in figure 10.

Although these modulated signals extend below zero, they can still be
recovered. Such suppressed carrier signals can be recovered using a
synchronous detector.

\begin{figure}
\vspace{.75in}
\caption{Overmodulated sinewave (constant = 0.5).}
\end{figure}

\begin{figure}
\vspace{.75in}
\caption{Modulated ``random'' signal without a carrier.}
\end{figure}

\subsection{Synchronous Detectors}

Simulating a synchronous detector consists of multiplying the
modulated signal by a sinusoid at the carrier frequency and then
passing the result through a low-pass filter. The SHE code for a
synchronous detector is in figure 11.

\begin{figure}[h]
\begin{verbatim}
(define (sync-detect signal freq bandwidth)
   (mul-signals 'f (lpf bandwidth)
                (mul-signals 't signal
                             (make-signal 'f (list (- freq) (- freq)) 0&.5
                                             (list freq freq) 0&-.5))))

(define (lpf w)
   (make-signal 'f (list (- w) w) 1))
\end{verbatim}
\caption{SHE code to simulate a synchronous detector}
\end{figure}

The results of passing the modulated sinewave and modulated squarewave to the
synchronous detector are shown in figure 12.

\newpage

\begin{figure}[h]
\vspace{1.5in}
\caption{Demodulation of suppressed carrier sinewave and squarewave using a
synchronous detector.}
\end{figure}

If the phase of the locally generated sinusoid is out of sync with the
carrier sinusoid, the resulting demodulated signal will be distorted.
Suppose, for example, that the synchronous detector was designed with
a cosine as the local sinusoid instead of the sine, i.e.
\verb+(make-signal 'f (list (- freq) (- freq)) .5 (list freq freq)
.5)+. Using this synchronous detector to try to demodulate a modulated
triangle wave with a carrier sinewave results in the distorted
triangle wave seen in figure 13. 

\begin{figure}[h]
\vspace{.75in}
\caption{Demodulated triangle wave with an out of sync synchronous
detector.}
\end{figure}

\subsubsection{Quadrature Modulation}

This same phase effect, however, can be used to independently send two
different waveforms using the same total spectral band. By modulating
two signals with carrier sinusoids that are ninety degrees out of
phase and then adding them (known as {\it quadrature modulation}),
synchronous detectors with the correct phase sinusoid can pick out
each of the modulated signals independently. For example, let's say we
want to send a sinewave and a squarewave using the same spectral band.

\begin{figure}[h]
\begin{verbatim}
(define quad-signal
   (add-signals 't (modulate-signal sinewave 0 75)
                   (modulate-signal-2 squarewave 0 75)))

(define (modulate-signal-2 signal const freq)
   (mul-signals 't (make-signal 'f (list (- freq) (- freq)) .5
                                   (list freq freq) .5)
                   (add-signals 't signal
                                   (make-signal 't full-span const))))
\end{verbatim}
\caption{SHE code for a quadrature modulated signal. Also, a procedure
to modulate signals ninety degrees out of phase with the original
procedure to modulated signals.}
\end{figure}

First we modulate the sinewave with a sinewave carrier and the
squarewave with a cosinewave. Then we add these modulated signals to
form the signal we are going to send. The SHE code is given in figure
14. Also, the signal \verb+quad-signal+ displayed in the time domain
is shown in figure 15.

\begin{figure}
\vspace{.75in}
\caption{Quadrature modulated sinewave and squarewave signal.}
\end{figure}

The demodulation of this signal consists of sending it to two
different synchronous detectors, one with a local sinusoid in sync
with the carrier sinusoid for the sinewave and one with a local
sinusoid in sync with the carrier sinusoid for the squarewave. The
resulting demodulated signals are shown in figure 16.

\begin{figure}[h]
\vspace{1.5in}
\caption{Demodulated quadrature modulated sinewave and squarewave.}
\end{figure}

\subsection{Envelope Detectors}

Signals that have been modulated with a carrier constant can be
recovered using an envelope detector.  One way to simulate an envelope
detector is to generate an analytic signal corresponding to the
modulated signal. This can be accomplished by multiplying the
modulated signal in the frequency domain by a signal whose values in
the frequency domain are +1 for $0\leq n \leq N/2$, where $N$ is the
SHE period, and 0 otherwise (see figure 17). The Fourier transform of
a modulated sinewave with a carrier is shown in figure 7. The result
of multiplying these two signals in the frequency domain is shown in
figure 18.

\begin{figure}[h]
\vspace{1.2in}
\caption{Signal used to generate an analytic signal from a modulated
signal.}
\end{figure}

\begin{figure}
\vspace{.75in}
\caption{Analytic signal of a modulated sinewave.}
\end{figure}

\newpage

The magnitude of this product in the time domain yield the output of
an ideal envelope detector, as show in figure 19. The code to simulate
the envelope detector is given in figure 20. 

\begin{figure}
\vspace{.75in}
\caption{Output of an ideal envelope detector with input of a
modulated sinewave with a carrier constant of 2.}
\end{figure}

\begin{figure}[h]
\begin{verbatim}
(define (real-part-signal t/f signal)
  (map-signal t/f 'rect->polar signal))

(define (envelope-detect signal)
  (real-part-signal 't 
         (mul-signals 'f signal
                       (make-signal 'f (list 0 (- (/ *period* 2) 1)) 1))))
\end{verbatim}
\caption{SHE code for envelope detector.}
\end{figure}

The argument for this procedure is given in {\it Circuits, Signals, and
Systems} is as follows (see page 530 in CSAS). Any narrowband waveform
$x(t)$ can be represented in the form $x(t) = x_c(t) \cos 2\pi f_0t +
x_s(t) \sin 2\pi f_0t$. The complex envelope is defined as $\xi
(t) = x_c(t) - j x_s (t)$. The real part of $x(t)$ can be written as
$\Re [ \xi (t) e^{j2\pi f_0 t}]$. The envelope of $x(t)$ therefore is
the absolute value of $\xi (t)$ or $\sqrt{x_c^2(t) + x_s^2(t)}$. 
Thus, the general procedure is to make a analytic signal out of a
modulated signal and then take the magnitude of the analytic signal.
This will result in the envelope of the original signal.

\section{Frequency Modulation}

Frequency (and phase) modulation is more complicated than amplitude
modulation. It involved multiplying the signal to be modulated with
exponentials. 

\subsection{Phase and Frequency Modulated Waveforms}

Phase and frequency modulated waveforms can be generated by using
\verb+exponentiate-signal+ to create a signal equivalent to $e^{j(2\pi
f_0t + \phi (t))}$, where $f_0$ is the carrier frequency and $\phi
(t)$ is proportional to the desired phase modulating signal. The
desired real modulated signal can be created by just taking the real
part of the exponentiated signal. The SHE code used is shown in figure
21. 

\begin{figure}
\begin{verbatim}
(define (exponentiate-signal f0 phi)
   (let* ((base-freq (/ *period*))
          (2pifn (make-signal 't full-span 
                              (lambda (n) (* 2pi f0 n base-freq))))
          (sum (add-signals 't 2pifn phi)))
     (map-signal 't 'exp (scale-signal 0&1 sum))))

(define (generate-fm freq signal)
   (map-signal 't 'real-part (exponentiate-signal freq signal)))
\end{verbatim}
\caption{SHE code for generating FM signals.}
\end{figure}

\subsubsection{Narrowband and Wideband FM}

Narrowband FM is simulated by decreasing the amplitude of the signal
to be modulated. Conversely, wideband FM can be simulated by
increasing the amplitude of the signal to be modulated (see figures
22 and 23).

\begin{figure}[h]
\vspace{2in}
\caption{Narrowband sinewave plots in time and frequency.}
\end{figure}

\begin{figure}[h]
\vspace{2in}
\caption{Wideband sinewave plots in time and frequency.}
\end{figure}

\newpage

\subsubsection{Complexity of the spectrum of wideband FM compared with
AM.}

The spectrum of sinusoidally-modulated wideband FM is complex, whereas
the spectrum of sinusoidally-modulated AM is not (see figures 24 and
25).

\begin{figure}[h]
\vspace{2in}
\caption{Real and imaginary parts of the spectrum of
sinusoidally-modulated AM.}
\end{figure}

\begin{figure}[h]
\vspace{2in}
\caption{Real and imaginary parts of the spectrum of
sinusoidally-modulated FM.}
\end{figure}

\subsection{FM Detection}

To simulate FM detection/demodulation with SHE, an old scheme called
slope detection must be used. Theoretically, the FM signal can be
passed through a filter whose frequency response magnitude is a
linearly growing function of frequency over the band of the signal.
However, this is just differentiation of the FM signal.
Differentiation is just convolution with a doublet, or multiplication
of $j2\pi f$ and the transform of the signal. The result of this
differentiation is then passed to an envelope detector like the one
defined above. The SHE code to simulate this FM detection method is in
figure 26. The results of passing FM signals through this FM detector
are shown in figure 27.

\begin{figure}
\begin{verbatim}
(define (fm-filter fm-signal freq)
   (mul-signals 'f fm-signal
                   (scale-signal (* 2 pi 0&1) (ramp 'f))))

(define (fm-detect fm-signal freq)
   (envelope-detect (fm-filter fm-signal freq)))
\end{verbatim}
\caption{SHE code for FM detection.}
\end{figure}

\begin{figure}
\vspace{3in}
\caption{Demodulated FM signals.}
\end{figure}

\end{document}


