I have the discrete integration filters:
$$y(n) = Ax(n) + By(n−p) , \text{$A$, $B$ real constants, $p$ positive integer}$$
EDIT: in the initial version of this question I focussed only on the case $A=B=p=1$
I want to apply it on an array representing an impulse signal [1, 0, 0, 0, 0, 0]
(assuming $x(n) = y(n) = 0$ for every $n < 0$)
In the imperative style, using Python, I would write:
>>> x = [0]*5
>>> y = [0]*5
>>> impulse = [1]+[0]*5
>>> for i in impulse:
... x += [i]
... y += [i+y[-1]]
...
>>> x
[0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0]
>>> y
[0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1]
How can I obtain the same result with Mathematica? I saw the FoldList and MovingMap functions that had some potential to solve similar problems. But they seem to work only on one list, and I wasn't able to make them use both the $x$ and $y$ lists at the same time.