Class AlgorithmHilbertTransform
- java.lang.Object
-
- java.lang.Thread
-
- gov.nih.mipav.model.algorithms.AlgorithmBase
-
- gov.nih.mipav.model.algorithms.filters.AlgorithmHilbertTransform
-
- All Implemented Interfaces:
java.awt.event.ActionListener
,java.awt.event.WindowListener
,java.lang.Runnable
,java.util.EventListener
public class AlgorithmHilbertTransform extends AlgorithmBase
-
-
Field Summary
Fields Modifier and Type Field Description private int
n
private double[]
z
The Hilbert tramsform and the other needed supporting routines are ported from the file transform.c written by Scott Paine of the Smithsonian Astrophysical Observatory, Submillimeter Receiver Laboratory on February 2, 2010.-
Fields inherited from class gov.nih.mipav.model.algorithms.AlgorithmBase
destFlag, destImage, image25D, mask, maxProgressValue, minProgressValue, multiThreadingEnabled, nthreads, progress, progressModulus, progressStep, runningInSeparateThread, separable, srcImage, threadStopped
-
-
Constructor Summary
Constructors Constructor Description AlgorithmHilbertTransform(double[] z, int n)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private void
fft_dif(double[] z, int n)
void fft_dif(double z[], int n) Purpose: Computes the forward discrete Fourier transform of a complex sequence z, using a radix 2 decimation-in-frequency FFT.private void
fft_dif_iter(double[] z, int n)
static void fft_dif_iter(double *z, unsigned long n) Purpose: Computes the forward discrete Fourier transform of a complex sequence z, using an iterative radix 2 decimation-in-frequency FFT.private void
fft_dif_rec(double[] z, int n, int nbranch)
static void fft_dif_rec(double z[], int n, int nbranch) Purpose: Computes the forward discrete Fourier transform of a complex sequence z, using a radix 2 decimation-in-frequency FFT.private void
ifft_dit(double[] z, int n)
void ifft_dit(double z[], int n) Purpose: Computes the inverse discrete Fourier transform of a complex sequence z, using a radix 2 decimation-in-time FFT.private void
ifft_dit_iter(double[] z, int n)
static void ifft_dit_iter(double *z, unsigned long n) Purpose: Computes the inverse discrete Fourier transform of a complex sequence z, using an iterative radix 2 decimation-in-time FFT.private void
ifft_dit_rec(double[] z, int n, int nbranch)
static void ifft_dit_rec(double z[], int n, int nbranch) Purpose: Computes the inverse discrete Fourier transform of a complex sequence z, using a radix 2 decimation-in-time FFT.void
runAlgorithm()
Actually runs the algorithm.-
Methods inherited from class gov.nih.mipav.model.algorithms.AlgorithmBase
actionPerformed, addListener, addProgressChangeListener, calculateImageSize, calculatePrincipleAxis, computeElapsedTime, computeElapsedTime, convertIntoFloat, delinkProgressToAlgorithm, delinkProgressToAlgorithmMulti, displayError, errorCleanUp, finalize, fireProgressStateChanged, fireProgressStateChanged, fireProgressStateChanged, fireProgressStateChanged, fireProgressStateChanged, generateProgressValues, getDestImage, getElapsedTime, getMask, getMaxProgressValue, getMinProgressValue, getNumberOfThreads, getProgress, getProgressChangeListener, getProgressChangeListeners, getProgressModulus, getProgressStep, getProgressValues, getSrcImage, isCompleted, isImage25D, isMultiThreadingEnabled, isRunningInSeparateThread, isThreadStopped, linkProgressToAlgorithm, linkProgressToAlgorithm, makeProgress, notifyListeners, removeListener, removeProgressChangeListener, run, setCompleted, setImage25D, setMask, setMaxProgressValue, setMinProgressValue, setMultiThreadingEnabled, setNumberOfThreads, setProgress, setProgressModulus, setProgressStep, setProgressValues, setProgressValues, setRunningInSeparateThread, setSrcImage, setStartTime, setThreadStopped, startMethod, windowActivated, windowClosed, windowClosing, windowDeactivated, windowDeiconified, windowIconified, windowOpened
-
Methods inherited from class java.lang.Thread
activeCount, checkAccess, clone, countStackFrames, currentThread, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, onSpinWait, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, suspend, toString, yield
-
-
-
-
Field Detail
-
z
private double[] z
The Hilbert tramsform and the other needed supporting routines are ported from the file transform.c written by Scott Paine of the Smithsonian Astrophysical Observatory, Submillimeter Receiver Laboratory on February 2, 2010. Scott Paine wrote these routines with the add of Joerg Arndt's excellent text, "Matters Computational," online at http://www.jjj.de./fxt All of the functions assume n is a power of 2, without checking Purpose: Given a real sequence, initially stored in the complex array z, this function computes the corresponding analytic sequence. The imaginary part is the Hilbert transform of the real part.
-
n
private int n
-
-
Method Detail
-
runAlgorithm
public void runAlgorithm()
Description copied from class:AlgorithmBase
Actually runs the algorithm. Implemented by inheriting algorithms.- Specified by:
runAlgorithm
in classAlgorithmBase
-
fft_dif
private void fft_dif(double[] z, int n)
void fft_dif(double z[], int n) Purpose: Computes the forward discrete Fourier transform of a complex sequence z, using a radix 2 decimation-in-frequency FFT. z[0..2n-1] is an array of n complex numbers, stored in the usual way with real elements in z[0,2,..2n-2] and imaginary elements in z[1,3,..2n-1]. Entering this function, z[] should be in normal order. On return, the FT is stored in bit-reversed order. n must be a power of 2. Arguments: double z[] - array of 2n doubles, representing n complex numbers int n - dimension of z, must be a power of 2 Return: none
-
fft_dif_rec
private void fft_dif_rec(double[] z, int n, int nbranch)
static void fft_dif_rec(double z[], int n, int nbranch) Purpose: Computes the forward discrete Fourier transform of a complex sequence z, using a radix 2 decimation-in-frequency FFT. If the computation is small enough to fit in cache, it is done iteratively. Otherwise, it is done recursively until the recursion descends to cache-sized chunks. z[0..2n-1] is an array of n complex numbers, stored in the usual way with real elements in z[0,2,..2n-2] and imaginary elements in z[1,3,..2n-1]. Entering this function, z[] should be in normal order. On return, the FT is stored in bit-reversed order. n must be a power of 2. To support OpenMP parallelism, nbranch keeps track of the number of active transforms at a given recursion level. On the first call to this function, nbranch should be 1. It is then doubled for each recursion. Arguments: double z[] - array of 2n doubles, representing n complex numbers int n - dimension of z, must be a power of 2 int nbranch - number of transforms at this recursion level Return: none
-
fft_dif_iter
private void fft_dif_iter(double[] z, int n)
static void fft_dif_iter(double *z, unsigned long n) Purpose: Computes the forward discrete Fourier transform of a complex sequence z, using an iterative radix 2 decimation-in-frequency FFT. z[0..2n-1] is an array of n complex numbers, stored in the usual way with real elements in z[0,2,..2n-2] and imaginary elements in z[1,3,..2n-1]. Entering this function, z[] should be in normal order. On return, the FT is stored in bit-reversed order. n must be a power of 2. Arguments: double *z - array of 2n doubles, representing n complex numbers unsigned long n - dimension of z, must be a power of 2 Return: none
-
ifft_dit
private void ifft_dit(double[] z, int n)
void ifft_dit(double z[], int n) Purpose: Computes the inverse discrete Fourier transform of a complex sequence z, using a radix 2 decimation-in-time FFT. z[0..2n-1] is an array of n complex numbers, stored in the usual way with real elements in z[0,2,..2n-2] and imaginary elements in z[1,3,..2n-1]. Entering this function, z[] should be in bit-reversed order. The returned inverse FT is restored to normal order. n must be a power of 2. Arguments: double z[] - array of 2n doubles, representing n complex numbers int n - dimension of z, must be a power of 2 Return: none
-
ifft_dit_rec
private void ifft_dit_rec(double[] z, int n, int nbranch)
static void ifft_dit_rec(double z[], int n, int nbranch) Purpose: Computes the inverse discrete Fourier transform of a complex sequence z, using a radix 2 decimation-in-time FFT. If the computation is small enough to fit in cache, it is done iteratively. Otherwise, it is done recursively until the recursion descends to cache-sized chunks. z[0..2n-1] is an array of n complex numbers, stored in the usual way with real elements in z[0,2,..2n-2] and imaginary elements in z[1,3,..2n-1]. Entering this function, z[] should be in normal order. On return, the FT is stored in bit-reversed order. n must be a power of 2. To support OpenMP parallelism, nbranch keeps track of the number of active transforms at a given recursion level. On the first call to this function, nbranch should be 1. It is then doubled for each recursion. Arguments: double z[] - array of 2n doubles, representing n complex numbers int n - dimension of z, must be a power of 2 int nbranch - number of transforms at this recursion level Return: none
-
ifft_dit_iter
private void ifft_dit_iter(double[] z, int n)
static void ifft_dit_iter(double *z, unsigned long n) Purpose: Computes the inverse discrete Fourier transform of a complex sequence z, using an iterative radix 2 decimation-in-time FFT. z[0..2n-1] is an array of n complex numbers, stored in the usual way with real elements in z[0,2,..2n-2] and imaginary elements in z[1,3,..2n-1]. Entering this function, z[] should be in bit-reversed order. The returned inverse FT is restored to normal order. n must be a power of 2. Arguments: double *z - array of 2n doubles, representing n complex numbers unsigned long n - dimension of z, must be a power of 2 Return: none
-
-