Lab 1
Lab 1
April 7, 2021
1. [worth 110 points total] Consider the following analog sinusoidal signal:
xa (t) = sin(2πF0 t + φ)
The above signal, when sampled at a rate of Fs Hz. (samples/sec.), or alternately, with
a sampling period of Ts = F1s sec., will generate the following discrete sequence:
F0
x[n] = xa (t) = sin(2πF0 nTs + φ) = sin 2π n + φ = sin(2πf0 n + φ),
t=nTs Fs
|{z}
:=f0
1
(c) Repeat part (b), except set F0 = 7525 : 125 : 7900 Hz., in MATLAB notation. This
should generate 4 plots. Use MATLAB’s subplot function to generate a 4-panel figure
of the generated discrete signals. Note that the apparent frequency of the sampled
sequences seems to be decreasing as F0 is increasing, which is not expected. Also,
do you observe a polarity reversal effect in the sampled sequences (you should if your
code is correct)? Explain in detail what is going on here, including the polarity reversal
effect. (40 points)
Hint: You will need to make use of the trigonometric identity sin(θ) = −sin(2kπ − θ),
where k is some integer.
(d) Repeat part (c), except set F0 = 32100 : 125 : 32475 Hz., in MATLAB notation.
This should generate 4 plots. Use MATLAB’s subplot function to generate a 4-panel
figure of the generated discrete signals. Note that the apparent frequency of the sampled
sequences seems to be again increasing as F0 is increasing. How do these plots compare
with the ones you produced in part(b)? Explain in detail what is going on here. (40
points)
The above signals are sampled at Fs = 40 Hz. Let the corresponding sampled signals
be denoted by x1 [n] and x2 [n] respectively. Only the last part needs to be finished in
the lab.
(a) What is the folding frequency? (5 points)
(b) Write down expressions for x1 [n] and x2 [n]. (10 points)
(c) Write down the frequencies F1 and F2 (in Hz) for x1 (t) and x2 (t) and the frequencies
f1 and f2 (in samples/sec.) for x1 [n] and x2 [n]. How are the discrete time frequencies
related to the continuous time frequencies? (10 points)
(d) Are the sequences x1 [n] and x2 [n] periodic? Explain why or why not. (5 points)
(e) Do you expect aliasing to occur when sampling x1 (t)? How about x2 (t)? Explain
your answers clearly. If you expect aliasing to occur, what frequencies would f1 and f2
be aliased to? (20 points)
(e) ‘Stem’ plot x1 [n] and x2 [n] on one figure for 0 ≤ n ≤ 29, but use different colors.
Make sure the axes are labeled and add a legend. Are the two sequences distinguish-
able? Explain your observation. (10 points)
3. [worth 10 points] Generate and plot the sequence x[n] = cos √nπ23 for 0 ≤ n ≤ 49.
Is the sequence periodic? Explain why or why not.
4. [worth 20 points total] Consider the sinusoidal signal xa (t) = sin(2πF0 t).
2
(a) Suppose that F0 = 2 kHz and Fs = 50 kHz. Plot the signal x[n] for 0 ≤ n ≤ 100.
What is the frequency f0 of x[n]? (5 points)
(b) Plot the signal y[n] created by taking the even numbered (i.e., n = 0, 2, 4, . . . )
samples of x[n] and plotting it for n = 0, 1, 2, · · · , 50. Is y[n] a sinusoidal signal? If so,
what is its frequency? (15 points)