Update Delay in DSP

Discussion in 'Embedded Systems and Microcontrollers' started by gary1wang, Mar 4, 2012.

  1. gary1wang

    Thread Starter Member

    Sep 18, 2008
    Hi guys

    I am new in DSP programming, I do not understand update delay in the code below. It is in the FIR filter.

    for (i = N-1; i > 0; i--)
    d = d[i-1]; //update delays with data move

    how the delay is implemented and what usage
  2. guitarguy12387

    Active Member

    Apr 10, 2008
    This is implementing your delay line/buffer. Presumably you shift in new data first, then shift everything down, every sample. You'll then loop over the delay line with your coefficients for the MAC operations.

    FYI, use a circular buffer with pointers instead. This implementation, while it will work for lower order filters, is very inefficient and wastes many clock cycles.