charmeurga
Messages postés28Date d'inscriptiondimanche 2 novembre 2008StatutMembreDernière intervention25 novembre 2011
-
16 nov. 2011 à 07:19
cs_GodConan
Messages postés2113Date d'inscriptionsamedi 8 novembre 2003StatutContributeurDernière intervention 6 octobre 2012
-
16 nov. 2011 à 18:08
J’applique la transformé de Fourier 2D mais il me donne des fausse valeurs
voila exemple :
import edu.emory.mathcs.jtransforms.fft.DoubleFFT_2D;
public class FFT {
double[][]mn;
FFT(){
mn=new double[4][4];
ComplexArray bf_x1 = new ComplexArray(4, 4);
for(int c=0;c<4;c++) {
for(int d=0;d<4;d++) {
bf_x1.setReal(c, d, 9);
bf_x1.setImag(c, d, 0);
}
}
DoubleFFT_2D fft = new DoubleFFT_2D(4, 4);
fft.complexForward(bf_x1.array);//transformé de Fourier
fft.complexInverse(bf_x1.array, true);//inverce transformé de Fourier
}
public static void main (String[]args){
new FFT();
}
}
et la classe ComplexArray
class ComplexArray {
public final int W,H;
public double[][] array;
public ComplexArray(int W, int H) {
this.W=W; this.H=H;
this.array=new double[W][2*H];
}
public void setReal(int x,int y, double real) { this.array[x][2*y]=real; }
public void setImag(int x,int y, double imag) { this.array[x][2*y+1]=imag; }
public double getReal(int x,int y) { return this.array[x][2*y]; }
public double getImag(int x,int y) { return this.array[x][2*y+1]; }
}