Introduction
1
ECE 5650/4650 MATLAB Project 1
This project is to be treated as a takehome exam, meaning each student is to due his/her own
work. The project due date is 4:30 PM Tuesday, October 18, 2011. To work the project you will
need access to M
ATLAB
and at minimum the signal processing toolbox.
Introduction
This first MATLAB DSP project will get you acquainted/reacquainted with M
ATLAB
and then
move into the exploration of
•
Discretetime signal generation
•
Sequence convolution and the convolution sum
•
Linear constant coefficient difference equations (LCCDEs)
•
The discretetime Fourier transform (DTFT)
It is the student’s responsibility to learn the very basics of M
ATLAB
. There are many resources on
the internet. One such example is course notes available in PDF form, from
http://
www.eas.uccs.edu/wickert/ece1010/
.
A Quick M
ATLAB
Review Recall that M
ATLAB
stands for matrix laboratory, so it goes without
saying that M
ATLAB
is very efficient at doing matrix oriented numerical calculations. M
ATLAB
supports many data types, but the two data types we will work with the most, are scalar numbers
(real and complex), and matrices (real and complex). For our signal processing needs the matrices
we create will most often be vectors, that is matrices of dimension
or
. The default
data type for real and complex numbers is double precision. Complex numbers are handled trans
parently in M
ATLAB
, so there is no need to worry about these details, for the most part. In fact,
when M
ATLAB
startsup, it has both
i
and
j
defined as
, i.e., at the command window, as
shown in Figure 1, enter
>> j
ans = 0 + 1.0000i
Note that if you use
i
and
j
for something else, these definitions will be overwritten. The matrix
specialization of M
ATLAB
means that the most efficient programming requires vectorizing. This is
an aspect of using M
ATLAB
that most students master over time. Getting your code to work in
some fashion is first and foremost. Writing tight code is something that requires practice.
The Colon Operator
Suppose we wish to create a vector of time samples for
s, with sample spacing of 0.01s.
We enter at the command window
>> t = 0:0.01:5;
>> size(t)
m
1
1
n
1
–
t
05
This preview has intentionally blurred sections. Sign up to view the full version.
View Full DocumentECE 5650/4650 MATLAB Project 1
Introduction
2
ans = 1 501
>> cls % clear the command window screen
>> clf % clear the active figure window
>> figure(1) % open a new figure window or address #1 if already open
The variable
t
is now a row vector containing one row and 501 columns. If all we wanted was
integer steps, we could simply enter
>> n = 0:10
n = 0 1 2 3 4 5 6 7 8 9 10
Note the semicolon at the end of a statement, suppresses the automatic listing of the return vari
able. We can create a function of the vector
t
, say
, by writing
>> x = cos(2*pi*2*t);
A plot of
x
versus
t
can be made using the
plot()
command.
This is the end of the preview.
Sign up
to
access the rest of the document.
 Fall '09
 Digital Signal Processing, sampling rate, matlab project

Click to edit the document details