z transform of a left handed sequence

15 visualizzazioni (ultimi 30 giorni)
Hello. I want to calculate z trnasform of the following sequence :
how can i do it without doing the math? The first part of sequence is easy I just need to subtract the elements of n=0 and n=1 from the but for the second part i need to use math and that's a bother to be honest. Is there a way to just calculate the z transform of a left handed sequence or a command for and ?
here's what I've got so far
clear; close; clc
syms n z
yp1 = ztrans((1/3)^n)
v = (1/3)^n * z^-n
yp2 = symsum(v,n,0,1)
Yp = yp1-yp2
YPs = simplify(Yp)
y1 = n*2^n*z^-n
v = symsum(y1,n,0,inf)
meq = simplifyFraction(children(v,1))
eqn = YPs + meq
  1 Commento
AlireaA Mirrabie
AlireaA Mirrabie il 11 Nov 2022
Hello and thank you for your answer. I've tried the heaviside command but heviside is defined as
but i want the u(t) as
is there a command for that? i tried sympref and other ways to make that 0.5 at t=0, 1 but it didn't work for z transform. For example look at the code below. I want to calculate the z transform of
syms a n
y = a^n*heaviside(-n-2)
y = 
ztrans(y)
ans = 
0
and I'm sure that, this answer is incorrect.

Accedi per commentare.

Risposta accettata

Paul
Paul il 13 Nov 2022
Modificato: Paul il 15 Nov 2022
Hi AlireaA
You are on the right track by breaking this problem into two parts. Let's look at the first part
syms n integer
syms z
yp1 = ztrans((1/3)^n)
yp1 = 
v = (1/3)^n * z^-n;
yp2 = symsum(v,n,0,1);
Yp = yp1-yp2
Yp = 
YPs = simplify(Yp)
YPs = 
That result is correct, and could also have been obtained as follows:
sympref('HeavisideAtOrigin',1);
u(n) = heaviside(n);
simplify(ztrans((1/3)^n*u(n-2)))
ans = 
We can use ztrans here because the sequence in question is zero for n < 0.
Also, it's very important to note that the Region of Convergence (ROC) for Yps is abs(z) > 1/3.
Now, moving onto the second component .... it looks like you're trying to use symsum to compute the z-transform explicitly. However, because the sequence is left-sided we need to use the bi-lateral z-transform (which I'm sure is the point of the exercise). Furthermore, because the sequence is zero for n > -1, we can take the sum from -inf to -1 (instead of -inf to inf),
y1 = n*2^n*z^-n; % no need to include u(-n-1) when summing from -inf to -1, because y1[n>=0] = 0
%v = symsum(y1,n,0,inf)
v = symsum(y1,n,-inf,-1)
v = 
The z-transform of this sequence only coverges over the ROC abs(z) < 2. Combined with result above, the ROC for the z-transform of the sum of the two sequences is
assume(1/3 < abs(z) < 2);
Recompute v with this assumption to get a compact form
v = simplify(symsum(y1,n,-inf,-1))
v = 
BTW, you could also have obtained this result from a standard, z-transform table.
Consequently, the z-transform of x[n] is
X(z) = YPs + v
X(z) = 
with ROC
assumptions(z)
ans = 
  1 Commento
AlireaA Mirrabie
AlireaA Mirrabie il 19 Nov 2022
Thank you Paul for your answer. That is exactly what I was looking for you're a life saver.

Accedi per commentare.

Più risposte (0)

Categorie

Scopri di più su Mathematics in Help Center e File Exchange

Prodotti

Community Treasure Hunt

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

Start Hunting!

Translated by