Class Convolution

  • Direct Known Subclasses:
    HilbertTransform

    public class Convolution
    extends java.lang.Object
    implementation of the discrete convolution algorithm via the fourier transform
    Author:
    rstein
    • Field Summary

      Fields 
      Modifier and Type Field Description
      org.jtransforms.fft.DoubleFFT_1D f1dFFT  
    • Constructor Summary

      Constructors 
      Constructor Description
      Convolution()  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static void complexMultiply​(double[] data1, double[] data2)  
      static double[] getDerivativeFilter​(int length)
      computes derivative filter (Fourier Domain)
      static double[] getHilbertFilter​(int length)
      computes the Hilbert transform filter (Fourier Domain)
      static double[] getIdentityFilter​(int length)
      computes the identity filter
      static double[] getLowPassFilter​(int length, double frequency)
      computes low-pass filter (Fourier Domain)
      static double[] getMorletFilter​(int length, double f0, double width)  
      static void main​(java.lang.String[] args)  
      protected static double MorletWaveletFunctionFourier​(double frequency, double f0, double width)  
      void Test()  
      double[] transform​(double[] data, double[] filter, boolean cyclicBoundary)
      implements convolution via FFT transform only the real part of the signal is computed
      double[] transformFull​(double[] data, double[] filter, boolean cyclicBoundary)
      implements convolution via FFT transform only the real and imaginary part of the signal is returned
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • f1dFFT

        public org.jtransforms.fft.DoubleFFT_1D f1dFFT
    • Constructor Detail

      • Convolution

        public Convolution()
    • Method Detail

      • Test

        public void Test()
      • transform

        public double[] transform​(double[] data,
                                  double[] filter,
                                  boolean cyclicBoundary)
        implements convolution via FFT transform only the real part of the signal is computed
        Parameters:
        data - the data set
        filter - the convolution filter
        cyclicBoundary - true: cyclic boundary condition; false: ZOH at boundaries
        Returns:
        the convoluted data
      • transformFull

        public double[] transformFull​(double[] data,
                                      double[] filter,
                                      boolean cyclicBoundary)
        implements convolution via FFT transform only the real and imaginary part of the signal is returned
        Parameters:
        data - the data set
        filter - the convolution filter
        cyclicBoundary - true: cyclic boundary condition; false: ZOH at boundaries
        Returns:
        the convoluted data
      • complexMultiply

        public static void complexMultiply​(double[] data1,
                                           double[] data2)
      • getDerivativeFilter

        public static double[] getDerivativeFilter​(int length)
        computes derivative filter (Fourier Domain)
        Parameters:
        length - the length of the filter
        Returns:
        array containing derivative filter kernel
      • getHilbertFilter

        public static double[] getHilbertFilter​(int length)
        computes the Hilbert transform filter (Fourier Domain)
        Parameters:
        length - the length of the filter
        Returns:
        vector containing Hilbert filter kernel
      • getIdentityFilter

        public static double[] getIdentityFilter​(int length)
        computes the identity filter
        Parameters:
        length - the length of the filter
        Returns:
        vector containing identy filter
      • getLowPassFilter

        public static double[] getLowPassFilter​(int length,
                                                double frequency)
        computes low-pass filter (Fourier Domain)
        Parameters:
        length - the length of the filter
        frequency - cut-off frequency
        Returns:
        array containing low-pass filter kernel
      • getMorletFilter

        public static double[] getMorletFilter​(int length,
                                               double f0,
                                               double width)
      • main

        public static void main​(java.lang.String[] args)
      • MorletWaveletFunctionFourier

        protected static double MorletWaveletFunctionFourier​(double frequency,
                                                             double f0,
                                                             double width)