Professional Documents
Culture Documents
Lab Report
By
Submitted
To
Lec. Rafi
Semester: 6th
Session: Spring 2021
Credit Hours: 1
Time: 3 Hours
2
National University of Technology
Experiment List
Sr.No. Experiments
3
National University of Technology
Experiment 3
Spectrum Representation
Objective
To introduce more complicated signals that are related to the basic sinusoid and implement
frequency modulation (FM) and amplitude modulation (AM) in MATLAB.
Theoretical Explanation
Amplitude Modulation
If we add several sinusoids, each with a different frequency 𝑓𝑘 we can express the result as:
where 𝑨𝒌𝒆𝒋𝝓𝒌 is the complex amplitude of the k th complex exponential term. The choice of 𝑓𝑘 will
determine the nature of the signal for amplitude modulation or beat signals we pick two or three
frequencies very close together.
(In amplitude modulation, the frequency of the carrier wave is constant. The frequency spectrum of an
AM signal includes sidebands, but those aren't the carrier wave. You'll note that the amplitude changes; it
increases and decreases in accordance with the modulation, however the frequency of this wave does not
change.)
4
National University of Technology
Explanation of Procedure
A. Tools/Commands
1. MATLAB
B. Codes
Task 3.1
Beat Control GUI: To assist you in your experiments with beat notes and AM signals, the tool
called beatcon has been created. This user interface controller will exhibit the basic signal
shapes for beat signals and play the signals. A small control panel will appear on the screen with
buttons and sliders that vary the different parameters for the beat signals. It can also call a user-
written function called beat.m. Experiment with the beatcon control panel and use it to
produce a beat signal with two frequency components at 850 Hz and 870 Hz. Demonstrate the
plot and sound to your instructor.
5
National University of Technology
6
National University of Technology
Task 3.2
Function for a Chirp: Use the code provided as a starting point in order to write a MATLAB
function that will synthesize a “chirp” signal according to the following comments:
function [xx,tt]=mychirp(f1,f2,dur,fsamp)
if (nargin<4)
fsamp=11025;
end
tt=0:1/fsamp:dur;
m=(f1-f2)/(2*dur);
psi= 2*pi*(m*tt.*tt+f1*tt+100);
xx=real(7.7*exp(1i*psi));
soundsc(xx,fsamp);
end
7
National University of Technology
Task 3.3
Spectrograms: It is often useful to think of signals in terms of their spectra. A signal’s spectrum
is a representation of the frequencies present in the signal. For a constant frequency sinusoid as
in
I Introduces to Complex Exponentials using MATLAB live script To study basics of plotting
complex exponential functions and to familiarize student with implementation of plotting of
complex exponentials in MATLAB.
fs=8000;
xx=cos(3000*pi*(0:1/fs:0.5));
specgram(xx,1024,fs);
colorbar
8
National University of Technology
Task 3.4
Beat Nodes: Consider the situation in which we had two sinusoidal signals of slightly different
frequencies, i.e.,
[xx,tt]=mychirp(2500, 500, 1.5, 11025);
function [xx,tt]=beat(A,B,fc,delf,fsamp,dur)
if (nargin<6)
dur=0.5;
end
fs=8000;
f1=fc-delf;
f2=fc+delf;
9
National University of Technology
Conclusion
All the signals discussed so far in previous labs do not change in frequency over time. Obtaining a
signal with time-varying frequency is of main focus of this lab. A signal that varies in frequency
over time is called “chirp”. The frequency of the chirp signal can vary from low to high frequency
(up-chirp) or from high to low frequency (low-chirp).
10