0% found this document useful (0 votes)
132 views

EE-451 Lab #2 AM and FM Systems Using MATLAB: General

This lab document describes using MATLAB to generate and analyze amplitude modulated (AM), frequency modulated (FM), and phase modulated signals. It includes generating modulated carrier signals, taking the Fourier transform to analyze the signal spectra, and demodulating the signals. The document provides MATLAB code examples for generating AM and FM signals, analyzing their spectra, and demodulating the signals back to the original modulating signal. It also includes questions about computing signal power, generating and demodulating a double-sideband suppressed carrier (DSB-SC) signal, and generating and demodulating a phase modulated signal.

Uploaded by

Getachew Endris
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
132 views

EE-451 Lab #2 AM and FM Systems Using MATLAB: General

This lab document describes using MATLAB to generate and analyze amplitude modulated (AM), frequency modulated (FM), and phase modulated signals. It includes generating modulated carrier signals, taking the Fourier transform to analyze the signal spectra, and demodulating the signals. The document provides MATLAB code examples for generating AM and FM signals, analyzing their spectra, and demodulating the signals back to the original modulating signal. It also includes questions about computing signal power, generating and demodulating a double-sideband suppressed carrier (DSB-SC) signal, and generating and demodulating a phase modulated signal.

Uploaded by

Getachew Endris
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 4

EE-451

Lab #2
AM and FM Systems Using MATLAB

General

The modulation and demodulation of a carrier signal will be performed in this lab (using
MATLAB). Spectral calculations will be made using the fft() function.

AM Spectra

We wish to create a DSB-LC amplitude-modulated sinewave:

φ(t ) = (1 + am (t )) cos ωc t.

where ω c is the carrier frequency and


m(t ) = cos ωmt.

where ω m is the audio (or modulating) frequency. Let fc=32, fm=3 and µ =0.5. (ω = 2π
f.) Create an array phi—following the procedure outlined in Lab #1—with 256 samples.
Plot the waveform.

Calculate and plot the spectrum of phi:

>> PHI = fft(phi)/256;


and

>> plot(24:40, abs(PHI(25:41)) )

Recompute phi and PHI with fm = 2 and a = 1.5. Plot both phi and PHI. For both values
of fm and a, explain the plots for phi and PHI (explain the frequencies and the magnitudes
of the spectral peaks in the spectral plots).

AM Demodulation

The signal φ (t) is demodulated by first taking its positive part (equivalent to rectification)
and then low-pass filtering. First, reset the modulation index to a=0.75 and the audio
frequency fm = 3. To demodulate this signal in MATLAB, create a new array pr whose
elements are the positive values of the elements of phi. (If phi(i) > 0, then pr(i) =
phi(i), else pr(i) = 0.) Take the spectrum of pr (and call it PR) using the fft()
function as in the previous section. We may then “filter” the spectrum PR by filtering out
the high-frequency components above 16 Hz. Create an array H which corresponds to the
“filter” (transfer) function. H is equal to one for frequencies above zero and less than 16
Hz and frequencies above 256-16 = 240 Hz and zero elsewhere. This H function
corresponds to a low-pass filter which also blocks D.C. components. The reason that we
have set the higher indices to one (above 240 Hz) is because of the “mirror” frequencies
described in Lab #1. The MATLAB commands are as follows

>> H = zeros(1,256);
>> H(2:9) = ones(1,8);
>> f = 0:126;
>> H(130:256) = H(128-f);

The “filtered” spectrum is created by taking the product of H and PR. Call this product
PRF. The corresponding filtered signal is found by taking the ifft() of the spectrum
array (PRF):

>> prf = 256*ifft(PRF);

Plot each of the time-domain waveforms and each of the spectra.

Inspect the spectrum of the rectified version of φ (t) (PR). This spectrum may be found
from the Fourier series of a half-wave rectified sinewave. (For details, refer to the handout
on the DSB-LC Demodulation.) Justify the magnitudes of the spectral lines in PR (by
reference to the handout).

FM Spectra

We wish to generate an FM waveform

( )
φ(t ) = cos ωct + k f ∫ m(t ) dt .

where
m(t ) = cos ωmt ,

and where kf is the peak frequency deviation and β = kf/fm is the FM modulation index.
Proceeding in a similar manner to generating an AM waveform, generate a frequency-
modulated waveform with fc = 32, fm = 2 and β = 3.0. Plot the corresponding waveform.
Calculate the spectrum using the fft() function, and plot the spectrum. Calculate the
FM spectrum with β = 3 using the Bessel function tables and compare the calculations
with the plot.

FM Demodulation
One way to demodulate and FM signal is to first convert the FM signal to AM by using a
high-pass filter. We can perform the high-pass filtering operation by modifying the PHI
array. First, let's create a high-pass filter HPF:

>> f = 0:128;
>> HPF = ((f/32).^ 4) ./ (1 + (f/32).^ 4);
>> HPF = sqrt(HPF);
>> f = 0:126;
>> HPF(130:256) = HPF(128-f); (for mirror frequencies)

Plot this array (HPF). This array corresponds to the transfer function of the high-pass filter.
To “filter” the modulated waveform (phi), first take the fft(), then multiply the spectrum
(PHI) by the transfer function:

>> D1 = PHI.*HPF;

Finally, take the ifft() of D1. This array corresponds to the equivalent AM signal
corresponding to the FM signal. Plot this signal. This equivalent AM signal can be
demodulated the same way in which the AM signal was demodulated. Show this process
and plot-out the demodulated waveform. (There will be some distortion.)
Questions

1. How would you use MATLAB to compute the power in of φ (t)? Suggest at least
two different ways of doing this. (Hint: use Parseval's Theorem and find the power
from the time-domain function phi and the frequency-domain function PHI.)

2. Write some MATLAB code to generate and demodulate a DSB-SC signal:

φ(t ) = m(t ) cos ωct − m


ˆ (t ) sin ωc t.

ˆ (t ) is a 90o phase shifted version of m(t ) .


where m

Let m(t ) = cos ωm t . Also let fc = 16 Hz and fm = 2 Hz.

3. Write some MATLAB code to generate and demodulate a phase-modulated signal

φ(t ) = cos (ωct + k p m(t ) ).

where kp is the phase modulation index.

You might also like