import java.lang.Math.*; import java.awt.*; /** * The InverseFFT class contains a method to apply the 2D inverse FFT to a * TwoDArray. * * @author Simon Horne */ public class InverseFFT{ public int progress; /** * Default no argument constructor. */ public InverseFFT(){ } /** * Recursively applies the 1D inverse FFT algorithm. * * @param x ComplexNumber array containing the input to the 1D inverse FFT. * @return ComplexNumber array containing the result of the 1D inverse FFT. */ public ComplexNumber [] recursiveInverseFFT (ComplexNumber [] x){ ComplexNumber z1,z2,z3,z4,tmp,cTwo; int n = x.length; int m = n/2; ComplexNumber [] result = new ComplexNumber [n]; ComplexNumber [] even = new ComplexNumber [m]; ComplexNumber [] odd = new ComplexNumber [m]; ComplexNumber [] sum = new ComplexNumber [m]; ComplexNumber [] diff = new ComplexNumber [m]; cTwo = new ComplexNumber(2,0); if(n==1){ result[0] = x[0]; }else{ z1 = new ComplexNumber(0.0, 2*(Math.PI)/n); tmp = ComplexNumber.cExp(z1); z1 = new ComplexNumber(1.0, 0.0); for(int i=0;imax) max=values[i]; } return max; } /** * Method to find the minimum value from an array of doubles. * * @param values an array of doubles. * @return The minimum value. */ private double minValue(double [] values){ double min = values[0]; for(int i=1;i