util.wavelet
Class Signal

java.lang.Object
  extended by util.wavelet.SimpleSignal
      extended by util.wavelet.Signal
Direct Known Subclasses:
Scale, SignalAndCoordinate

public class Signal
extends SimpleSignal

Wrapper for an array of signal values and an array of noise values and their multiplier.

Author:
John Talbot

Constructor Summary
Signal(float[] value)
          Construct using signal array, the noise multiplier equal to 1 and the noise array must be set at a later time.
Signal(float[] value, float[] noise)
          Construct using signal and noise array, the noise multiplier equal to 1.
Signal(float[] value, float[] noise, float noiseMultiplier)
          Construct using signal and noise array and the given noise multiplier.
Signal(SimpleSignal signal)
          Copy constructor, the noise multiplier equal to 1 and the noise array must be set at a later time.
Signal(SimpleSignal signal, float[] noise)
          Construct using signal and noise array, the noise multiplier equal to 1.
Signal(SimpleSignal signal, float[] noise, float noiseMultiplier)
          Construct using signal and noise array and the given noise multiplier.
 
Method Summary
 SimpleSignal getNoise()
          Get a defensive copy of the noise for this signal.
 float getNoise(int position)
          Get the noise value at the given position and deal with boundary conditions when position is out of range.
 float getNoiseMultiplier()
          Get the noise multiplier.
 boolean isAboveNoise(int position)
          Test if the signal at the given position is above the noise times times the noise multiplier.
 boolean isBelowNoise(int position)
          Test if the signal at the given position is below the noise times times a given noise multiplier.
 void setNoise(int position, float noiseValue)
          Set the noise value at the given position and deal with boundary conditions when position is out of range.
 void setNoise(SimpleSignal noiseSignal)
          Set the noise for this signal (using defensive copy).
 
Methods inherited from class util.wavelet.SimpleSignal
add, add, convolve, estimateNumberOfScales, getBoundaryCondition, getChirp, getDirac, getGaussianDeviate, getGaussianNoise, getScalingFunction, getSubset, getValue, getWavelet, multiply, multiply, multiply, multiply, setBoundaryCondition, setValue, size, square, square, subtract, subtract
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Signal

public Signal(float[] value)
Construct using signal array, the noise multiplier equal to 1 and the noise array must be set at a later time.

Parameters:
value - signal array

Signal

public Signal(SimpleSignal signal)
Copy constructor, the noise multiplier equal to 1 and the noise array must be set at a later time.

Parameters:
signal - the signal

Signal

public Signal(float[] value,
              float[] noise)
Construct using signal and noise array, the noise multiplier equal to 1. Pre-condition: arrays must be of equal size.

Parameters:
value - the signal value
noise - the noise

Signal

public Signal(SimpleSignal signal,
              float[] noise)
Construct using signal and noise array, the noise multiplier equal to 1. Pre-condition: arrays must be of equal size.

Parameters:
signal - the signal
noise - the noise

Signal

public Signal(float[] value,
              float[] noise,
              float noiseMultiplier)
Construct using signal and noise array and the given noise multiplier. Pre-condition: arrays must be of equal size.

Parameters:
value - the signal array
noise - the noise array
noiseMultiplier - the noise multiplier (when sigmas = 3.0 confidence = 99.9 percent)

Signal

public Signal(SimpleSignal signal,
              float[] noise,
              float noiseMultiplier)
Construct using signal and noise array and the given noise multiplier. Pre-condition: arrays must be of equal size.

Parameters:
signal - the signal
noise - the noise array
noiseMultiplier - the noise multiplier (when sigmas = 3.0 confidence = 99.9 percent)
Method Detail

getNoise

public float getNoise(int position)
Get the noise value at the given position and deal with boundary conditions when position is out of range.

Parameters:
position - the position
Returns:
noise at the given position or extrapolated value if position is out of range

getNoise

public SimpleSignal getNoise()
Get a defensive copy of the noise for this signal.

Returns:
a copy of the noise

setNoise

public void setNoise(SimpleSignal noiseSignal)
Set the noise for this signal (using defensive copy).

Parameters:
noiseSignal - the noise signal

setNoise

public void setNoise(int position,
                     float noiseValue)
Set the noise value at the given position and deal with boundary conditions when position is out of range. Precondition : 0 ≥ index ≤ size().

Parameters:
position - the position
noiseValue - the value to set the signal to

getNoiseMultiplier

public float getNoiseMultiplier()
Get the noise multiplier.

Returns:
noise multiplier at the given position

isAboveNoise

public boolean isAboveNoise(int position)
Test if the signal at the given position is above the noise times times the noise multiplier.

Parameters:
position - the position
Returns:
true if the signal is above the noise times the noise multiplier

isBelowNoise

public boolean isBelowNoise(int position)
Test if the signal at the given position is below the noise times times a given noise multiplier.

Parameters:
position - the position
Returns:
true if the signal is below the noise times the noise multiplier