vec_math
Class Fourier

java.lang.Object
  extended by util.PropertyContainer
      extended by util.PropertyResources
          extended by util.PropertyBundles
              extended by vec_math.AbstractAnalyser
                  extended by vec_math.Fourier
All Implemented Interfaces:
Cloneable, Initializable, LocalizedSupplying, PropertySupplying, ResourceSupplying, Analyser
Direct Known Subclasses:
CleanFourier, LombPeriodogram

public abstract class Fourier
extends AbstractAnalyser

A suit of methods valuable in periodogram application.


Nested Class Summary
static class Fourier.AbstractFile
          Class for command-line parsing.
static class Fourier.Series
          A Fourier series multidimensional is the representation of a discrete Fouriere series up to a specified order M.
 
Nested classes/interfaces inherited from class util.PropertyResources
PropertyResources.URLResource
 
Field Summary
 
Fields inherited from class util.PropertyBundles
KEY_LOCALECOUNTRY, KEY_LOCALELANGUAGE, KEY_RESOURCEBUNDLES
 
Fields inherited from class util.PropertyResources
KEY_NOINITONCREATE, localurl, locate, POSTFIX_DIR, POSTFIX_EXT, POSTFIX_FILE, POSTFIX_LIST, POSTFIX_URL, urlset
 
Fields inherited from class util.PropertyContainer
KEY_LISTSEPARATOR, KEY_MAPKEYVALUECHAR, KEY_MAPSEPARATOR
 
Fields inherited from interface util.ResourceSupplying
KEY_URLRESOURCES, KEY_URLUSECONFIG, KEY_URLUSECURRENT, KEY_URLUSEHOME
 
Fields inherited from interface util.PropertySupplying
CONFIG, KEY_CLASS
 
Constructor Summary
protected Fourier(Map<String,String> prop)
          Constructor chaining.
 
Method Summary
static double falseAlarm(double pdf, int length, double var)
          Estimates a false-alarm probability for a power spectrum that is constructed in the following way:
Let f(t) be a real function sampled at tj to give a set of fj.
The discrete fourier transform is defined as the complex
protected abstract  Vector3D[] fourierTransform(VectorG[] data)
          Does a fourier transfrom in the sense that:
Let f(t) be a real function sampled at tj to give a set of fj.
The discrete fourier transform is defined as the complex
static double getMaximumSpan(VectorG[] sorted)
          Returns the time-span of the observation, data must be sorted.
static double getMinimumStep(VectorG[] sorted)
          Calculates the minimum time step in the data.
static Vector2D[] getWhitened(Vector2D[] data, Vector3D[] dft, double freq)
          Whitens the data set by reducing the the original data by the highest harmonic.
static Vector3D maximum(Vector2D[] lomb)
          Searches the global maximum in the Lomb spectrum and interpolates to the peak.
static Vector3D maximum(Vector2D[] lomb, int around)
          Searches the local maximum in the Lomb spectrum and interpolates to the peak.
static Vector3D maximum(Vector2D[] lomb, int start, int end)
          Searches the local maximum in the Lomb spectrum and interpolates to the peak.
 Object[] metadata(VectorG[] in, VectorG[] proc, VectorG[] visual)
          Fourier analysis have no metadata.
private static Vector3D parabolicMaximum(Vector2D[] lomb, int imax)
          Return the maximum fit as an interpolating parabolia around the specified index in the lomb periodogram.
static Vector2D[] periodogram(Vector3D[] ft)
          Returns the periodogram by copy of the period plus mode-squared of the complex in y/z.
 VectorG[] process(VectorG[] in)
          Calls the Fourier Transform.
 double significance(double pdf, VectorG[] data, VectorG[] p, VectorG[] v)
          Significance out of false-alarm.
 VectorG[] visualize(VectorG[] in, VectorG[] ft)
          Calls the periodogram.
private static Vector2D[] whiten(Vector2D[] data, Vector3D[] dft, Vector2D[] pdf, int at)
          Whitens the data set by reducing the the original data by the highest harmonic.
 
Methods inherited from class vec_math.AbstractAnalyser
getBootstrapData, getBootstrapData, getDiminishedData, getDiminishedData, getSyntheticData, getSyntheticData, reset, runningAverage
 
Methods inherited from class util.PropertyBundles
clone, getLocalized, getLocalized, getLocalizedString, getLocalizedString, loadResource
 
Methods inherited from class util.PropertyResources
createFrom, createFrom, createFrom, getApplet, getAsResources, getLocalClassLoader, getPropertiesToKey, getPropertiesToKey, getResource, getResourceAsStream, getResourceFromKey, getResources, init, keyCreate, keyCreate, reload, setApplet
 
Methods inherited from class util.PropertyContainer
augment, augment, augment, defaultBoolean, defaultChar, defaultDouble, defaultFloat, defaultInt, defaultLong, defaultObject, defaultObject, defaultProperties, defaultProperty, getAsBoolean, getAsChar, getAsDouble, getAsEnums, getAsFloat, getAsInt, getAsList, getAsLong, getAsMap, getAsMap, getAsObject, getAsObject, getProperties, getProperty, has, isNew, parseObject, reload, removeProperty, rescanned, setObject, setProperties, setProperty, stringProperties, toString
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface vec_math.Analyser
functionCalls
 
Methods inherited from interface util.ResourceSupplying
getResource, getResourceAsStream, getResources
 
Methods inherited from interface util.PropertySupplying
defaultBoolean, defaultChar, defaultDouble, defaultFloat, defaultInt, defaultLong, defaultObject, defaultObject, defaultProperties, defaultProperty, getAsBoolean, getAsChar, getAsDouble, getAsFloat, getAsInt, getAsList, getAsLong, getAsMap, getAsObject, getAsObject, getProperties, getProperty, has, parseObject, removeProperty, setObject, setProperty, stringProperties
 
Methods inherited from interface util.Initializable
init
 

Constructor Detail

Fourier

protected Fourier(Map<String,String> prop)
Constructor chaining.

Method Detail

fourierTransform

protected abstract Vector3D[] fourierTransform(VectorG[] data)
Does a fourier transfrom in the sense that:
Let f(t) be a real function sampled at tj to give a set of fj.
The discrete fourier transform is defined as the complex
       D(ν)=1/N Σfjexp(-2πν(tj-av(t))),
       D(-ν)=D*(ν)
       

Parameters:
data - The measures, t in x.
Returns:
The fourier transform, x is frequency, y/z is the complex D.

process

public VectorG[] process(VectorG[] in)
Calls the Fourier Transform.

Parameters:
in - The measured data.
Returns:
Processed data of the same length as input data.

visualize

public VectorG[] visualize(VectorG[] in,
                           VectorG[] ft)
Calls the periodogram. Ignores original data.

Specified by:
visualize in interface Analyser
Overrides:
visualize in class AbstractAnalyser
Parameters:
in - The measured data.
ft - The processed data from Analyser.process(vec_math.VectorG[]).
Returns:
Visualizable data derived from processed one.

falseAlarm

public static double falseAlarm(double pdf,
                                int length,
                                double var)
Estimates a false-alarm probability for a power spectrum that is constructed in the following way:
Let f(t) be a real function sampled at tj to give a set of fj.
The discrete fourier transform is defined as the complex
       D(ν)=1/N Σfjexp(-2πν(tj-av(t))),
       D(-ν)=D*(ν)
       
The power spectrum is then pdf(ν) = |D(ν)|&pow2;
With this pdf, we estimate the false-alarm probability according to
       N*exp(-pdf_max*(N-1)/σ&pow2;)
       

Parameters:
pdf - Value of the power density at the maximum
length - Number of data points in the sample.
var - Variance of the measured data set.

significance

public double significance(double pdf,
                           VectorG[] data,
                           VectorG[] p,
                           VectorG[] v)
Significance out of false-alarm.

Parameters:
pdf - Extrapolated maximum of power.
data - Input data, used for scaling.
x0 - Must be zero.
y0 - Must be one.
Returns:
A significance, 1-false-Alarm probability

metadata

public Object[] metadata(VectorG[] in,
                         VectorG[] proc,
                         VectorG[] visual)
Fourier analysis have no metadata.

Parameters:
in - The original data, before process.
proc - The processed data from process(vec_math.VectorG[]).
visual - The visualized data from visualize(vec_math.VectorG[], vec_math.VectorG[]).

maximum

public static Vector3D maximum(Vector2D[] lomb)
Searches the global maximum in the Lomb spectrum and interpolates to the peak. Returns the maximum frequency in the zero'th index, the value of the periodogram at that frequency plus the false-alarm probability there.

Parameters:
lomb - The values of the periodogram, as from #period.
var - The variance (σ&pow2;) of the data.

maximum

public static Vector3D maximum(Vector2D[] lomb,
                               int start,
                               int end)
Searches the local maximum in the Lomb spectrum and interpolates to the peak. Returns the maximum frequency in the zero'th index, the value of the periodogram at that frequency plus the false-alarm probability there.

Parameters:
lomb - The values of the periodogram, as from #period.
var - The variance (σ&pow2;) of the data.
start - The lower index to start maximum search.
end - The higer index where to end maximum search

maximum

public static Vector3D maximum(Vector2D[] lomb,
                               int around)
Searches the local maximum in the Lomb spectrum and interpolates to the peak. Returns the maximum frequency in the zero'th index, the value of the periodogram at that frequency plus the false-alarm probability there.

Parameters:
lomb - The values of the lomb periodogram, as from #period.
var - The variance (σ&pow2;) of the data.
around - From this index we slide uphill to the maximum.

periodogram

public static final Vector2D[] periodogram(Vector3D[] ft)
Returns the periodogram by copy of the period plus mode-squared of the complex in y/z.


getWhitened

public static Vector2D[] getWhitened(Vector2D[] data,
                                     Vector3D[] dft,
                                     double freq)
Whitens the data set by reducing the the original data by the highest harmonic.


whiten

private static Vector2D[] whiten(Vector2D[] data,
                                 Vector3D[] dft,
                                 Vector2D[] pdf,
                                 int at)
Whitens the data set by reducing the the original data by the highest harmonic.


parabolicMaximum

private static Vector3D parabolicMaximum(Vector2D[] lomb,
                                         int imax)
Return the maximum fit as an interpolating parabolia around the specified index in the lomb periodogram.

Parameters:
lomb - The values of the lomb periodogram, as from #period.
var - The oversampling factor.
imax - The index of the local maximum.

getMinimumStep

public static double getMinimumStep(VectorG[] sorted)
Calculates the minimum time step in the data. Data must be sorted in increasing t (index zero).


getMaximumSpan

public static final double getMaximumSpan(VectorG[] sorted)
Returns the time-span of the observation, data must be sorted.