Exercise 3


Assigned: 5/8/98Due: 5/18/98

In this exercise, we will explore the idea of correlation between random variables and touch on the idea of a correlation function. You should read over Section 3-4 in the book before working on this exercise.

Please do the following and answer the questions:

  1. Create a vector X of 10000 random variables using rand. Create another vector Y of 10000 random variables using randn. Determine the correlation coefficient between them using corrcoef and looking at the off-diagonal terms. Why are the diagonal terms 1? (The diagonal terms are the correlation coefficients of X with itself and Y with itself.) Generate the random vectors two more times to see if the correlation coefficient changes. What should the correlation coefficient be theoretically?

  2. What are the means of X and Y using mean? What are the means theoretically?

  3. What are the standard deviations of X and Y using std? What are the standard deviation theoretically?

  4. Let Z = X + 0.5Y. Find the correlation coefficient between Z and Y. What should it be in theory?

  5. Read in the audio file in /home/sigproc/sjreeves/matlab/learning/eeee.au using auread. (If you followed the instructions in Exercise 1, you should be able to do ee = auread('eeee.au');. This is an audio file of Dr. Reeves saying "eeeee". (If your computer has audio capability, you can listen to the sound with sound. Plot the first 1000 point or so to get an idea of the shape of the signal. What is the approximate period of the signal in samples and in seconds? (The signal is sampled at 8 kHz.)

  6. What are the mean and standard deviation of the signal samples?

  7. Consider X to be the set of audio samples. Consider Y to be the same set of samples delayed by N samples. Find the correlation coefficient between X and Y for N=1:

    N=1;
    ee1 = ee(1:end-N);ee2 = ee(1+N:end); corrcoef(ee1,ee2)
    

    What happens to the correlation coefficient as N increases? Why?

    What happens to the correlation coefficient when N is near the number of samples in the period? Why?

  8. For N=3, look at the 2-D histogram (the joint density) of the two sample sets by calling hist2d(ee1,ee2). The two mesh plots show the same plot from two different angles. (It may take a few minutes.) Do the two variables look correlated from the joint density? Why?

  9. Suggest another exercise that would help you understand this material better.