- heaviside(x) returns the value 0 for x < 0, 1 for x > 0, and 1/2 for x = 0.
can any one tell me how to find z transform of unit step??
27 views (last 30 days)
Show older comments
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
0 Comments
Accepted Answer
Star Strider
on 22 Oct 2014
The Heaviside function is defined.
From the documentation:
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
Paul
on 25 Apr 2023
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.
More Answers (1)
Azzi Abdelmalek
on 22 Oct 2014
Edited: Azzi Abdelmalek
on 22 Oct 2014
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
Ced
on 22 Oct 2014
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.
See Also
Categories
Find more on Mathematical Functions in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!