public Waveform doFft() { FloatFFT_1D fft = new FloatFFT_1D(length); fft.realForwardFull(buffer); return this; }
public void run() { if (icr == 0) { if (isgn == -1) { for (int r = n0; r < rows; r += nthreads) { fftColumns.complexForward(a[r]); } } else { for (int r = n0; r < rows; r += nthreads) { fftColumns.complexInverse(a[r], scale); } } } else if (isgn == 1) { for (int r = n0; r < rows; r += nthreads) { fftColumns.realForward(a[r]); } } else { for (int r = n0; r < rows; r += nthreads) { fftColumns.realInverse(a[r], scale); } } } });
public void run() { for (int s = firstSlice; s < lastSlice; s++) { for (int r = 0; r < rows; r++) { fftColumns.realInverseFull(a[s][r], scale); } } } });
public Waveform doIfft() { FloatFFT_1D fft = new FloatFFT_1D(length); fft.complexInverse(buffer, true); return this; }
public void run() { if (icr == 0) { if (isgn == -1) { for (long r = n0; r < rowsl; r += nthreads) { fftColumns.complexForward(a, r * columnsl); } } else { for (long r = n0; r < rowsl; r += nthreads) { fftColumns.complexInverse(a, r * columnsl, scale); } } } else if (isgn == 1) { for (long r = n0; r < rowsl; r += nthreads) { fftColumns.realForward(a, r * columnsl); } } else { for (long r = n0; r < rowsl; r += nthreads) { fftColumns.realInverse2(a, r * columnsl, scale); } } } });
FloatFFT_1D mFFT = new FloatFFT_1D(FFT_SIZE); //this is a jTransforms type mFFT.realForward(audioBuffer); mFFT.realInverse(audioBuffer, false);
System.out.println("Complex forward FFT 1D of size " + sizes1D[i]); if (doWarmup) { // call the transform twice to warm up FloatFFT_1D fft = new FloatFFT_1D(sizes1D[i]); x = new float[(int) (2 * sizes1D[i])]; IOUtils.fillMatrix_1D(2 * sizes1D[i], x); fft.complexForward(x); IOUtils.fillMatrix_1D(2 * sizes1D[i], x); fft.complexForward(x); FloatFFT_1D fft = new FloatFFT_1D(sizes1D[i]); times_with_constructor[i] = (System.nanoTime() - elapsedTime) / 1000000.0; x = new float[(int) (2 * sizes1D[i])]; IOUtils.fillMatrix_1D(2 * sizes1D[i], x); elapsedTime = System.nanoTime(); fft.complexForward(x); elapsedTime = System.nanoTime() - elapsedTime; if (elapsedTime < min_time) {
ConcurrencyUtils.setNumberOfThreads(ConcurrencyUtils.nextPow2(oldNthreads)); if (fft == null) { fft = new FloatFFT_1D(size); fft.realForward(elements); } else { FloatMatrix1D copy = this.copy(); fft.realForward((float[]) copy.elements()); this.assign((float[]) copy.elements());
public void run() { for (long i = firstRow; i < lastRow; i++) { fftColumns.realForward(a, i * columnsl); } } });
/** * Creates new instance of FloatDHT_1D. * * @param n * size of data */ public FloatDHT_1D(long n) { this.n = (int) n; this.nl = n; this.useLargeArrays = (CommonUtils.isUseLargeArrays() || n > LargeArray.getMaxSizeOf32bitArray()); fft = new FloatFFT_1D(n); }
public void run() { for (int s = firstSlice; s < lastSlice; s++) { for (int r = 0; r < rows; r++) { fftColumns.realForwardFull(a[s][r]); } } } });
public void run() { for (int s = firstSlice; s < lastSlice; s++) { for (int r = 0; r < rows; r++) { fftColumns.complexInverse(a[s][r], scale); } } } });
/** * Computes the inverse of the discrete Fourier transform (DFT) of this * matrix. The physical layout of the input data has to be as follows: * * <pre> * this[2*k] = Re[k], 0<=k<size/2 * this[2*k+1] = Im[k], 0<k<size/2 * this[1] = Re[size/2] * </pre> * * This method computes only half of the elements of the real transform. The * other half satisfies the symmetry condition. If you want the full real * inverse transform, use <code>getIfft</code>. * */ public void ifft(boolean scale) { int oldNthreads = ConcurrencyUtils.getNumberOfThreads(); ConcurrencyUtils.setNumberOfThreads(ConcurrencyUtils.nextPow2(oldNthreads)); if (fft == null) { fft = new FloatFFT_1D(size); } if (isNoView) { fft.realInverse(elements, scale); } else { FloatMatrix1D copy = this.copy(); fft.realInverse((float[]) copy.elements(), scale); this.assign((float[]) copy.elements()); } ConcurrencyUtils.setNumberOfThreads(oldNthreads); }
/** * Returns new complex matrix which is the inverse of the discrete Fourier * (IDFT) transform of this matrix. * * @return the inverse of the discrete Fourier transform (IDFT) of this * matrix. */ public DenseFComplexMatrix1D getIfft(boolean scale) { int oldNthreads = ConcurrencyUtils.getNumberOfThreads(); ConcurrencyUtils.setNumberOfThreads(ConcurrencyUtils.nextPow2(oldNthreads)); final float[] elems; if (isNoView == true) { elems = elements; } else { elems = (float[]) this.copy().elements(); } DenseFComplexMatrix1D c = new DenseFComplexMatrix1D(size); final float[] elementsC = (c).elements(); System.arraycopy(elems, 0, elementsC, 0, size); if (fft == null) { fft = new FloatFFT_1D(size); } fft.realInverseFull(elementsC, scale); ConcurrencyUtils.setNumberOfThreads(oldNthreads); return c; }
realInverse(a, 0, scale);
public void run() { for (int r = firstRow; r < lastRow; r++) { fftColumns.complexForward(a[r]); } } });
public void run() { if (icr == 0) { if (isgn == -1) { for (int r = n0; r < rows; r += nthreads) { fftColumns.complexForward(a, r * columns); } } else { for (int r = n0; r < rows; r += nthreads) { fftColumns.complexInverse(a, r * columns, scale); } } } else if (isgn == 1) { for (int r = n0; r < rows; r += nthreads) { fftColumns.realForward(a, r * columns); } } else { for (int r = n0; r < rows; r += nthreads) { fftColumns.realInverse2(a, r * columns, scale); } } } });
/** * Computes the discrete Fourier transform (DFT) of this matrix. Throws * IllegalArgumentException if the size of this matrix is not a power of 2 * number. */ public void fft() { int oldNthreads = ConcurrencyUtils.getNumberOfThreads(); ConcurrencyUtils.setNumberOfThreads(ConcurrencyUtils.nextPow2(oldNthreads)); if (fft == null) { fft = new FloatFFT_1D(size); } if (isNoView) { fft.complexForward(elements); } else { FComplexMatrix1D copy = this.copy(); fft.complexForward((float[]) copy.elements()); this.assign((float[]) copy.elements()); } ConcurrencyUtils.setNumberOfThreads(oldNthreads); }
/** * Computes the inverse of the discrete Fourier transform (IDFT) of this * matrix. Throws IllegalArgumentException if the size of this matrix is not * a power of 2 number. * * @param scale * if true, then scaling is performed. */ public void ifft(boolean scale) { int oldNthreads = ConcurrencyUtils.getNumberOfThreads(); ConcurrencyUtils.setNumberOfThreads(ConcurrencyUtils.nextPow2(oldNthreads)); if (fft == null) { fft = new FloatFFT_1D(size); } if (isNoView) { fft.complexInverse(elements, scale); } else { FComplexMatrix1D copy = this.copy(); fft.complexInverse((float[]) copy.elements(), scale); this.assign((float[]) copy.elements()); } ConcurrencyUtils.setNumberOfThreads(oldNthreads); }
public void run() { for (int i = firstRow; i < lastRow; i++) { fftColumns.realForward(a[i]); } } });