<sect1><title>Frequency Domain Analysis</title>

<sect2><title>Introduction</title>

<para>
  Fourier transforms enable us to view the frequency representation of data that exists in the time domain. This provides 
  a means of detecting erroneous frequencies in the given data set such as noise. Whilst in the frequency domain,
  we can also produce Power Spectral Density (PSD) plots. Once erroneous data has been removed in the frequency domain,
  an inverse transform can be applied to return the data to the time domain. Here we can ascertain the effects that removing such 
  data may have on the original system. 
</para>

</sect2> <!--Introduction-->



<sect2><title>Theory</title>

<para>
  The concepts of frequency domain analysis should commence with the Fourier transform. Any waveform can be constructed purely 
  from a set of sine and cosine waves. An example of this is a pure square wave, which can be constructed using only the odd 
  harmonics of a sin wave as follows:
  
  <equation>
    <title>Square Wave</title>
    <execute><cmd>eqimg</cmd><args>square.bmp</args></execute>
  </equation>
	
  for all odd harmonics. Where <command>f</command> is the fundamental frequency.
  In addition, just as any signal can be modelled by a set of sine and cosine waves, the converse is also true and thus any signal 
  can be decomposed into a set of sine and cosine waves. This is achieved by using the Fourier Transform, which preforms this 
  signal decomposition and transforms it into the frequency domain. The Fourier Transform is calculated as

  <equation>
    <title>Fourier Transform (Rabiner and Schafer, 1978)</title>
    <execute><cmd>eqimg</cmd><args>freq-fft.eps</args></execute>
  </equation>
  
  where <command>&egr;<superscript>j&ohgr;</superscript></command> is equal to <command>&ohgr;</command>, or the angular frequency.
  We can also computer the inverse Fourier transform, returning a function of time

  <equation>
    <title>Inverse Fourier Transform (Rabiner and Schafer, 1978)</title>
    <execute><cmd>eqimg</cmd><args>freq-ifft.eps</args></execute>
  </equation>
</para>

<para>  
  The above transforms are not, however, available for all sequences <command>x</command>(<command>n</command>). This is due to the
  fact that the basic Fourier transform is not reliable for signals sampled at discrete time 
  interval as it is designed for use with with continuous signals (Lepple 2000). In addition, this set of equations is not guaranteed
  to converge for all  <command>x</command>(<command>n</command>). To remedy this, the Discrete Fourier transform (DFT) is often
  used, thus enabling the transformation of a discrete signal and guaranteeing convergence. This is achieved restricting the 
  sequence <command>x</command>(<command>n</command>) to the following conditions:
</para>

<itemizedlist>
<listitem><para> The <command>N</command> values <command>x</command>(0)..<command>x</command>(<command>N</command>-1).</para></listitem>
<listitem><para> Equidistant values around the unit circle.</para></listitem>
</itemizedlist>

<para>
 The formula for the DFT is

  <equation>
    <title>Forward Discrete Fourier Transform (Rabiner and Schafer, 1978)</title>
    <execute><cmd>eqimg</cmd><args>freq-dfft.eps</args></execute>
  </equation>

  and the inverse DFT is given by
</para>
  <equation>
    <title>Inverse Discrete Fourier Transform (Rabiner and Schafer, 1978)</title>
    <execute><cmd>eqimg</cmd><args>freq-idfft.eps</args></execute>
  </equation>
<para>
  The discrete frequency <command>k</command> above is given by 
 </para>
  
  <equation>
    <title>Discrete Frequency</title>
    <execute><cmd>eqimg</cmd><args>fOfk.bmp</args></execute>
  </equation>
<para>  
  where <command>f<subscript>s</subscript></command> is the sampling frequency of the signal, and <command>k</command> is the number of
  points.
</para>

<para>
  The problem with the DFT is that it is computationally expensive, with O(<command>N<superscript>2</superscript></command>). 
  In recognition of this limitation the Fast Fourier Transform (FFT) was developed.
  This function takes into account the fact that in calculating a DFT much time is wasted with unnecessary multiplications. 
  For example, it is unnecessary to multiply any number by zero, as the answer will always be zero. 
  Given that multiplication is one of the slowest operations on most types of computers, reducing the number that need to be calculated
  will minimise the time taken to calculate a solution. 
  The FFT also decreases the computational load of a DFT by taking into account the fact that a sinusoid is
  periodic, and its values are mirrored around the x-axis at <command>T</command>/2. For example, every 90 degrees, the value 
  one reappears in a sine or cosine signal, changing only its sign. Many results, therefore, may determined by taking into account 
  these factors. Through this increased efficiency, the FFT reduces the computation time to
  O(<command>N</command>log<command>N</command>).
</para>

<para>
  The power spectrum is very useful in signal processing. It is the most common frequency measurement, allowing you to determine the
  amount of energy that exists at a given frequency. Derived from the power spectrum is the power spectral density (PSD) 
  measurement. A PSD plot provides information on the magnitude of energy that exists in a given band of frequencies. 
  This technique is particularly useful for measuring the noise content in a signal. A PSD plot is created by plotting the 
  magnitude of the real and imaginary components of the FFT results. A good illustration of this concept is that of a 
  sine wave with its corresponding PSD plot.


  <figure><title>50Hz sin wave and corresponding PSD plot.</title>
      <execute><cmd>img</cmd><args>sinTimeandFreq.png</args></execute>
  </figure>

  In the above figure, we see a pure sin wave with a frequency of 50Hz. The PSD plot shows the energy
  content of the sine wave being at 50Hz.
</para>

<para>
  There are some constraints which are implied when carrying frequency analysis. These are:-

  <itemizedlist>
  <listitem><para>Maximum frequency that can be analysed.</para></listitem>
  <listitem><para>Frequency resolution.</para></listitem>
  </itemizedlist>

  The maximum frequency analysed relates to the sampling theorem, also know as the Nyquist theorem. The theorem states; that
  given a signal <command>x</command>(<command>n</command>) sampled at a sampling frequency of
  <command>f<subscript>s</subscript></command>, the maximum frequency that can be analysed,
  <command>f<subscript>max</subscript></command> is equal to 1/2 of <command>f<subscript>s</subscript></command>. 
  In other words, to accurately represent and analyse the
  signal <command>x</command>(<command>n</command>), it must be sampled at a rate greater the
  2<command>f<subscript>s</subscript></command>, where 2<command>f<subscript>s</subscript></command> =
  <command>f<subscript>N</subscript></command> and <command>f<subscript>N</subscript></command> is known as the Nyquist frequency. 
  The simplest example to illustrate this is the sampling of a 20kHz audio signal. To accurately represent this signal,
  it must be sampled at greater than 40kHz. This value is typically 44100Hz, for example CD audio. Generally signals are sampled
  at several times <command>f<subscript>N</subscript></command> to ensure accurate results. In the case of
  time series analysis, where datasets are typically sampled at a rate of once per day, the maximum frequency that can be analysed 
  is 0.5 cycles/day.
</para>

<para>
  As mentioned earlier, noise is an inherent property in geodetic datasets. One common example is Random Walk.
  This type of noise changes with time and is therefore very difficult to model. For further details on Random Walk, please refer
  to the time domain analysis chapter of this thesis. A convenient method for viewing Random Walk, in
  particular the frequencies at which it is most prominent, is in the frequency domain. The conversion to the frequency
  domain is commonly done from the residual space of a dataset, i.e. the dataset has already undergone least squares regression
  analysis, including calculation of the residuals. Many of the datasets contain what appear to be Random Walk. One such example
  is the dataset from Ceduna. In the residual space(see figure below), the periodicity of the signal is clear.
</para>

<figure><title>CEDUNA_GPS(UP) - Residuals</title>
<execute><cmd>img</cmd><args>gdms-cedu-up-res.png</args></execute>
</figure>

<para>
  In the frequency domain, we can now expect to see the frequency components that make up the above signal. In particular,
  we want to identify the noise component of the signal. The following figure is the result of an FFT on the Residuals
  of CEDUNA (UP).
</para>

<figure><title>CEDUNA_GPS(UP) - PSD</title>
<execute><cmd>img</cmd><args>gdms-cedu-up-res-fft.png</args></execute>
</figure>

<para>
  From the PSD above, we can see energy at the low end of the frequency spectrum. This first major portion of energy
  is Random Walk. In fact, closer inspection of the PSD plot reveals a periodicity along the spectrum. This is also 
  believed to be Random Walk. In addition, white noise can also be detected in the frequency domain, appearing 
  as spikes.
</para>

<para>
  The frequency resolution of a signal is also constrained by the fact that it is inversely proportional
  to the length of the waveform. Subsequently, if the length of the analysed waveform is doubled, the resolution is halved.
  This is clearer if we consider the relationship <command>f<subscript>res</subscript></command> =
  <command>f<subscript>s</subscript>/N</command>, where <command>N</command> is number of sample points. If we double the
  number of points while maintain the sample rate, our frequency resolution is halved.
</para>

</sect2> <!--Theory-->


<sect2><title>Conclusion</title>
  <para>
    Frequency domain analysis is a very useful tool for time series analysis. It enables us, for instance to see information not 
    easily detectable in the time domain. Frequency trends and noise can also be identified in the data. This includes the 
    detection of Random Walk though periodicity, and white noise that are represented as frequency spikes. It addition, we have seen 
    that it is also possible to reduce noise by removing certain frequencies that are believed to be noise.  
  </para>
</sect2> <!--Conclusion-->

</sect1> <!--FDA-->

