/** * Computes the 2D discrete Fourier transform (DFT) of this matrix. */ public void fft2() { int oldNthreads = ConcurrencyUtils.getNumberOfThreads(); ConcurrencyUtils.setNumberOfThreads(ConcurrencyUtils.nextPow2(oldNthreads)); if (fft2 == null) { fft2 = new FloatFFT_2D(rows, columns); } fft2.complexForward(elements); ConcurrencyUtils.setNumberOfThreads(oldNthreads); }
public void run() { for (int s = firstSlice; s < lastSlice; s++) { fft2Slices.complexInverse(elements[s], scale); } } });
System.out.println("Real forward FFT 2D (input 2D) of size " + sizes2D[i] + " x " + sizes2D[i]); if (doWarmup) { // call the transform twice to warm up FloatFFT_2D fft2 = new FloatFFT_2D(sizes2D[i], sizes2D[i]); x = new float[(int) sizes2D[i]][2 * (int) sizes2D[i]]; IOUtils.fillMatrix_2D(sizes2D[i], sizes2D[i], x); fft2.realForwardFull(x); IOUtils.fillMatrix_2D(sizes2D[i], sizes2D[i], x); fft2.realForwardFull(x); FloatFFT_2D fft2 = new FloatFFT_2D(sizes2D[i], sizes2D[i]); times_with_constructor[i] = (System.nanoTime() - elapsedTime) / 1000000.0; x = new float[(int) sizes2D[i]][2 * (int) sizes2D[i]]; IOUtils.fillMatrix_2D(sizes2D[i], sizes2D[i], x); elapsedTime = System.nanoTime(); fft2.realForwardFull(x); elapsedTime = System.nanoTime() - elapsedTime; if (elapsedTime < min_time) {
int nthreads = ConcurrencyUtils.getNumberOfThreads(); if ((nthreads > 1) && useThreads) { xdft2d0_subth1(1, 1, a, true); cdft2d_subth(-1, a, true); rdft2d_sub(1, a); } else { for (int r = 0; r < rows; r++) { fftColumns.realForward(a, r * columns); cdft2d_sub(-1, a, true); rdft2d_sub(1, a); fillSymmetric(a); } else { mixedRadixRealForwardFull(a);
int nthreads = ConcurrencyUtils.getNumberOfThreads(); if ((nthreads > 1) && useThreads) { xdft2d0_subth2(1, -1, a, scale); cdft2d_subth(1, a, scale); rdft2d_sub(1, a); } else { for (int r = 0; r < rows; r++) { fftColumns.realInverse2(a[r], 0, scale); cdft2d_sub(1, a, scale); rdft2d_sub(1, a); fillSymmetric(a); } else { mixedRadixRealInverseFull(a, scale);
int nthreads = ConcurrencyUtils.getNumberOfThreads(); if ((nthreads > 1) && useThreads) { xdft2d0_subth1(1, 1, a, true); cdft2d_subth(-1, a, true); rdft2d_sub(1, a); } else { for (int r = 0; r < rows; r++) { fftColumns.realForward(a[r]); cdft2d_sub(-1, a, true); rdft2d_sub(1, a);
columns = 2 * columns; if ((nthreads > 1) && useThreads) { xdft2d0_subth1(0, -1, a, true); cdft2d_subth(-1, a, true); } else { for (int r = 0; r < rows; r++) { fftColumns.complexForward(a[r]); cdft2d_sub(-1, a, true);
/** * Computes the 2D inverse of the discrete Fourier transform (IDFT) of this * matrix. * * @param scale * if true then scaling is performed * */ public void ifft2(boolean scale) { int oldNthreads = ConcurrencyUtils.getNumberOfThreads(); ConcurrencyUtils.setNumberOfThreads(ConcurrencyUtils.nextPow2(oldNthreads)); if (fft2 == null) { fft2 = new FloatFFT_2D(rows, columns); } fft2.complexInverse(elements, scale); ConcurrencyUtils.setNumberOfThreads(oldNthreads); }
complexForward(a.getData()); } else { int nthreads = ConcurrencyUtils.getNumberOfThreads(); columnsl = 2 * columnsl; if ((nthreads > 1) && useThreads) { xdft2d0_subth1(0, -1, a, true); cdft2d_subth(-1, a, true); } else { for (int r = 0; r < rowsl; r++) { fftColumns.complexForward(a, r * columnsl); cdft2d_sub(-1, a, true);
complexInverse(a.getData(), scale); } else { int nthreads = ConcurrencyUtils.getNumberOfThreads(); columnsl = 2 * columnsl; if ((nthreads > 1) && useThreads) { xdft2d0_subth1(0, 1, a, scale); cdft2d_subth(1, a, scale); } else { fftColumns.complexInverse(a, r * columnsl, scale); cdft2d_sub(1, a, scale);
fft2 = new FloatFFT_2D(rows, columns); fft2.realInverseFull(elementsC, scale); ConcurrencyUtils.setNumberOfThreads(oldNthreads); return C;
ConcurrencyUtils.setNumberOfThreads(ConcurrencyUtils.nextPow2(oldNthreads)); if (fft2 == null) { fft2 = new FloatFFT_2D(rows, columns); fft2.realForward(elements); ConcurrencyUtils.setNumberOfThreads(oldNthreads);
ConcurrencyUtils.setNumberOfThreads(ConcurrencyUtils.nextPow2(oldNthreads)); if (fft2 == null) { fft2 = new FloatFFT_2D(rows, columns); fft2.realInverse(elements, scale); ConcurrencyUtils.setNumberOfThreads(oldNthreads);
public void run() { for (int s = firstSlice; s < lastSlice; s++) { fft2Slices.complexForward(elements[s]); } } });
public void run() { for (int s = firstSlice; s < lastSlice; s++) { for (int r = 0; r < rows; r++) { System.arraycopy(elements[s][r], 0, cElems[s][r], 0, columns); } fft2Slices.realForwardFull(cElems[s]); } } });
int nthreads = ConcurrencyUtils.getNumberOfThreads(); if ((nthreads > 1) && useThreads) { xdft2d0_subth1(1, 1, a, true); cdft2d_subth(-1, a, true); rdft2d_sub(1, a); } else { for (long r = 0; r < rowsl; r++) { fftColumns.realForward(a, r * columnsl); cdft2d_sub(-1, a, true); rdft2d_sub(1, a); fillSymmetric(a); } else { mixedRadixRealForwardFull(a);
int nthreads = ConcurrencyUtils.getNumberOfThreads(); if ((nthreads > 1) && useThreads) { xdft2d0_subth2(1, -1, a, scale); cdft2d_subth(1, a, scale); rdft2d_sub(1, a); } else { for (long r = 0; r < rowsl; r++) { fftColumns.realInverse2(a, r * columnsl, scale); cdft2d_sub(1, a, scale); rdft2d_sub(1, a); fillSymmetric(a); } else { mixedRadixRealInverseFull(a, scale);
int nthreads = ConcurrencyUtils.getNumberOfThreads(); if ((nthreads > 1) && useThreads) { xdft2d0_subth1(1, 1, a, true); cdft2d_subth(-1, a, true); rdft2d_sub(1, a); } else { for (int r = 0; r < rows; r++) { fftColumns.realForward(a, r * columns); cdft2d_sub(-1, a, true); rdft2d_sub(1, a);
columns = 2 * columns; if ((nthreads > 1) && useThreads) { xdft2d0_subth1(0, -1, a, true); cdft2d_subth(-1, a, true); } else { for (int r = 0; r < rows; r++) { fftColumns.complexForward(a[r]); cdft2d_sub(-1, a, true);
/** * Computes the 2D inverse of the discrete Fourier transform (IDFT) of this * matrix. * * @param scale * if true then scaling is performed * */ public void ifft2(boolean scale) { int oldNthreads = ConcurrencyUtils.getNumberOfThreads(); ConcurrencyUtils.setNumberOfThreads(ConcurrencyUtils.nextPow2(oldNthreads)); if (fft2 == null) { fft2 = new FloatFFT_2D(rows, columns); } if (isNoView == true) { fft2.complexInverse(elements, scale); } else { FComplexMatrix2D copy = this.copy(); fft2.complexInverse((float[]) copy.elements(), scale); this.assign((float[]) copy.elements()); } ConcurrencyUtils.setNumberOfThreads(oldNthreads); }