uk.ac.ed.ph.signal
Class ComplexSignal

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

public class ComplexSignal
extends Signal

Class to deal with and process Complex Signals where the signal is held as an interleaved array of doubles.


Field Summary
 
Fields inherited from class uk.ac.ed.ph.signal.Signal
data, fmt, plot
 
Constructor Summary
ComplexSignal(ComplexSignal s)
          Constrcuor to forma ComplexSignal with all information taked fromthe specifed ComplexSignal inclduing a copy of the data
ComplexSignal(double[] rp, double[] ip)
          Constrctor to forma ComplexSignal from a real and imaginary double[] arrays
ComplexSignal(int n)
          Constrcutor to form a ComplexSignal with specified number of data points.
ComplexSignal(RealSignal s)
          Constrcuor to forma ComplexSignal with all information taked from the RealSignal only work if RealSignal in in REAL space
 
Method Summary
 ComplexSignal clone()
          Methed to clone the current signal, inclduing the data
 ComplexSignal extract(double start, double length)
          Method to extarct a length of Signal into a new ComplexSignal
 ComplexSignal extract(int start, int length)
          Method to extarct a length of Signal into a new ComplexSignal
 ComplexSignal extract(int start, int length, int sample)
          Method to extarct a lengtn of Signal into a new ComplexSignal
 String formatElement(int i)
          Method to format a single element
static ComplexSignal fromTextFile(File file)
          Static to read in ComplexSignal from text data file with two or three doubles per line
static ComplexSignal fromTextFile(String fileName)
          Static to read in ComplexSignal from text data file with two doubles per line
 ComplexDataArray 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

ComplexSignal

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

Parameters:
n - number of data points

ComplexSignal

public ComplexSignal(double[] rp,
                     double[] ip)
Constrctor to forma ComplexSignal from a real and imaginary double[] arrays

Parameters:
rp - the real array
ip - the imaginary array

ComplexSignal

public ComplexSignal(ComplexSignal s)
Constrcuor to forma ComplexSignal with all information taked fromthe specifed ComplexSignal inclduing a copy of the data

Parameters:
s - specifying ComplexSignal

ComplexSignal

public ComplexSignal(RealSignal s)
Constrcuor to forma ComplexSignal with all information taked from the RealSignal only work if RealSignal in in REAL space

Parameters:
s - specifying ComplexSignal
Method Detail

clone

public ComplexSignal clone()
Methed to clone the current signal, inclduing the data

Overrides:
clone in class Object
Returns:
ComplexSignal clone of curret ComplexSignal

getDataArray

public ComplexDataArray getDataArray()
Method to get the DataArray


extract

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

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

extract

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

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

extract

public ComplexSignal extract(double start,
                             double length)
Method to extarct a length of Signal into a new ComplexSignal

Parameters:
start - the start time
length - the length of the extarction

formatElement

public String formatElement(int i)
Description copied from class: Signal
Method to format a single element

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

fromTextFile

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

Parameters:
file - the text file

fromTextFile

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

Parameters:
fileName - the text file