Homework #2

Do the following and integrate the results in a Word document. The document should be one well formatted document mixing the graphs and explanations as requested in the assignment, with ABSOLUTELY NO handwritten or hand drawn items. Put the document in our shared folder.

 

Matlab Issues

Matrices

Matlab was designed to rely on matrices. Therefore most calculations can easily be accomplished using vectors and matrices instead of for-loops. You can concatenate matrices. If you have three vectors size N×1 (N rows and 1 column), you can concatenate them into a matrix as follows: x = [x1'; x2'; x3']. In this expression x1' is the transpose of x1. The new matrix x has three rows and N columns.  Another matrix y = [x1 x2 x3] has N rows and three columns.

Also note that you can easily select a single row or column of a matrix. For example x(k,:) is row k or matrix x.

Random numbers

To get normally distributed random numbers using Matlab use the randn function. Note that the normal distribution has mean 0 and variance 1. You can check the variance of a set of variables using the var function.

Eigenvalues

To get the eigenvalues of a matrix use the eig function. You can find the largest eigenvalue with the help of the Matlab max function.

 

The Matlab Assignment

Using the LMS algorithm given in Table 2.1 of the textbook reproduce the results of Example 2.1. Use all the same assumptions used in the example. You should email me the m-code you used and a Word document with results, including explanations in the text, as well as figures that show the learning rate and J1/2 values vs. k for each step of your algorithm's execution. Report on the number of iterations your algorithm took to converge. If you run the algorithm multiple times does this value change? Why? Run the algorithm 3 times to illustrate this point.