ENEE 222 Elements of Discrete Signal Analysis Lab
ENEE 222 Elements of Discrete Signal Analysis Lab 2
Prepare your working environment Download the script for lab 2 from ELMS or: http: //terpconnect. umd. edu/~fnouketc/ENEE 222_Lab Move files to your desktop Double click the MATLAB icon on the desktop In MATLAB, set “Current Folder” to your desktop Double click the file “lab_02_script. txt” inside MATLAB 2
Problem 1 – matrix v. s. array operations Matrix operations (*, /): follow rules of linear algebra ymxn = Amxk xkxn Array operations (. *, . /): element-wise “. ” indicates an element-wise operation Chau-Wai Wong, ECE, UMD 3
Problem 2 – sinusoids Given Questions: a) What is the frequency? b) What is the period? c) How can the sinusoid be moved such that it passes through the origin? Chau-Wai Wong, ECE, UMD 4
Problem 3 – exploration of “PLOT” plot(y): x-axis with index 1, 2, 3, … plot(x, y): x-axis explicitly specified grid: add grid clf: clear figure plot(x, y, 'r'): plot with a red curve hold: hold the current plot and overlay a new plot(x, y 1, x, y 2, x, y 3): plot 3 curves at once Use “help plot” when necessary Chau-Wai Wong, ECE, UMD 5
Problem 4 – axes and labels Set scaling: axis([xmin, xmax, ymin, ymax]) AXIS ‘property’ xlabel('the label appears on x-axis') ylabel('the label appears on y-axis') title('the label appears above the plot') Chau-Wai Wong, ECE, UMD 6
Problem 5 – Exponentially faded sinusoid Question: Given a sinusoid, and a decreasing exponential function, how do we construct an exponentially faded sinusoid? ? Chau-Wai Wong, ECE, UMD 7
Problem 6 – more than one plot in a figure The SUBPLOT function allows multiple graphs to be displayed on a grid in the same figure window: subplot(no_rows, no_columns, index) Question: Does the title function give a title to a particular subplot, or to the whole figure? Chau-Wai Wong, ECE, UMD 8
- Slides: 8