How am I supposed to implement this part of the LMS algorithm?

19 Views Asked by At

Say I have a $1000$ point data set time series u and I'm trying to implement the least mean squares filter on it for some d(n): https://en.wikipedia.org/wiki/Least_mean_squares_filter (Specifically referring to the LMS algorithm summary section)

If the algorithm says to calculate $\textbf{u[n]} = [u[n], u[n-1], ..., u[n-p+1]] \text{ for each } n = 0, 1, ...$

How am I supposed to handle this? Do I wrap around in the cases where $n-k < 0$ (as in $x[-1]$ = $x[$last point$]$), or do I set them all to 0?