public final void processFFT(double pitchShift, double[] gFFTworksp)
	{
		int k, qpd, index;
		double real, imag, magn, phase, tmp;
		
		double[] gAnaMagn = this.gAnaMagn;
		double[] gAnaFreq = this.gAnaFreq;
		double[] gSynMagn = this.gSynMagn;
		double[] gSynFreq = this.gSynFreq;				
		
		/* this is the analysis step */
		for (k = 0; k <= fftFrameSize2; k++) {
			
			/* de-interlace FFT buffer */
			real = gFFTworksp[2*k];
			imag = gFFTworksp[2*k+1];
			
			/* compute magnitude and phase */
			magn = 2.*Math.sqrt(real*real + imag*imag);
			phase = Math.atan2(imag,real);
			
			/* compute phase difference */
			tmp = phase - gLastPhase[k];
			gLastPhase[k] = phase;
			
			/* subtract expected phase difference */
			tmp -= (double)k*expct;
			
			/* map delta phase into +/- Pi interval */
			qpd = (int)(tmp/M_PI);
			if (qpd >= 0) qpd += qpd&1;
			else qpd -= qpd&1;
			tmp -= M_PI*(double)qpd;
			
			/* get deviation from bin frequency from the +/- Pi interval */
			tmp = osamp*tmp/(2.*M_PI);
			
			/* compute the k-th partials' true frequency */
			tmp = (double)k*freqPerBin + tmp*freqPerBin;
			
			/* store magnitude and true frequency in analysis arrays */
			gAnaMagn[k] = magn;
			gAnaFreq[k] = tmp;
			
		}
		
		
		/* ***************** PROCESSING ******************* */
		/* this does the actual pitch shifting */
		Arrays.fill(gSynMagn, 0);
		Arrays.fill(gSynFreq, 0);
		//int fftFrameSize2_1 = fftFrameSize2 - 1; 
		for (k = 0; k <= fftFrameSize2; k++) {
			index = (int)(k/pitchShift);
			//double scale = k/pitchShift - index;
			if (index <= fftFrameSize2) {
				//if (index <= fftFrameSize2_1) {
				gSynMagn[k] += gAnaMagn[index];
				//gSynMagn[k] += gAnaMagn[index]*(1-scale) + gAnaMagn[index]*scale;
				gSynFreq[k] = gAnaFreq[index] * pitchShift;
			}
		}
		
		/* ***************** SYNTHESIS ******************* */
		/* this is the synthesis step */
		for (k = 0; k <= fftFrameSize2; k++) {
			
			/* get magnitude and true frequency from synthesis arrays */
			magn = gSynMagn[k];
			tmp = gSynFreq[k];
			
			/* subtract bin mid frequency */
			tmp -= (double)k*freqPerBin;
			
			/* get bin deviation from freq deviation */
			tmp /= freqPerBin;
			
			/* take osamp into account */
			tmp = 2.*M_PI*tmp/osamp;
			
			/* add the overlap phase advance back in */
			tmp += (double)k*expct;
			
			/* accumulate delta phase to get bin phase */
			gSumPhase[k] += tmp;
			phase = gSumPhase[k];
			
			/* get real and imag part and re-interleave */
			gFFTworksp[2*k] = magn*Math.cos(phase);
			gFFTworksp[2*k+1] = magn*Math.sin(phase); 
			/*			
			 long s_index = ((long)(phase*ffactor)) % table_len;
			 if(s_index < 0) s_index += table_len;
			 
			 gFFTworksp[2*k] = magn*costable[(int)s_index];
			 gFFTworksp[2*k] = magn*sintable[(int)s_index];				  	
			 */
		} 
		
		
		
	}