SO503 Honors Modern Methods
Spring 2013
Lab 5: Cross Correlation
Resample a series.
Perform a cross correlation, understanding the concept of lag.
Divide a vector into x and y components.
Use a loop to find the maximum value
Do a double loop
There is a Matlab m file xcorr_lab.m and a data set time_tide_weather.csv which show you how to resample a series and perform a cross correlation. There is a function linear_reinterpolate.m if you do not like what is built into Matlab.
You should look up the fliplr or flipud to deal with the ordering problem.
The data you used last week will be used for this lab.
You can do any required manipulations of the data file in either Matlab or Excel , but the requirements listed below must be done in Matlab and your code must show how they were done. This data set is relatively short, but your program should be prepared to handle a much larger data set.
General Matlab tips and resources.
Due Wed 20 Feb at 1330 hours in the Blackboard dropbox, in a single Word Document, with your last name as the first element:
A graph showing the relationship between the tide residual and the wind speed. You might think about how to show this most clearly.
Compute the cross correlation coefficient between wind speed and tide residual, and determine the lag at which the highest correlation occurs .
Compute the cross correlation coefficient between the north component of wind speed and tide residual, and determine the lag at which the highest correlation occurs.
Compute the cross correlation coefficient between the component of wind speed at every 10 degrees between 270 and 90 and tide residual, and determine the lag at which the highest correlation occurs for each, and overall.
A stick diagram showing the component of the wind during this time period that has the highest correlation with tide residual.
Discussion of the following points:
What the correlogram means, and how can we use it to predict storm surge from wind data.
Why using just the north component of the wind (or another angle) changes the correlogram, and which you think is more relevant, total speed or north component.
Which interpolation routine you liked best, and why.
An appendix with your Matlab code, with enough comments for someone to understand you (like you if you have to come back to this kind of problem next fall).