org.nevec.prima.simulator.fluctuations
Class Fluctuation

java.lang.Object
  extended by org.nevec.prima.simulator.fluctuations.Fluctuation

public class Fluctuation
extends Object

This class computes fluctuations which follow a given power density spectrum. It may be used for computing atmospheric fluctuations.

Version:
$Id: Fluctuation.java,v 1.1 2006/03/15 10:44:10 jdejong Exp $

Field Summary
private  Complex[] a
          Amplitudes
 double dt
          Size of time bins
private  FFT fft
          Performs FFT
 double[] filterFunc
          For diagnostic purposes
private  ArrayList<PowerFilter> filters
          Defines the spectral filters to be used
 double[] freq
           
 double[] phase
          Phase
 double[] power
          Power spectrum
 
Constructor Summary
Fluctuation(int length, double dt)
           
 
Method Summary
 void addFilter(PowerFilter filter)
           
 void filter()
          Applies the defined filter functions to the spectrum
 double[][] getTimeSeries()
          Retrieve the time series, which has been obtained by an inverse FFT
 void inverse()
          Obtain a new time series from the spectrum by means of an inverse FFT
 void newRandomDist()
          Creates new random distribution of a normalized amplitude
 void newSeries()
          Does all the steps in a single go
 void newSpectrum()
          Creates a new spectrum from the time series
 void removeFilters()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

a

private Complex[] a
Amplitudes


power

public double[] power
Power spectrum


phase

public double[] phase
Phase


freq

public double[] freq

dt

public double dt
Size of time bins


filters

private ArrayList<PowerFilter> filters
Defines the spectral filters to be used


fft

private FFT fft
Performs FFT


filterFunc

public double[] filterFunc
For diagnostic purposes

Constructor Detail

Fluctuation

public Fluctuation(int length,
                   double dt)
Method Detail

addFilter

public void addFilter(PowerFilter filter)

removeFilters

public void removeFilters()

newRandomDist

public void newRandomDist()
Creates new random distribution of a normalized amplitude


newSpectrum

public void newSpectrum()
Creates a new spectrum from the time series


filter

public void filter()
Applies the defined filter functions to the spectrum


inverse

public void inverse()
Obtain a new time series from the spectrum by means of an inverse FFT


newSeries

public void newSeries()
Does all the steps in a single go


getTimeSeries

public double[][] getTimeSeries()
Retrieve the time series, which has been obtained by an inverse FFT

Returns:
array with in index 0 the time and in index 1 the real amplitudes.