jm.jigl
Class ComplexSignal

java.lang.Object
  |
  +--jm.jigl.ComplexSignal
All Implemented Interfaces:
Signal

public class ComplexSignal
extends java.lang.Object
implements Signal

A complex signal is a set of two real gray signal planes.

ComplexSignal implements Signal

See Also:
jigl.math.ComplexSignal

Field Summary
protected  RealSignal imag
          The Imaginary part of the signal
protected  int length
          Cartesian length of the signal
protected  RealSignal real
          The Real plane of the signal
 
Constructor Summary
ComplexSignal()
          Creates a ComplexSignal with height and width of zero and the real and imaginary planes set to null
ComplexSignal(ComplexSignal s)
          Creates a ComplexSignal as a shallow copy of a complex signal
ComplexSignal(int x)
          Creates a ComplexSignal with height and width of x and y repectively
 
Method Summary
 void add(ComplexSignal im)
          Adds another ComplexSignal to this signal
 void add(ComplexSignal im, ROI sourceSignal, ROI destSignal)
          Adds a Region of Interest in another GraySignal from a Region of Interest of this signal
 ComplexSignal add(float r, float i)
          Adds a value to all the pixels in this signal
 ComplexSignal add(float r, float i, ROI r2)
          Adds a value to all the pixels in a Region of Interest
 void add(int x, float r, float i)
          Adds a value to a single pixel
 void add(int x, float r, float i, ROI r2)
          Adds a value to a single pixel in a Region of Interest
 Signal copy()
          Makes a deep copy of this signal
 Signal copy(ROI r)
          Makes a deep copy of a Region of Interest
 ComplexSignal diff(ComplexSignal s)
          Subtracts the second signal from the first and returns the absolute value
 void divide(ComplexSignal im)
          Divides this signal by another ComplexSignal
 void divide(ComplexSignal im, ROI sourceSignal, ROI destSignal)
          Divides by a Region of Interest in this signal by a Region of Interest of another ComplexSignal
 ComplexSignal divide(float r, float i)
          Divides all the pixels by a value in this signal
 ComplexSignal divide(float r, float i, ROI r2)
          Divides all the pixels by a value in a Region of Interest
 void divide(int x, float r, float i)
          Divide a single pixel by a value
 void divide(int x, float r, float i, ROI r2)
          Divide a single pixel by a value in a Region of Interest
 float getImag(int x)
          Returns the pixel value at the given x value of the imaginary plane
 float getImag(int x, ROI r)
          Returns the pixel value at the given x value of a Region of Interest in the imaginary plane
 float getReal(int x)
          Returns the pixel value at the given x value of the real plane
 float getReal(int x, ROI r)
          Returns the pixel value at the given x value of a Region of Interest in the real plane
 RealSignal imag()
          Makes a shallow copy of the imaginary plane
 int length()
          Returns the length of the signal
 Complex max()
          Returns the maximum magnitude in this signal
 Complex max(ROI r)
          Returns the maximum magnitude in a Region of Interest
 Complex min()
          Returns the minimum magnitude in this signal
 Complex min(ROI r)
          Returns the minimum magnitude in a Region of Interest
 void multiply(ComplexSignal im)
          Multiplies this signal by another ComplexSignal
 void multiply(ComplexSignal im, ROI sourceSignal, ROI destSignal)
          Multiplies a Region of Interest of another GraySignal by a Region of Interest of this signal
 ComplexSignal multiply(float r, float i)
          Multiplies all the pixels in this signal by a value
 ComplexSignal multiply(float r, float i, ROI r2)
          Multiplies all the pixels by a value in a Region of Interest
 void multiply(int x, float r, float i)
          Multiply a single pixel by a value
 void multiply(int x, float r, float i, ROI r2)
          Multiply a single pixel by a value in a Region of Interest
 RealSignal real()
          Makes a shallow copy of the real plane
 void set(int x, float r, float i)
          Sets the pixel value at x to a given value of this signal
 void set(int x, float r, float i, ROI r2)
          Sets the pixel value at x to a given value in a Region of Interest
 void setImag(int x, float v)
          Sets the pixel value at x to a given value of the imaginary
 void setImag(int x, float v, ROI r)
          Sets the pixel value at the given x value of a Region of Interest in the imaginary plane
 void setImag(RealSignal pl)
          Set the real plane of this signal
 void setReal(int x, float v)
          Sets the pixel value at x to a given value of the real plane
 void setReal(int x, float v, ROI r)
          Sets tthe pixel value at the given x value of a Region of Interest in the real plane
 void setReal(RealSignal pl)
          Set the real plane of this signal
 void subtract(ComplexSignal im)
          Subtracts another ComplexSignal from this signal
 void subtract(ComplexSignal im, ROI sourceSignal, ROI destSignal)
          Subtracts a Region of Interest in another GraySignal from a Region of Interest of this signal
 ComplexSignal subtract(float r, float i)
          Subtracts a value from all the pixels in this signal
 ComplexSignal subtract(float r, float i, ROI r2)
          Subtracts a value from all the pixels in a Region of Interest
 void subtract(int x, float r, float i)
          Subtracts a value from a single pixel
 void subtract(int x, float r, float i, ROI r2)
          Subtracts a value from a single pixel in a Region of Interest
 java.lang.String toString()
          Prints the string in integer format.
 java.lang.String toString(ROI r)
          Prints the string in integer format.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

real

protected RealSignal real
The Real plane of the signal


imag

protected RealSignal imag
The Imaginary part of the signal


length

protected int length
Cartesian length of the signal

Constructor Detail

ComplexSignal

public ComplexSignal()
Creates a ComplexSignal with height and width of zero and the real and imaginary planes set to null


ComplexSignal

public ComplexSignal(int x)
Creates a ComplexSignal with height and width of x and y repectively


ComplexSignal

public ComplexSignal(ComplexSignal s)
Creates a ComplexSignal as a shallow copy of a complex signal

Method Detail

length

public final int length()
Returns the length of the signal

Specified by:
length in interface Signal

real

public final RealSignal real()
Makes a shallow copy of the real plane


imag

public final RealSignal imag()
Makes a shallow copy of the imaginary plane


copy

public Signal copy()
Makes a deep copy of this signal

Specified by:
copy in interface Signal
Returns:
a deep copy of ComplexSignal

setReal

public final void setReal(RealSignal pl)
Set the real plane of this signal

Parameters:
pl - the RealSignal to set the real plane to

setImag

public final void setImag(RealSignal pl)
Set the real plane of this signal

Parameters:
pl - the RealSignal to set the real plane to

getReal

public final float getReal(int x)
Returns the pixel value at the given x value of the real plane

Parameters:
x - the length coordinant

getImag

public final float getImag(int x)
Returns the pixel value at the given x value of the imaginary plane

Parameters:
x - the length coordinant

setReal

public final void setReal(int x,
                          float v)
Sets the pixel value at x to a given value of the real plane

Parameters:
x - the length coordinant
v - the value to set the pixel to

setImag

public final void setImag(int x,
                          float v)
Sets the pixel value at x to a given value of the imaginary

Parameters:
x - the length coordinant
v - the value to set the pixel to

set

public final void set(int x,
                      float r,
                      float i)
Sets the pixel value at x to a given value of this signal

Parameters:
x - the length coordinant
r - the value to set the pixel to in the real plane
i - the value to set the pixel to in the imaginary plane

min

public final Complex min()
Returns the minimum magnitude in this signal


max

public final Complex max()
Returns the maximum magnitude in this signal


add

public final void add(int x,
                      float r,
                      float i)
Adds a value to a single pixel

Parameters:
x - length-coordinant
r - the value to add to the pixel in the real plane
i - the value to add to the pixel in the imaginary plane

subtract

public final void subtract(int x,
                           float r,
                           float i)
Subtracts a value from a single pixel

Parameters:
x - length-coordinant
r - the value to add to the pixel in the real plane
i - the value to add to the pixel in the imaginary plane

multiply

public final void multiply(int x,
                           float r,
                           float i)
Multiply a single pixel by a value

Parameters:
x - length-coordinant
r - the value to add to the pixel in the real plane
i - the value to add to the pixel in the imaginary plane

divide

public final void divide(int x,
                         float r,
                         float i)
Divide a single pixel by a value

Parameters:
x - length-coordinant
r - the value to add to the pixel in the real plane
i - the value to add to the pixel in the imaginary plane

add

public final void add(ComplexSignal im)
Adds another ComplexSignal to this signal

Parameters:
im - the ComplexSignal to add
Returns:
this

subtract

public final void subtract(ComplexSignal im)
Subtracts another ComplexSignal from this signal

Parameters:
im - the ComplexSignal to subtract
Returns:
this

diff

public final ComplexSignal diff(ComplexSignal s)
Subtracts the second signal from the first and returns the absolute value


multiply

public final void multiply(ComplexSignal im)
Multiplies this signal by another ComplexSignal

Parameters:
im - the ComplexSignal to multiply
Returns:
this

divide

public final void divide(ComplexSignal im)
Divides this signal by another ComplexSignal

Parameters:
im - the ComplexSignal to divide
Returns:
this

add

public final ComplexSignal add(float r,
                               float i)
Adds a value to all the pixels in this signal

Parameters:
r - value to be added to the pixels in the real plane
i - value to be added to the pixels in the imaginary plane
Returns:
this

subtract

public final ComplexSignal subtract(float r,
                                    float i)
Subtracts a value from all the pixels in this signal

Parameters:
r - value to be subtract from the pixels in the real plane
i - value to be subtracted from pixels in the imaginary plane
Returns:
this

multiply

public final ComplexSignal multiply(float r,
                                    float i)
Multiplies all the pixels in this signal by a value

Parameters:
r - value to be multiplied by the pixels in the real plane
i - value to be multiplied by the pixels in the imaginary plane
Returns:
this

divide

public final ComplexSignal divide(float r,
                                  float i)
Divides all the pixels by a value in this signal

Parameters:
r - value to be divided into the pixels in the real plane
i - value to be divided into the pixels in the imaginary plane
Returns:
this

toString

public java.lang.String toString()
Prints the string in integer format.
-Example of output on an signal with width 100 and height 120:
100 : 120
5 23 54 7 3 23 46 253 23 53 65 34 ...
100 : 120
10 20 32 12 32 56 40 59 42 39 43 ...

Specified by:
toString in interface Signal
Overrides:
toString in class java.lang.Object

copy

public Signal copy(ROI r)
Makes a deep copy of a Region of Interest

Parameters:
r - Region of Interest
Returns:
a deep copy of ComplexSignal

getReal

public final float getReal(int x,
                           ROI r)
Returns the pixel value at the given x value of a Region of Interest in the real plane

Parameters:
x - the length coordinant
r - Region of Interest

getImag

public final float getImag(int x,
                           ROI r)
Returns the pixel value at the given x value of a Region of Interest in the imaginary plane

Parameters:
x - the length coordinant
r - Region of Interest

setReal

public final void setReal(int x,
                          float v,
                          ROI r)
Sets tthe pixel value at the given x value of a Region of Interest in the real plane

Parameters:
x - the length coordinant
r - Region of Interest

setImag

public final void setImag(int x,
                          float v,
                          ROI r)
Sets the pixel value at the given x value of a Region of Interest in the imaginary plane

Parameters:
x - the length coordinant
r - Region of Interest

set

public final void set(int x,
                      float r,
                      float i,
                      ROI r2)
Sets the pixel value at x to a given value in a Region of Interest

Parameters:
x - the length coordinant
r - the value to set the pixel to in the real plane
i - the value to set the pixel to in the imaginary plane
r2 - Region of Interest

min

public final Complex min(ROI r)
Returns the minimum magnitude in a Region of Interest

Parameters:
r - Region of Interest

max

public final Complex max(ROI r)
Returns the maximum magnitude in a Region of Interest

Parameters:
r - Region of Interest

add

public final void add(int x,
                      float r,
                      float i,
                      ROI r2)
Adds a value to a single pixel in a Region of Interest

Parameters:
x - length-coordinant
r - the value to add to the pixel in the real plane
i - the value to add to the pixel in the imaginary plane
r2 - Region of Interest

subtract

public final void subtract(int x,
                           float r,
                           float i,
                           ROI r2)
Subtracts a value from a single pixel in a Region of Interest

Parameters:
x - length-coordinant
r - the value to add to the pixel in the real plane
i - the value to add to the pixel in the imaginary plane
r2 - Region of Interest

multiply

public final void multiply(int x,
                           float r,
                           float i,
                           ROI r2)
Multiply a single pixel by a value in a Region of Interest

Parameters:
x - length-coordinant
r - the value to add to the pixel in the real plane
i - the value to add to the pixel in the imaginary plane
r2 - Region of Interest

divide

public final void divide(int x,
                         float r,
                         float i,
                         ROI r2)
Divide a single pixel by a value in a Region of Interest

Parameters:
x - length-coordinant
r - the value to add to the pixel in the real plane
i - the value to add to the pixel in the imaginary plane
r2 - Region of Interest

add

public final ComplexSignal add(float r,
                               float i,
                               ROI r2)
Adds a value to all the pixels in a Region of Interest

Parameters:
r - value to be added to the pixels in the real plane
i - value to be added to the pixels in the imaginary plane
r2 - Region of Interest
Returns:
this

subtract

public final ComplexSignal subtract(float r,
                                    float i,
                                    ROI r2)
Subtracts a value from all the pixels in a Region of Interest

Parameters:
r - value to be subtract from the pixels in the real plane
i - value to be subtracted from pixels in the imaginary plane
r2 - Region of Interest
Returns:
this

multiply

public final ComplexSignal multiply(float r,
                                    float i,
                                    ROI r2)
Multiplies all the pixels by a value in a Region of Interest

Parameters:
r - value to be multiplied by the pixels in the real plane
i - value to be multiplied by the pixels in the imaginary plane
r2 - Region of Interest
Returns:
this

divide

public final ComplexSignal divide(float r,
                                  float i,
                                  ROI r2)
Divides all the pixels by a value in a Region of Interest

Parameters:
r - value to be divided into the pixels in the real plane
i - value to be divided into the pixels in the imaginary plane
r2 - Region of Interest
Returns:
this

toString

public java.lang.String toString(ROI r)
Prints the string in integer format.
-Example of output on an signal with width 100 and height 120:
100 : 120
5 23 54 7 3 23 46 253 23 53 65 34 ...
100 : 120
10 20 32 12 32 56 40 59 42 39 43 ...

Parameters:
r - Region of Interest

add

public final void add(ComplexSignal im,
                      ROI sourceSignal,
                      ROI destSignal)
Adds a Region of Interest in another GraySignal from a Region of Interest of this signal

Parameters:
im - the ComplexSignal to add
sourceSignal - Region of Interest for the Source Signal
destSignal - Region of Interest for the Destination Signal
Returns:
this

subtract

public final void subtract(ComplexSignal im,
                           ROI sourceSignal,
                           ROI destSignal)
Subtracts a Region of Interest in another GraySignal from a Region of Interest of this signal

Parameters:
im - the ComplexSignal to subtract
sourceSignal - Region of Interest for the Source Signal
destSignal - Region of Interest for the Destination Signal
Returns:
this

multiply

public final void multiply(ComplexSignal im,
                           ROI sourceSignal,
                           ROI destSignal)
Multiplies a Region of Interest of another GraySignal by a Region of Interest of this signal

Parameters:
im - the ComplexSignal to multiply
sourceSignal - Region of Interest for the Source Signal
destSignal - Region of Interest for the Destination Signal
Returns:
this

divide

public final void divide(ComplexSignal im,
                         ROI sourceSignal,
                         ROI destSignal)
Divides by a Region of Interest in this signal by a Region of Interest of another ComplexSignal

Parameters:
im - the ComplexSignal to divide
sourceSignal - Region of Interest for the Source Signal
destSignal - Region of Interest for the Destination Signal
Returns:
this