function filter(N, c) {
        var c_b, Re, Im, b;
        c_b = Math.floor(c * N);
        Re = new Float64Array(N);
        Im = new Float64Array(N);
        var i, j;
        for (i = 0; i < c_b; i++) {
            Re[i] = 1;
        }
        for (i = N - c_b + 1; i < N; i++) {
            Re[i] = 1;
        }
        inverseTransform(Re, Im);
        // Scale and shift into Im
        for (i = 0; i < N; i++) {
            j = (i + (N >> 1)) % N;
            Im[i] = Re[j] / N;
            // Apply compute blackman-harris to Im
            var rad = (Math.PI * i) / (N);
            Im[i] *= 0.35875 - 0.48829 * Math.cos(2 * rad) + 0.14128 * Math.cos(4 * rad) - 0.01168 * Math.cos(6 * rad);
        }
        return Im;
    }
// n is the desired filter order, n==1024 if undefined
n is the desired filter order, n==1024 if undefined
n is the desired filter order n == 1024 if undefined
function filter(N, c) {
        var c_b, Re, Im, b;
        c_b = Math.floor(c * N);
        Re = new Float64Array(N);
        Im = new Float64Array(N);
        var i, j;
        for (i = 0; i < c_b; i++) {
            Re[i] = 1;
        }
        for (i = N - c_b + 1; i < N; i++) {
            Re[i] = 1;
        }
        inverseTransform(Re, Im);
        for (i = 0; i < N; i++) {
            j = (i + (N >> 1)) % N;
            Im[i] = Re[j] / N;
            var rad = (Math.PI * i) / (N);
            Im[i] *= 0.35875 - 0.48829 * Math.cos(2 * rad) + 0.14128 * Math.cos(4 * rad) - 0.01168 * Math.cos(6 * rad);
        }
        return Im;
    }
function filter ( N , c ) { var c_b , Re , Im , b ; c_b = Math . floor ( c * N ) ; Re = new Float64Array ( N ) ; Im = new Float64Array ( N ) ; var i , j ; for ( i = 0 ; i < c_b ; i ++ ) { Re [ i ] = 1 ; } for ( i = N - c_b + 1 ; i < N ; i ++ ) { Re [ i ] = 1 ; } inverseTransform ( Re , Im ) ; for ( i = 0 ; i < N ; i ++ ) { j = ( i + ( N >> 1 ) ) % N ; Im [ i ] = Re [ j ] / N ; var rad = ( Math . PI * i ) / ( N ) ; Im [ i ] *= 0.35875 - 0.48829 * Math . cos ( 2 * rad ) + 0.14128 * Math . cos ( 4 * rad ) - 0.01168 * Math . cos ( 6 * rad ) ; } return Im ; }
n is the desired filter order, n==1024 if undefined
n is the desired filter order n == 1024 if undefined
// Scale and shift into Im // Apply compute blackman-harris to Im