public byte [] getPowerSpectrum(float[] BIJfht)
	{
   		float[] fps = new float[maxN*maxN];
		float min = Float.MAX_VALUE;
  		float max = Float.MIN_VALUE;
  		for (int row=0; row<maxN; row++)
		{
			fhtps(row, maxN, BIJfht, fps);
			int base = row * maxN;
			for (int col=0; col<maxN; col++)
			{
				float r = fps[base+col];
				if (r<min) min = r;
				if (r>max) max = r;
			}
		}
		flipquad(fps);
		if (min < 1.0)
			min = 0f;
		else
			min = (float)Math.log(min);
		max = (float)Math.log(max);
		float scale = (float)(253.0/(max-min));

 		byte [] ps = new byte[maxN*maxN];
		for (int row=0; row<maxN; row++)
		{
			int base = row*maxN;
			for (int col=0; col<maxN; col++)
			{
				float r = fps[base+col];
				if (r<1f)
					r = 0f;
				else
					r = (float)Math.log(r);
				ps[base+col] = (byte)(((r-min)*scale+0.5)+1);
			}
		}
		return ps;
	}