can any one tell me how to find z transform of unit step??

i have tried but ans isn't correct... like a=heaviside(n) ztrans(a) ans =
1/(z - 1) + 1/2
why 1/2 ???? plz help me out

 Accepted Answer

The Heaviside function is defined.
From the documentation:
  • heaviside(x) returns the value 0 for x < 0, 1 for x > 0, and 1/2 for x = 0.
So these commands:
syms z
zth0 = ztrans(heaviside(sym(0)))
zth1 = ztrans(heaviside(sym(1)))
return:
zt0 =
z/(2*(z - 1))
zt1 =
z/(z - 1)
(in R2014b)

10 Comments

what if i want to calculate ztransform of u(n-2)??
For:
syms n
zunm2 = ztrans(heaviside(n-2))
the result:
zunm2 =
(1/(z - 1) + 1/2)/z^2
Thank you... but still that isn't for the answer of u(n-2) that must be (z/(z-1) + 1/2)/z^2 that was the confusion actually.....
what if i have heaviside(-n-1)? how can i use sym(1) in this case?
Do the experiment —
syms n
zunm2 = ztrans(heaviside(-n-1))
zunm2 = 
0
the heaviside funciton does not exist for .
.
when i calculate it manually the answer is different than 0, how can i always get the same result using matlab and table( or using formula)?
The MATLAB calculation is correct, for the reason I stated.
What is your manual result? You may want to search this forum for other questions about finding the z-transform of a left-sided sequence, or post a new Question if you can't find what you're looking for.

Sign in to comment.

More Answers (1)

That depends on how the function heaviside is defined. In Matlab heaviside is defined as
f[n]=0 if n<0
f(0)=1/2
f(n)=1 if n>0
In your case, your function is maybe defined as
f(n)=0 if n<0
f(n)=1 if n>=0
what you need to do is
syms n
a=heaviside(n)+0.5*kroneckerDelta(n)
out=ztrans(a)

3 Comments

what is kronecker delta ???? iztrans(1/z) ans= kroneckerDelta(n - 1, 0) will you explain that ??
The kronecker delta in this form is a function which has
kroneckerDelta(n) = 1 for n = 0
kroneckerDelta(n) = 0 for all other n
Since the problem is that heaviside is 0.5 at n = 0 instead of 1, Azzi Abdelmalek adds 0.5*kroneckerDelta(n), which is only nonzero at n = 0, and therefore "fixes" heaviside.

Sign in to comment.

Categories

Tags

No tags entered yet.

Asked:

on 22 Oct 2014

Commented:

on 25 Apr 2023

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!