uk.ac.ed.ph.signal
Class RealSignal

java.lang.Object
  extended by uk.ac.ed.ph.signal.Signal
      extended by uk.ac.ed.ph.signal.RealSignal

public class RealSignal
extends Signal

Class to deal with and process Real Signals where the signal is held as an 1 dimensial array of doubles.


Field Summary
 
Fields inherited from class uk.ac.ed.ph.signal.Signal
data, fmt, plot
 
Constructor Summary
RealSignal(ComplexSignal s, int flag)
          Constuctor top form a RealSignal from a ComplexSignal with a conversion flag
RealSignal(double[] d)
          Constrctor to form a RealSignal double[] array.
RealSignal(int n)
          Constrcutor to form a RealSignal with specified number of data points.
RealSignal(RealDataArray da)
          Constrctor to form a RealSignal a ReadDataArray.
RealSignal(RealSignal s)
          Constructor to for a RealSignal with parameeters and data from a specifed RealSignal.
 
Method Summary
 RealSignal clone()
          Method to clone the current RealDataArray
 RealSignal extract(int start, int length)
          Method to extarct a length of Signal into a new RealSignal
 RealSignal extract(int start, int length, int sample)
          Method to extarct a lengtn of Signal into a new RealSignal
 String formatElement(int i)
          Format an elemenst
static RealSignal fromTextFile(File file)
          Static to read in RealSignal from text data file with two or three doubles per line
static RealSignal fromTextFile(String fileName)
          Static to read in ComplexSignal from text data file with two doubles per line
 RealDataArray getDataArray()
          Method to get the DataArray
 
Methods inherited from class uk.ac.ed.ph.signal.Signal
add, add, add, add, centreFourier, conjugate, conjugate, fillSine, fourier, getComplex, getComplex, getConversion, getCurrentWidth, getDataBuffer, getDouble, getDouble, getPlot, getRealSignal, getRealSignal, getSample, getSampleInterval, getSpace, getStart, getTime, getTitle, getType, getWidth, mult, mult, mult, mult, mult, mult, mult, multConjugate, powerSpectrum, setComplex, setComplex, setConversion, setDouble, setSampleFrequency, setSampleInterval, setStart, setTitle, toGraph, toPlot, toPlot, toPrintWriter, toTextFile, toTextFile, weight
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RealSignal

public RealSignal(int n)
Constrcutor to form a RealSignal with specified number of data points.

Parameters:
n - number of data points

RealSignal

public RealSignal(double[] d)
Constrctor to form a RealSignal double[] array. The data is NOT copied, but the suppled double[] array is used.

Parameters:
d - the array

RealSignal

public RealSignal(RealDataArray da)
Constrctor to form a RealSignal a ReadDataArray. The data is NOT copied,

Parameters:
da - the DataArray

RealSignal

public RealSignal(RealSignal s)
Constructor to for a RealSignal with parameeters and data from a specifed RealSignal. The data ins copied to new space.

Parameters:
s - the RealSignal

RealSignal

public RealSignal(ComplexSignal s,
                  int flag)
Constuctor top form a RealSignal from a ComplexSignal with a conversion flag

Parameters:
s - the ComplexSignal
flag - the conveesion flag.
Method Detail

clone

public RealSignal clone()
Method to clone the current RealDataArray

Overrides:
clone in class Object

getDataArray

public RealDataArray getDataArray()
Method to get the DataArray


extract

public RealSignal extract(int start,
                          int length,
                          int sample)
Method to extarct a lengtn of Signal into a new RealSignal

Parameters:
start - start element of extarction
length - length of extarcted signal
sample - sample interval

extract

public RealSignal extract(int start,
                          int length)
Method to extarct a length of Signal into a new RealSignal

Parameters:
start - start element of extarction
length - length of extarcted signal

formatElement

public String formatElement(int i)
Format an elemenst

Parameters:
i - the element index
Returns:
String the formatted String.

fromTextFile

public static RealSignal fromTextFile(File file)
Static to read in RealSignal from text data file with two or three doubles per line

Parameters:
file - the text file

fromTextFile

public static RealSignal fromTextFile(String fileName)
Static to read in ComplexSignal from text data file with two doubles per line

Parameters:
fileName - the text file