# Inverse Z-transform question.

1. Dec 26, 2013

### peripatein

Hello,

1. The problem statement, all variables and given/known data
I would like to find the inverse Z transform of the following:
F(z)=1-1.25z-1+0.25z-2/[1-(5/6)z-1+(1/6)z-2]
using (a) partial fractions, and (b) residue theorem
I have obtained different results and hence would appreciate some insight on the discrepancy and how it may be resolved.

3. The attempt at a solution
(a) Using partial fractions, I obtained the following:
F(z)=(3/2)[4z2-5z+1/(6z2-5z+1)] = (3/2)[10z/(z-1/3) - 2/(z-1/3) - 6z/(z-1/2)]=
=15z/(z-1/3) - 3/(z-1/3) - 9z/(z-1/2) = 6 + 2/(z-1/3) - (9/2)/(z-1/2)
⇔ f(n) = 6δ(n) + 2(1/3)n-1u(n-1) - (9/2)(1/2)n-1u(n-1) =
6δ(n) + [6(1/3)n - 9(1/2)n]u(n-1)
where u(n) is the step function and δ(n) is the dirac function.
(b) Using residue theorem, I obtained the following:
Residue for z=1/2 is -9, residue for z=1/3 is 6, hence:
f(n) = [-9(1/2)n + 6(1/3)n]u(n)

Where am I erring? I'd appreciate any comments.

Last edited: Dec 26, 2013
2. Dec 26, 2013

### Ray Vickson

What you have written (using standard parsing rules for reading mathematical expressions) is
$$F(z) = 1-1.25z^{-1}+\frac{0.25z^{-2}}{1-(5/6)z^{-1}+(1/6)z^{-2}}$$
Is that what you truly indended? If you mean
$$\frac{1-1.25z^{-1}+ 0.25z^{-2}}{1-(5/6)z^{-1}+(1/6)z^{-2}}$$
you need to use parentheses around the numerator, like this:
F(z)=[1-1.25z-1+0.25z-2]/[1-(5/6)z-1+(1/6)z-2]

Anyway, your partial-fraction expansion seems wrong; I (or, rather, Maple) get
$$F(z) = 1 - \frac{3}{2}\frac{1}{2z-1} - \frac{1}{3z-1}$$

3. Dec 26, 2013

### peripatein

How could my partial fraction expansion be wrong if upon multiplication I obtain the same F(Z) I started with?? I have just checked myself yet again, and the expansion is absolutely correct, hence:
F(Z)=(3/2)(4z^2-5z+1)/(6z^2-5z+1) = 6 + 2/(z-1/3) - (9/2)/(z-1/2)
I still don't understand why the results are seemingly different, using both methods. I would appreciate some insight on that.

4. Dec 26, 2013

### Staff: Mentor

This could not possibly be correct.
Here's why.
$$F(z) = \frac{6z^2 + \text{lower deg. terms}}{6z^2 + \text{lower deg. terms}} = 1 + \text{other rational expressions}$$

Notice that if you do the long division, the constant term is 1, not 6 as you show.

5. Dec 26, 2013

### peripatein

Okay, let's suppose you're right (even though I am still unable to figure out where my mistake is). Long division yields:
1 + 2/(z-1/3) - (9/2)/(z-1/2)
That still leaves me with f(n)=δ(n) + [6(1/3)n - 9(1/2)n]u(n-1) using partial fractions, vs. [6(1/3)n - 9(1/2)n]u(n) using residue theorem.
How would you settle this discrepancy?

6. Dec 26, 2013

### vela

Staff Emeritus
Can you expand on how you applied the residue theorem? I don't get what you did for n=0 when I use the residue theorem.

7. Dec 26, 2013

### Ray Vickson

Are δ(.) and u(.) defined so that δ(0) = 1 and δ(k) = 0 for k ≥ 1 and u(k) = 1 for k ≥ 0? If so, both results are the same for n ≥ 0; that is, there would be no discrepancy.

8. Dec 26, 2013

### peripatein

But for n=0:
δ(n) + [6(1/3)^n - 9(1/2)^n]u(n-1) = 1 (since u(-1)=0; u(n-1) only begins at n=1)
whereas
[6(1/3)^n - 9(1/2)^n]u(n) = -3
What am I missing?

9. Dec 26, 2013

### vela

Staff Emeritus
You're not applying the residue theorem correctly.

10. Dec 26, 2013

### peripatein

I am. The residue of z=0 is zero and contributes nothing to the sum.

11. Dec 26, 2013

### peripatein

The final result is pretty much that which yields Wolfram. However, I cannot account for the (seeming) discrepancy.
If you think I am not applying it correctly, could you please point out where it is I am faltering?

12. Dec 26, 2013

### vela

Staff Emeritus
I did. You're messing up somewhere. It's hard to be more specific when all you've done is post your answers and ask "what's wrong?" How are we supposed to figure out what you're doing if you don't show us?

All I can say is that when I looked at 2/(z-1/3) and used the complex integral to evaluate what the n=0 term should be, I got 0, not 6(1/3). That's why I'm saying you're not applying the residue method correctly. Maybe you're not using the right integrand.

13. Dec 26, 2013

### peripatein

Using residue theorem:
F(z)*z^(n-1) = z^n*[6z-(15/2)+(3/2)z^-1]/[(z-1/3)(z-1/2)]
Residue for z=1/2 is -9(1/2)^n, residue for z=1/3 is 6(1/3)^n, hence:
f(n) = [-9(1/2)^n + 6(1/3)^n]u(n)
Is that wrong?

14. Dec 26, 2013

### vela

Staff Emeritus
I'll assume your algebra is correct. When n=0, you still have a singularity at z=0, don't you?, because the numerator is undefined.

15. Dec 26, 2013

### vela

Staff Emeritus
By the way, I get the same partial fraction expansion that Ray posted above, and it doesn't agree with the results of your long division. So you still have other errors to find in your work.

16. Dec 26, 2013

### peripatein

The expansion is not as Ray wrote it, but rather:
1 + 1/(3z-1) - (3/2)/(2z-1)
I sincerely doubt this is wrong as have checked it over and over again. You may do so yourself.
Alright, now that yields f(n) = δ(n) + [(1/3)n - (3/2)(1/2)n]u(n-1)
Would you agree?
Next, concerning the residue theorem:
f(n)=sum of residues of [zn*(z2-(5/4)z+(1/4))]/[(z)(z-1/2)(z-1/3)]
Residue for z=1/2 : (-3/2)(1/2)n
Residue for z=1/3 : (1/3)n
Residue for z=0 : 0
Hence f(n) = [(1/3)n - (3/2)(1/2)n]u(n)

Here again there appears to be a discrepancy between f(n) = [(1/3)n - (3/2)(1/2)n]u(n) (via residue theorem) and δ(n) + [(1/3)n - (3/2)(1/2)n]u(n-1) (via partial fractions)

Why?

17. Dec 26, 2013

### vela

Staff Emeritus
Yeah, Ray made a small typo, but you wrote
I was pointing out this result wasn't correct, and it can't be explained away as a simple typo either.

You're not calculating the residue for z=0 correctly. Consider the cases n=0 and n≥1 separately.

By the way, you might want to use the partial fractions expansion when calculating the residues. It makes things a bit simpler in my opinion.

18. Dec 26, 2013

### peripatein

Alright, then please explain to me how to correctly calculate the residue for z=0.

19. Dec 26, 2013

### vela

Staff Emeritus
Did you bother trying what I suggested?

20. Dec 26, 2013

### peripatein

I am not sure I am supposed to make use of partial fractions here at all as I was asked to specifically solve it using residue theorem after having solved it using partial fractions.
I don't quite understand why z=0 poses a problem. I am interested in solving it correctly for that value so please try to explain to me how it might be attempted without using partial fractions.