Geoscience Reference
In-Depth Information
methods to more complex time series. h e i rst example illustrates how to
generate a basic synthetic data series that is characteristic of earth science
data. First, we create a time axis t running from 1 to 1000 in steps of one unit,
i.e., the sampling frequency is also one. We then generate a simple periodic
signal y : a sine wave with a period of i ve and an amplitude of two by typing
clear
t = 1 : 1000;
x = 2*sin(2*pi*t/5);
plot(t,x), axis([0 200 -4 4])
h e period of ˄=5 corresponds to a frequency of f =1/5=0.2. Natural data
series, however, are more complex than a simple periodic signal. h e slightly
more complicated signal can be generated by superimposing several periodic
components with dif erent periods. As an example we compute such a signal
by adding three sine waves with the periods ˄ 1 =50 ( f 1 =0.02), ˄ 2 =15 ( f 2 ≈0.07)
and ˄ 3 =5 ( f 3 =0.2). h e corresponding amplitudes are A 1 =2, A 2 =1 and A 3 =0.5.
t = 1 : 1000;
x = 2*sin(2*pi*t/50) + sin(2*pi*t/15) + 0.5*sin(2*pi*t/5);
plot(t,x), axis([0 200 -4 4])
By restricting the t -axis to the interval [0,200], only one i t h of the original
data series is displayed (Fig. 5.3 a). It is, however, recommended that long
data series be generated, as in the example, in order to avoid edge ef ects
when applying spectral analysis tools for the i rst time.
In contrast to our synthetic time series, real data also contain various
disturbances, such as random noise and i rst or higher-order trends. In order
to reproduce the ef ects of noise, a random-number generator can be used to
compute Gaussian noise with mean of zero and standard deviation of one.
h e seed of the algorithm should be set to zero using rng(0) . One thousand
random numbers are then generated using the function randn .
rng(0)
n = randn(1,1000);
We add this noise to the original data, i.e., we generate a signal containing
additive noise (Fig. 5.3 b). Displaying the data illustrates the ef ect of noise
on a periodic signal. Since in reality no record is totally free of noise it is
important to familiarize oneself with the inl uence of noise on power spectra.
Audio
5.1
xn = x + n;
plot(t,x,'b-',t,xn,'r-'), axis([0 200 -4 4])
Search WWH ::




Custom Search