I am trying to make a variable time delay as part of a much larger system. I need
y(k)=u(k-d)
where d is a control integer variable,u is the input and y is the output. I tried putting a WHILE loop within a FOR loop but have problems. Any suggestions?
Many thanks but I figured out a way that works. What I do is convolve the array to be delayed (by any variable delay) by another array [1 0 0 0 0 0 0 0] where this is changed to [0 1 0 0 0 0 0 0] for 2 step delay [0 0 1 0 0 0 0 0] and so on!