Page 108 - MATLAB Recipes for Earth Sciences
P. 108

5.5 Interpolating and Analyzing Unevenly-Spaced Data            101

             [Pxy,f] = cpsd(y1,y2,[],0,512,10);
             phase=angle(Pxy);
             plot(f,phase)

           The phase shift at a frequency of f=0.2 (period τ=5) is

             interp1(f,phase,0.2)
           which produces the output of

             ans =
               1.2568

           The phase spectrum is normalized to one full period τ=2›, therefore a phase
           shift of 1.2568 equals (1.2568*5)/(2*›) = 1.0001, which is again the phase
           shift of one that we introduced at the beginning.




           5.5 Interpolating and Analyzing Unevenly-Spaced Data

           Now we use our experience of evenly-spaced data to run a spectral analysis
           on unevenly-spaced data. Such data are very common in earth sciences. For

           example, in the field of paleoceanography, the deep-sea cores are typically
           sampled at constant depth intervals. Transforming evenly-spaced length-pa-
           rameter data to time-parameter data in an environment with changing length-
           time ratios results in unevenly-spaced time series. Numerous methods exist
           for interpolating unevenly-spaced sequences of data or time series. The aim
           of these interpolation techniques for tx data is to estimate the x-values for an
           equally-spaced t vector from the actual irregular-spaced tx measurements.
           Linear interpolation is relatively simple and straightforward method  for ex-
           trapolating between two equally spaced data points. It predicts the x-values
           by effectively drawing out a straight line between two neighboring measure-
           ments and by calculating the appropriate point along that line. However,
           the method also has its limitations. It assumes linear transitions in the data,
           which introduces a number of artifacts, including the loss of high-frequency
           components of the signal and limiting the data range to that of the original
           measurements.
             Cubic-spline interpolation is another method for interpolating data that
           are unevenly spaced. Cubic splines are piecewise continuous curves, pass-
           ing through at least four data points for each step. The method has the ad-
           vantage that it preserves the high-frequency information contained in the
           data. However, steep gradients in the data sequence could cause spurious
   103   104   105   106   107   108   109   110   111   112   113