Deriving difference equation I have this block-diagram of Karplus-Strong basic algorithm.


Where $$H_{d}(z) = \frac{1+z^{-1}}{2}$$
The problem occurs when I try to get the difference equation. As I can see from the diagram, that would be
$$y(n) = x(n-N)+\frac{y(n)+y(n-1)}{2}$$
but I've found online this one(which I know how to implement in code, unlike the first one)$$y(n) = x(n)+\frac{y(n-N)+y(n-(N+1))}{2}$$
Are these two equation somehow equivalent?
Neither of the two equations match with the diagram. It's actually quite straightforward: at the input of the delay you have

$$x[n]+\frac12\big(y[n]+y[n-1]\big)\tag{1}$$

Then a delay of $N$ samples is applied to compute the output, hence

$$y[n]=x[n-N]+\frac12\big(y[n-N]+y[n-1-N]\big)\tag{2}$$

But here I've found a different diagram, which corresponds to the last equation in your question.