MAT_167_FQ_2019_HW_01.pdf - MAT 167u2013001 HW 01 FQ 2019...

• Homework Help
• 5
• 100% (2) 2 out of 2 people found this document helpful

This preview shows page 1 - 2 out of 5 pages.

MAT 167–001 HW 01 FQ 2019 REMEMBER THAT YOU ARE REQUIRED TO WRITE UP YOUR HW IN LaTeX (Post on PIAZZA if you need help.) Problem 01 (100 points) This is a MATLAB exercise. (a ) Download the data file: HW 01.mat from CANVAS to your working directory, and load it into your MATLAB session by: >> load HW_01; Then, draw the signal x in the data file using the following commands: >> figure(1); >> stem(x); hold on; plot(x); grid; Note that this signal x consists of only 8 points, i.e., a very short signal (vector). (b ) In a different figure window, draw the 8 basis vectors stored as column vectors of the matrix U as follows: >> figure(2); >> for k=1:8 subplot(8,1,k); stem(U(:,k)); axis([0 9 -0.5 0.5]); axis off; hold on; end >> for k=1:8 subplot(8,1,k); plot(U(:,k)); end You may need to see the details of these 8 plots by enlarging the window to a full screen. Print this figure and attach it to your HW submission. (c ) Compute the expansion coefficients (i.e., the weights of the linear combination) of x with respect to the basis vectors U (: , 1) , . . . , U (: , 8) via >> a=U’ * x; (d ) Check the values of the entries of the coefficient vector a and create a new vector a 2 of length 8
(e ) Construct an approximation x 2 of x using a 2 . Then, plot x 2 over Figure 1 as follows: >> figure(1); stem(x2,’r * ’); plot(x2,’r’); (f ) Now, instead of a 2 , let’s construct a 4 of length 8 whose only nonzero entries are the four largest