# What is the transfer function of this block diagram

I and my friend have different answer for this block diagram

Mine: $$y[n] = -\frac23x[n] + x[n-1] -\frac12[n-2]$$

Hence

$$H(z) = \frac{1}{-\frac23 + z^{-1} -\frac12z^{-2}}$$

My friend: $$q[n]=x[n]-\frac12q[n-1]$$ $$y[n] = -\frac23x[n]+q[n-1]$$ $$Y(z) = \frac23X(z)+z^{-1}Q(z)=\frac23X(z)+z^{-1}\frac{X(z)}{1+\frac12z^{-1}}$$

Hence

$$H(z)=\frac{Y(z)}{X(z)}=\frac23+\frac{z^{-1}}{1+\frac12z^{-1}} = \frac{4z^{-1}+2}{3+\frac32z^{-1}}$$

I don't know how can he come to that result but I'm not sure about mine either

• Your formula does not make sense, please correct it (what is $\frac12 [n-2]$?) How can there be a term $n-2$ if you only have one delay element? Furthermore, your difference equation doesn't match your transfer function. Commented Dec 18, 2015 at 8:19

As pointed out in the other answers, your friend's approach is correct. However, his end result for $H(z)$ isn't.

With $q[n]$ the input signal of the delay element, you get $q[n-1]$ at its output, and the given difference equation for $q[n]$ follows easily. The output $y[n]$ can then be written in terms of $x[n]$ and $q[n-1]$. In the $\mathcal{Z}$-transform domain you get algebraic equations in terms of $X(z)$, $Q(z)$, and $Y(z)$, from which you can eliminate $Q(z)$, leaving you with an expression for $H(z)=Y(z)/X(z)$:

$$H(z)=\frac{Y(z)}{X(z)}=-\frac23+\frac{z^{-1}}{1+\frac12 z^{-1}}=-\frac23\frac{1-z^{-1}}{1+\frac12 z^{-1}}\tag{1}$$

So it was basically just a sign error that messed up the end result.

Your friend is correct. You have a feedback loop inside the block diagram so you need to introduce another state variable q[n], which in this case is the signal right after the first summing mode. You could also choose the one after the delay block but the result would be the same.

Aukxn: Your friend represented the output of the first adder as $q[n]$ and then he wrote his $q[n]$ and $y[n]$ equations. The center part of his $Y(z)$ equation is the z-transform of his $y[n]$ equation. In that center part he has a $Q(z)$ term. He replaced that $Q(z)$ term with the z-transform of his $q[n]$ equation in order to produce the right side of his $Y(z)$ equation. Next he wrote $H(z)=\frac{Y(z)}{X(z)}$ as the sum of two ratios. Finally he put the numerators of the two ratios over a common denominator to produce the right side of his $H(z)$ equation. I'm willing to bet a pint of pale ale that your friend's $H(z)$ expression is correct.

• Would you like to pay via PayPal? $$H(z)=-\frac23\frac{1-z^{-1}}{1+\frac12 z^{-1}}$$ Commented Dec 18, 2015 at 13:57
• Ah, yes. Friend dropped a minus sign in his Y(z) equation. Good catch Matt L. The score is now Lyons 2, Matt L. 1. Commented Dec 19, 2015 at 9:45
• Does your score count the number of errors? Where is mine? Commented Dec 20, 2015 at 19:31