private void createWeightFft(int numFftPoints, boolean invert) {
        
    	// weightFFT will have numberFftPoints/2 complex elements.
        this.weightFft = new double[numFftPoints];

        // For the inverse FFT, w = 2 * PI / numberFftPoints;
        double w = -2.0 * Math.PI / numFftPoints;
        if (invert) {
            w = -w;
        }

        for (int k = 0; k < (numFftPoints >> 1); k++) {
            this.weightFft[2 * k] = Math.cos(w * k);
            this.weightFft[2 * k + 1] = Math.sin(w * k);
        }
    }