void smbFft(float[] fftBuffer, int fftFrameSize, int sign)
	/* 
		FFT routine, (C)1996 S.M.Bernsee. Sign = -1 is FFT, 1 is iFFT (inverse)
		Fills fftBuffer[0...2*fftFrameSize-1] with the Fourier transform of the
		time domain data in fftBuffer[0...2*fftFrameSize-1]. The FFT array takes
		and returns the cosine and sine parts in an interleaved manner, ie.
		fftBuffer[0] = cosPart[0], fftBuffer[1] = sinPart[0], asf. fftFrameSize
		must be a power of 2. It expects a complex input signal (see footnote 2),
		ie. when working with 'common' audio signals our input signal has to be
		passed as {in[0],0.,in[1],0.,in[2],0.,...} asf. In that case, the transform
		of the frequencies of interest is in fftBuffer[0...fftFrameSize].
	 */
	{
		float wr, wi, arg, temp;
		float tr, ti, ur, ui;
		int i, bitm, j, le, le2, k;

		int p1, p2, p1r, p1i, p2r, p2i;

		for (i = 2; i < 2*fftFrameSize-2; i += 2) {
			for (bitm = 2, j = 0; bitm < 2*fftFrameSize; bitm <<= 1) {
				if ((i & bitm)!=0) j++;
				j <<= 1;
			}
			if (i < j) {
				//p1 = fftBuffer+i;
				p1=i;
				//p2 = fftBuffer+j;
				p2=j;
				//temp = *p1;
				temp = fftBuffer[p1];
				//*(p1++) = *p2;
				fftBuffer[p1++]=fftBuffer[p2];
				//*(p2++) = temp;
				fftBuffer[p2++] = temp;
				//temp = *p1;
				temp = fftBuffer[p1];
				//*p1 = *p2;
				fftBuffer[p1]=fftBuffer[p2];
				//*p2 = temp;
				fftBuffer[p2]=temp;
			}
		}
		for (k = 0, le = 2; k < (long)(Math.log(fftFrameSize)/Math.log(2.)+.5); k++) {
			le <<= 1;
			le2 = le>>1;
			ur = 1.0f;
			ui = 0.0f;
			arg = (float) (M_PI / (le2>>1));
			wr = (float) Math.cos(arg);
			wi = (float) (sign*Math.sin(arg));
			for (j = 0; j < le2; j += 2) {
				//p1r = fftBuffer+j;
				p1r = j;
				p1i = p1r+1;
				p2r = p1r+le2;
				p2i = p2r+1;
				for (i = j; i < 2*fftFrameSize; i += le) {
					tr = fftBuffer[p2r] * ur - fftBuffer[p2i] * ui;
					ti = fftBuffer[p2r] * ui + fftBuffer[p2i] * ur;
					fftBuffer[p2r] = fftBuffer[p1r] - tr;
					fftBuffer[p2i] = fftBuffer[p1i] - ti;
					fftBuffer[p1r] += tr;
					fftBuffer[p1i] += ti;
					p1r += le; p1i += le;
					p2r += le; p2i += le;
				}
				tr = ur*wr - ui*wi;
				ui = ur*wi + ui*wr;
				ur = tr;
			}
		}
	}