Class HartleyTransform2

  • All Implemented Interfaces:
    java.awt.event.ActionListener, java.awt.event.WindowListener, java.lang.Runnable, java.util.EventListener

    public class HartleyTransform2
    extends AlgorithmBase
    Smithsonian Astrophysical Observatory Submillimeter Receiver Laboratory am transform.c S. Paine rev. 2018 February 5 Discrete Fourier, Hartley, and Hilbert transforms.
    • Constructor Detail

      • HartleyTransform2

        public HartleyTransform2()
      • HartleyTransform2

        public HartleyTransform2​(ModelImage transformImage,
                                 ModelImage inverseImage,
                                 ModelImage srcImg,
                                 int constructionMethod,
                                 int filterType,
                                 double f1,
                                 double f2,
                                 int filterOrder,
                                 double epsilon,
                                 double rs)
    • Method Detail

      • testHartley

        public void testHartley()
      • fht2D

        public void fht2D​(int yDim,
                          int xDim,
                          double[][] src,
                          double[][] dst,
                          boolean forwardTransform)
      • fht_dif

        public void fht_dif​(double[] x,
                            int n)
        void fht_dif(double *x, unsigned long n) Purpose: Computes the discrete Hartley transform of a real sequence x[0..n-1], using a radix 2 decimation-in-frequency FHT. n must be a power of 2. Entering this function, x[] is in normal order. On return, x[] contains the Hartley transform, stored in bit-reversed order. Arguments: double *x - array of n doubles, representing n real numbers unsigned long n - dimension of x, must be a power of 2 Return: none
      • fht_dif_iter

        static void fht_dif_iter​(double[] x,
                                 int n)
        static void fht_dif_iter(double *x, unsigned long n) Purpose: Computes the discrete Hartley transform of a real sequence x[0..n-1], using an iterative radix 2 decimation-in-frequency FHT. n must be a power of 2. Entering this function, x[] is in normal order. On return, x[] contains the Hartley transform, stored in bit-reversed order. Arguments: double *x - array of n doubles, representing n real numbers unsigned long n - dimension of x, must be a power of 2 Return: none
      • fht_dif_iter_seq

        static void fht_dif_iter_seq​(double[] x,
                                     int n)
        static void fht_dif_iter_seq(double *x, unsigned long n) Purpose: Computes the discrete Hartley transform of a real sequence x[0..n-1], using an iterative radix 2 decimation-in-frequency FHT. n must be a power of 2. Entering this function, x[] is in normal order. On return, x[] contains the Hartley transform, stored in bit-reversed order. The two inner loops of the FHT computation are ordered to favor sequential memory access at the expense of redundant trig computations. See J. Arndt, "Algorithms for Programmers," online at http://www.jjj.de/fxt/. Arguments: double *x - array of n doubles, representing n real numbers unsigned long n - dimension of x, must be a power of 2 Return: none
      • fht_dif_rec

        static void fht_dif_rec​(double[] x,
                                int n,
                                int nbranch)
        static void fht_dif_rec(double *x, unsigned long n, int nbranch) Purpose: Computes the discrete Hartley transform of a real sequence x[0..n-1], using a radix 2 decimation-in-frequency FHT. 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. n must be a power of 2. Entering this function, x[] must be in normal order. On return, x[] contains the Hartley transform, in bit-reversed order. 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 *x - array of n doubles, representing n real numbers unsigned long n - dimension of x, must be a power of 2 int nbranch - number of transforms at this recursion level Return: none
      • fht_dit

        public void fht_dit​(double[] x,
                            int n)
        void fht_dit(double *x, unsigned long n) Purpose: Computes the discrete Hartley transform of a real sequence x[0..n-1], using a radix 2 decimation-in-time FHT. n must be a power of 2. Entering this function, x[] must be in bit-reversed order. On return, x[] contains the Hartley transform, returned to normal order. Arguments: double *x - array of n doubles, representing n real numbers unsigned long n - dimension of x, must be a power of 2 Return: none
      • fht_dit_iter

        static void fht_dit_iter​(double[] x,
                                 int n)
        static void fht_dit_iter(double *x, unsigned long n) Purpose: Computes the discrete Hartley transform of a real sequence x[0..n-1], using an iterative radix 2 decimation-in-time FHT. n must be a power of 2. Entering this function, x[] must be in bit-reversed order. On return, x[] contains the Hartley transform, returned to normal order. Arguments: double *x - array of n doubles, representing n real numbers unsigned long n - dimension of x, must be a power of 2 Return: none
      • fht_dit_iter_seq

        static void fht_dit_iter_seq​(double[] x,
                                     int n)
        static void fht_dit_iter_seq(double *x, unsigned long n) Purpose: Computes the discrete Hartley transform of a real sequence x[0..n-1], using an iterative radix 2 decimation-in-time FHT. n must be a power of 2. Entering this function, x[] must be in bit-reversed order. On return, x[] contains the Hartley transform, returned to normal order. The two inner loops of the FHT computation are ordered to favor sequential memory access at the expense of redundant trig computations. See J. Arndt, "Algorithms for Programmers," online at http://www.jjj.de/fxt/. Arguments: double *x - array of n doubles, representing n real numbers unsigned long n - dimension of x, must be a power of 2 Return: none
      • fht_dit_rec

        static void fht_dit_rec​(double[] x,
                                int n,
                                int nbranch)
        static void fht_dit_rec(double *x, unsigned long n, int nbranch) Purpose: Computes the discrete Hartley transform of a real sequence x[0..n-1], using a radix 2 decimation-in-time FHT. 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. n must be a power of 2. Entering this function, x[] must be in bit-reversed order. On return, x[] contains the Hartley transform, returned to normal order. 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 *x - array of n doubles, representing n real numbers unsigned long n - dimension of x, must be a power of 2 int nbranch - number of transforms at this recursion level Return: none
      • bitrevorder

        private double[] bitrevorder​(double[] X)
      • runAlgorithm

        public void runAlgorithm()
        Description copied from class: AlgorithmBase
        Actually runs the algorithm. Implemented by inheriting algorithms.
        Specified by:
        runAlgorithm in class AlgorithmBase
      • makeGaussianFilter

        private void makeGaussianFilter​(double[] buffer,
                                        double rmsFreq)
      • makeButterworthFilter

        private void makeButterworthFilter​(double[] buffer,
                                           double fr1,
                                           double fr2)
        DOCUMENT ME!
        Parameters:
        fr1 - DOCUMENT ME!
        fr2 - DOCUMENT ME!
      • makeEllipticFilter

        private void makeEllipticFilter​(double[] buffer,
                                        double fr1,
                                        double fr2)
      • Chebyshev

        private double Chebyshev​(int order,
                                 double w)
      • makeChebyshevTypeIFilter

        private void makeChebyshevTypeIFilter​(double[] buffer,
                                              double fr1,
                                              double fr2)
      • makeChebyshevTypeIIFilter

        private void makeChebyshevTypeIIFilter​(double[] buffer,
                                               double fr1,
                                               double fr2)
      • center

        private void center​(double[] data)
        Centers the FFT for display purposes.
        Parameters:
        rData - real data buffer
        iData - imaginary data buffer