# Filter difference equation and impulse response

I am having trouble specifying the transfer function of the following system as seen below: From the initial view I work out the difference equation to be:

$$y(n) = x(n) - p^Nx(n-N) +py(n-1)$$

However should the constant before y(n-1) be negative p according to the following standardised equation for a difference equation?

\begin{align} y(n)=b_0 x(n)+&b_1 x(n-1)+\cdots+b_M x(n-M)\\ -&a_1 y(n-1)-\cdots-a_N y(n-N) \end{align}

Furthermore I am trying to work out the impulse response and it is required that the first $N$ values ($n=0,1,2,\ldots,N-1$) of the impulse response of the filter are defined as: $$h(n) = p^2$$

I cannot get this to work from my current workings but feel it may be related to the first problem.

Thanks for taking the time to read my problem and any help would be greatly appreciated!

• You forgot an $x$ in your first equation. – Gilles Aug 14 '16 at 9:14
• Ahh my mistake, cheers! – Tricks Aug 14 '16 at 9:24
• For the $N$ values, is it $n=0,1,2,N-1$ or $n=0, 1, 2, \ldots, N-1$ ? – Gilles Aug 14 '16 at 9:34
• The latter, i'll alter my question now, sorry againnn. – Tricks Aug 14 '16 at 9:35
• No problem, it was just to be sure. ;) – Gilles Aug 14 '16 at 9:41

Your difference equation is correct. I'm not sure why you worry about signs because the signs of the coefficients $a_n$ are just a matter of definition. Just choose $\tilde{a}_n=-a_n$ and you have coefficients with a positive sign.

The impulse response of the system can be determined in a straightforward manner by making a table with entries for $n$ and $y[n]=h[n]$ (with input $x[n]=\delta[n]$):

$$\begin{array}{c|c} n & y[n]\\ \hline 0 & 1\\ 1 & p\\ 2 & p^2\\ \vdots & \vdots\\ N-1 & p^{N-1}\\ N & p^N-p^N=0\\ N+1 & 0\\ \vdots & \vdots \end{array}$$

Note that despite the recursion in the system, we have a finite impulse response (FIR), i.e., the system could also be realized without a recursion. The impulse response can be written as

$$h[n]=\begin{cases}p^n,&0\le n <N\\0,&\text{otherwise}\end{cases}$$

or, equivalently, as

$$h[n]=p^n(u[n]-u[n-N])$$

where $u[n]$ is the discrete-time unit step function.

• Thank you very much! For some reason when I was translating to my paper for working out I wasn't using the z^-N. Which negates that term for the impulse response? – Tricks Aug 14 '16 at 10:20
• @Tricks: I'm sorry but I don't understand your question. Which term are you talking about? – Matt L. Aug 14 '16 at 11:03
• @Gilles: Thanks for the edit, this looks much better now! – Matt L. Aug 14 '16 at 11:38
• @MattL. , you're welcome. And excellent answer as always ! – Gilles Aug 14 '16 at 11:42