You are on page 1of 1

ECE 306 - Discrete Time Signals and Systems, Homework 1

Sampling Theorem
Solve the following problems from the textbook: 1.3, 1.2, 1.8, 1.9

Discrete Time Signals and Systems

1. Let x[n] = {5, 4, 3, 2, 1}. This problem examines the commutativity of the folding and shifting operations. Consider a

new sequence x[2 n] = x[(n 2)].
(a) Let y1 [n] be obtained by first folding x[n] and then shifting the result to the right by tow samples. Determine and
plot y1 [n]
(b) Let y2 [n] be obtained by first shifting x[n] to the right by two samples and then folding the result. Determine and
plot y2 [n]
(c) From your plots are y1 [n] and y2 [n] the same singals? Which signal represent the correct x[2 n] signal?
2. The input x[n] = {1, 3, 2, 1} is applied to the LTI system described by the impulse response h[n] = 2(0.8)n , 0 n 6.

Use convolution to determine y[3].

1. Write a MATLAB script to generate and plot the following signals described in the lectures, for 20 n 40
(a) Unit sample [n]
(b) Unit step u[n]
(c) Real exponential signal x1 [n] = (0.80)n
(d) Complex exponential signal x2 [n] = (0.9ej/10 )n . Since this signal is complex-valued, plot the real part, imaginary
part, magnitude, and phase using the function subplot.
(e) Sinusoidal sequence x3 [n] = 2cos[2(0.3)n + /3]
2. Let x[n] = {1, 0, 1, 2, 3, 4, 4, 4, 4, 4}

(a) Determine the sequences x[n], x[n 3], and x[n + 2] by hand.
(b) Determine the sequences using the fold and shift functions.
(c) Plot the sequences x[n], x[n], x[n + 2] using the function stem.
3. This problem uses the sound file handel available in MATLAB. This sound is sampled at Fs = 8192 samples per
second using 8-bits per sample.
(a) Load the sound waveform handel in an array x and listen to it using the soundsc (or sound) function at the
full sampling rate.
(b) Select every other sample in x which reduces the sampling rate by a factor of two. Now listen to the new sound
array at half the sampling rate.
(c) Select every fourth sample in x which reduces the sampling rate by a factor of four. Listen to the resulting sound
array at quarter the sampling rate.
(d) Save the generated sound in the last part.
4. The file djw6576.txt (found in the misc directory) contains the weekly opening value x[n], 0 n N 1, of the
Dow Jones Industrial Average for N = 600 weeks starting in January 1965.
(a) Write a MATLAB script to compute the following moving averages
y1 [n] = 1
51 k=0 x[n k] and
y2 [n] = 1
51 k=25 x[n k].

You can check your results with the MATLAB functions filter or conv
(b) Plot the sequences x[n], y1 [n], and y2 [n] for 0 n N 1 on the same plot and comment upon the results. Use
the plot function and represent each sequence with a dot of dierent color.