Search in sources :

Example 1 with Dft1d

use of imagingbook.pub.dft.Dft1d in project imagingbook-common by imagingbook.

the class Dft2d method doDft2d.

// ------------------------------------------------
public void doDft2d() {
    // in-place 2D Dft
    // do the rows:
    Complex[] row = makeComplexVector(width);
    Dft1d dftR = new Dft1d(width);
    for (int v = 0; v < height; v++) {
        getRow(v, row);
        Complex[] rowDft = dftR.DFT(row, forward);
        putRow(v, rowDft);
    }
    // do the columns:
    Complex[] col = makeComplexVector(height);
    Dft1d dftC = new Dft1d(height);
    for (int u = 0; u < width; u++) {
        getCol(u, col);
        Complex[] colDft = dftC.DFT(col, forward);
        putCol(u, colDft);
    }
}
Also used : Dft1d(imagingbook.pub.dft.Dft1d) Complex(imagingbook.lib.math.Complex)

Aggregations

Complex (imagingbook.lib.math.Complex)1 Dft1d (imagingbook.pub.dft.Dft1d)1