Graphics Programs Reference
In-Depth Information
The period of
=5 corresponds to a frequency of f =1/5=0.2. Natural data
series, however, are much more complex than a simple period signal. The
next complicated signal is generated by superposition of several periodic
components with different 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), respectively. The corresponding amplitudes are
A 1 =2, A 2 =1 and A 3 =0.5. The new time axis t runs from 1 to 1000 with 1.0
intervals.
t = 1 : 1000;
y = 2*sin(2*pi*t/50) + sin(2*pi*t/15) + 0.5*sin(2*pi*t/5);
plot(t,y),axis([0 200 -4 4])
Only one fi fth of the original data series is displayed by restricting the x -axis
limits to the interval [0 200]. It is, however, recommended to generate long
data series as in the example in order to avoid edge effects while applying
spectral analysis tools for the fi rst time.
In contrast to our synthetic time series, real data also contain various dis-
turbances, such as random noise and fi rst or higher-order trend. Firstly, a
random-number generator can be used to compute gaussian noise with zero
mean and standard deviation one. The seed of the algorithm needs to be set
to zero. Subsequently, one thousand random numbers are generated using
the function randn .
randn('seed',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). Displaying the data illustrates the impact of noise
on a periodic signal. In reality, no record that is free of noise. Hence, it is im-
portant to familiarize oneself with the infl uence of noise on power spectra.
yn = y + n;
plot(t,y,'b-',t,yn,'r-'), axis([0 200 -4 4])
In many cases, the signal processing methods are applied to remove most of
the noise although many fi ltering methods make arbitrary assumptions on
the signal-to-noise ratio. Moreover, fi ltering introduces artifacts and statisti-
cal dependencies to the data. These may have a profound infl uence on the
resulting power spectra.
Finally, we introduce a linear long-term trend to the data by adding a
straight line with slope 0.005 and intercept zero with the y -axis (Fig. 5.3).
Search WWH ::




Custom Search