src/FFTUtils.js
function convolute2DI(ftSignal, ftFilter, ftRows, ftCols) {
    var re, im;
    for (var iRow = 0; iRow < ftRows / 2; iRow++) {
        for (var iCol = 0; iCol < ftCols; iCol++) {
            //
            re = ftSignal[(iRow * 2) * ftCols + iCol]
                * ftFilter[(iRow * 2) * ftCols + iCol]
                - ftSignal[(iRow * 2 + 1) * ftCols + iCol]
                * ftFilter[(iRow * 2 + 1) * ftCols + iCol];
            im = ftSignal[(iRow * 2) * ftCols + iCol]
                * ftFilter[(iRow * 2 + 1) * ftCols + iCol]
                + ftSignal[(iRow * 2 + 1) * ftCols + iCol]
                * ftFilter[(iRow * 2) * ftCols + iCol];
            //
            ftSignal[(iRow * 2) * ftCols + iCol] = re;
            ftSignal[(iRow * 2 + 1) * ftCols + iCol] = im;
        }
    }
}
function convolute2DI(ftSignal, ftFilter, ftRows, ftCols) {
    var re, im;
    for (var iRow = 0; iRow < ftRows / 2; iRow++) {
        for (var iCol = 0; iCol < ftCols; iCol++) {
            //
            re = ftSignal[(iRow * 2) * ftCols + iCol]
                * ftFilter[(iRow * 2) * ftCols + iCol]
                - ftSignal[(iRow * 2 + 1) * ftCols + iCol]
                * ftFilter[(iRow * 2 + 1) * ftCols + iCol];
            im = ftSignal[(iRow * 2) * ftCols + iCol]
                * ftFilter[(iRow * 2 + 1) * ftCols + iCol]
                + ftSignal[(iRow * 2 + 1) * ftCols + iCol]
                * ftFilter[(iRow * 2) * ftCols + iCol];
            //
            ftSignal[(iRow * 2) * ftCols + iCol] = re;
            ftSignal[(iRow * 2 + 1) * ftCols + iCol] = im;
        }
    }
}
function convolute2DI ( ftSignal , ftFilter , ftRows , ftCols ) { var re , im ; for ( var iRow = 0 ; iRow < ftRows / 2 ; iRow ++ ) { for ( var iCol = 0 ; iCol < ftCols ; iCol ++ ) { // re = ftSignal [ ( iRow * 2 ) * ftCols + iCol ] * ftFilter [ ( iRow * 2 ) * ftCols + iCol ] - ftSignal [ ( iRow * 2 + 1 ) * ftCols + iCol ] * ftFilter [ ( iRow * 2 + 1 ) * ftCols + iCol ] ; im = ftSignal [ ( iRow * 2 ) * ftCols + iCol ] * ftFilter [ ( iRow * 2 + 1 ) * ftCols + iCol ] + ftSignal [ ( iRow * 2 + 1 ) * ftCols + iCol ] * ftFilter [ ( iRow * 2 ) * ftCols + iCol ] ; // ftSignal [ ( iRow * 2 ) * ftCols + iCol ] = re ; ftSignal [ ( iRow * 2 + 1 ) * ftCols + iCol ] = im ; } } }
In place version of convolute 2D

@param ftSignal
@param ftFilter
@param ftRows
@param ftCols
@return
In place version of convolute 2D