private static byte[] getMapping(int samples){
		int bitMaskLength = (int) (Math.pow(2.0,(double) samples));
		byte[] table = new byte[bitMaskLength];
		int j;
		int sampleBitMask = 0;
		for (int i = 0;i<samples;++i){
			sampleBitMask |= 1<<i;
		}

		int numt;
		for (int i = 0;i<bitMaskLength;++i){
			j = ((i<<1) & sampleBitMask); //j = bitset(bitshift(i,1,samples),1,bitget(i,samples)); %rotate left
			j = (i>>(samples-1)) >0 ? j | 1: j & ~1;	//Set first bit to one or zero
			numt = 0;
			for (int k = 0;k<samples;++k){
				numt+= (((i^j)>>k) & 1);
			}

			if (numt <= 2){
				for (int k = 0;k<samples;++k){
					table[i]+= (i>>k) & 1;
				}
			}else{
				table[i] = (byte) (samples+1);
			}
		}
		return table;
	}