Solutions, ECE220 Problem Lab #1
Getting practice with MATLAB,
periodic signals and mathematical background skills
Date: Week of January 21, 2008
The goals of this lab are to: (a) make sure you are up to speed with the required/assumed
math background, (b) get some working experience with periodic signals, and, more impor
tant, (c) get a taste of how the language we develop in this course will be used in future
courses, and, (d) get started with MATLAB as a tool for processing signals. The third goal
is the “toughest”.
Do not get discouraged if you cannot do the problems in this part at your first attempt!
Work out as many problems as you can; there is no need to finish all of them. If you feel a
problem is too easy, you can skip it. If you are done early, you may leave; no need to stay
for the full lab period.
—————————————————————————————–
I. MATLAB primer
The TAs will provide detailed MATLAB instructions for this part. The goal is to develop
skills on two specific topics:
1.
Generation
of basic signals in MATLAB; in this lab, we’ll work on 4 basic signals:
•
The sinusoidal signals
s
(
t
) =
A
sin(2
πFt
+
θ
)
(1)
s
(
t
) =
A
cos(2
πFt
+
θ
)
(2)
•
The unit step signal in equation 2.2, page 53.
•
The rectangular pulse signal in equation 2.13, page 60.
We’ll see multiple methods to generate signals:
•
Using direct calculations (see script 3.2, page 115)
•
Using for loops (see script 3.15, page 134)
1
This preview has intentionally blurred sections. Sign up to view the full version.
View Full Document
•
Using vectorized commands (see script 3.16, page 134)
•
Using logical operators (see script 3.20, page 137)
•
Using functions (see script 3.24, page 139)
2.
Plotting
of basic signals.
The specific challenge here is to produce easily readable,
“industrial quality” plots of (periodic) signals, that meet the requirements listed in
section 2.1.1, page 116.
At the end of this part of the lab, you should have generated a
“decent”
plot of each one of
the 4 basic signals, using at least one of the listed methods. We will leave “decent” undefined
for the moment, since this is our first attempt at learning MATLAB...
You can choose what method to apply for generating a signal. In the answers, we will apply
multiple methods. If you are confused, here is a suggestion:
•
For the sinusoidal signals in eqs 1 and 2, use a direct calculation; select values for the
parameters
A, F, θ
randomly. For graph purposes, select
t
∈
[

10
,
20].
This is the end of the preview.
Sign up
to
access the rest of the document.
 Spring '08
 NILSON
 Periodic function, Mathematical Expression, rectangular pulse signal

Click to edit the document details