I have a digital delayline code which looks like this:
poswrite = 1000; pos1 = 750; pos2 = 500; pos3 = 200; pos4 = 100; ... double input = ...; double feedback = buf[pos1]*a - buf[pos2]*b + buf[pos3]*c - buf[pos4]*d; pos1++; pos2++; pos3++; pos4++; buf[poswrite] = input + feedback; poswrite++;
(positions wrap back to 0 after achieving buffer's end).
I need to choose a, b, c, d coefficients so that the delayline remains lossless. This is a similar requirement in feedback delay networks. What is the best way to choose these coefficients based on the given "pos" values relative to the "poswrite" value?