# Finding lossless coefficients to multi-tap feedback delayline

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?

• Define "lossless", mathematically. Maybe that already answers your question... – Marcus Müller Apr 4 '17 at 14:39
• Lossless as in feedback delay networks. It means that when sample impulse is inputted the output of this system stays stable, without loss and without raise of energy. Same as in feedback delay networks. I have no experience to define this mathematically myself. – aleksv Apr 4 '17 at 14:48
• That definition wasn't all that bad! so, assume your pulse is now at let's say pos2 in the buffer. that means there's a 1 at that position and 0 elsewhere, right? So, what's the output value (input+feedback) then? you can directly read that from your code! – Marcus Müller Apr 4 '17 at 14:57
• It's not that simple. It's an LTI system - it progresses and if after inputting 1 you continue to input 0, the output will not be simple. I've probably missed from the description that positions wrap back to 0 after reaching buffer's end. – aleksv Apr 4 '17 at 15:03