delta = Math.abs (refData[--i] - newData[i]) * 4;

that can't be right?