Implementing Z-Transform of -a^n*heaviside(-n-1)

9 visualizaciones (últimos 30 días)
Gennaro Arguzzi
Gennaro Arguzzi el 28 de Jul. de 2017
Respondida: Paul el 29 de Dic. de 2024
Hello everyone, is it possible to implement a code that carries out the Z-Transform of an anticausal sequence like this -a^n*heaviside(-n-1)?
The code:
close all
clear all
syms a n z
assume(a > 0)
assumeAlso(a < 1)
assumeAlso(a < z)
S = symsum((-a/z)^n*heaviside(-n-1), n, -Inf, Inf);
S = simplify(S, 'Steps',20)
but it does not work. The solution is z/(z-a).
Thank you for your time.

Respuestas (1)

Paul
Paul el 29 de Dic. de 2024
syms a n z
Assume is an integer for clarity
assume(n,'integer');
To get the expected result, we have to ensure the correct value of heaviside at n = 0
sympref('HeavisideAtOrigin',1);
These assumptions ensures 0 < a < 1, which is fine, but shouldn't be necessary to obtain the expected result
%assume(a > 0)
%assumeAlso(a < 1)
This assumption is incorrect. The region of convergence of the z-transform of a non-causal signal extends inwards from the abs of the smallest pole.
%assumeAlso(a < z)
assumeAlso(abs(z) < abs(a))
The expected result only follows if the function is -(a^n)*heaviside(-n-1).
%S = symsum((-a/z)^n*heaviside(-n-1), n, -Inf, Inf);
S = symsum(-(a/z)^n*heaviside(-n-1), n, -Inf, Inf)
S = 
This result can be simplified, but still can't find a closed form expression for some reason.
S = simplify(S)
S = 
However, if we get rid of the heaviside and write the sum over only the non-zero terms, we get
S = symsum(-(a/z)^n,n,-inf,-1)
S = 
which is the expected result noting that the limit is zero. Unclear why the limit isn't known to be zero based on the assumptions and unclear why including the heaviside from the outset caused a problem. I think there was another thread that showed that limit doesn't always respect assumptions.
assumptions
ans = 
We could also get the expected result directly using ztrans along with relevant properties of the z-transform to account for ztrans only applying to causal signals.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by