From: dh on
Hi Nasser,
Mathematica calculates the unilateral Z transfrom. This is clearly zero in your
case. But in your case you may get the bilateral by setting n -> -n in f:

f = (-(1/2)^(-n))*UnitStep[n - 1];
ZTransform[f, n, z]

Daniel

On 10.03.2010 07:45, Nasser M. Abbasi wrote:
> Hello;
>
> I am trying to find the Z transform using Mathematica for the signal
>
> (-(1/2)^n)*UnitStep[-n - 1];
>
> This signal runs backward, from n=-1 to - infinity. It is not stable. But
> for |z|<1/2, the Z transform converges and can be found to be
> 1/(1- 0.5 z^-1)
>
> Which is what I was hoping Mathematica to return, but it returns back zero !
>
> In[32]:= Clear[f, n, z]
>
> f = (-(1/2)^n)*UnitStep[-n - 1];
> ZTransform[f, n, z]
>
> Out[34]= 0
>
> I did the derivation by hand, and here is a link. I do not think I made a
> mistake myself in the hand derivation? but was hoping to use Mathematica to
> verify it. but not sure how to let Mathematica return back the same answer
> as I have.
>
> http://12000.org/tmp/030910/ztran.htm
>
> Am I missing something here? do I need to use some assumptions for
> Ztransform? did not have to when causal signals?
>
> --Nasser
>
>
>


--

Daniel Huber
Metrohm Ltd.
Oberdorfstr. 68
CH-9100 Herisau
Tel. +41 71 353 8585, Fax +41 71 353 8907
E-Mail:<mailto:dh(a)metrohm.com>
Internet:<http://www.metrohm.com>


From: dh on
Hi Nasser,
the result from Mathematica is:
-(2/(-2 + z))
The inverse z transform of this:
-2^n UnitStep[-1 + n]
now you can write this as:
- (1/2)^(-n) UnitStep[n-1]
what is consistent with where we started.

However, if we back transform your "hand" result, we get:
(-(1/2))^n Binomial[-1, n]
what does not look like your initial expression.
Daniel


On 10.03.2010 20:07, Nasser M. Abbasi wrote:
>>> On 10.03.2010 07:45, Nasser M. Abbasi wrote:
>>>
>>> I am trying to find the Z transform using Mathematica for the signal
>>>
>>> (-(1/2)^n)*UnitStep[-n - 1];
>>>
>
>
>> Hi Nasser,
>> Mathematica calculates the unilateral Z transfrom. This is clearly zero in
>> your case. But in your case you may get the bilateral by setting n ->
>> -n in f:
>>
>> f = (-(1/2)^(-n))*UnitStep[n - 1];
>> ZTransform[f, n, z]
>>
>> Daniel
>>
>
>
> I had a second look at the above solution, but the result obtained still
> does not match my hand calculation actually, Here is the output from the
> above code:
>
> -(2/(-2 + z))
>
> Which can be rewritten as
>
> 1
> -------------
> 1- 1/2 z
>
> In addition, when using GenerateConditions -> True option, I get that |z|>2
>
> *But* the result I should get is
>
> 1
> -------------
> 1- 1/2 z^-1
>
> With |z|<1/2. Notice the z^-1 vs z in the denominator.
>
> so, more tweaking is needed I think. getting close, but Just changing
> the "n" from +n to "-n" did not seem to do the trick?
>
> I need to look more into this. But at least now I know what the correct
> definition of Ztransform used by Mathematica is. All of this could have
> been avoided if the Ztransform was defined to be 2-sided. Now each time
> I have a left sided signal, I have to play tricks to feed it to the
> Ztransform. Also, If I have 2 sided signal, I have to break it up and
> play more tricks, which can lead to errors.
>
> --Nasser
>
>
>
>


--
Daniel Huber
Metrohm AG
International Headquarters
Oberdorfstr. 68, CH-9101 Herisau / Switzerland
Phone +41 71 353 8606, Fax +41 71 353 89 01
Mail <mailto:dh(a)metrohm.com>
Web <http://www.metrohm.com



From: dh on
Hi Nasser,
I think xou are right about change of ROC. The original Z transpose with
n=0..-Infinity converges for small z. On the other hand by setting
n->-n, the series with n=0..Infinity converges for large z. Therefore we
change the ROC.
Second attempt: To get the original transform we go back to the roots
and may use "Sum":

Sum[(-(1/2)^n) z^-n, {n, -1, -Infinity, -1}]

Daniel


On 11.03.2010 11:06, Nasser M. Abbasi wrote:
>
> ----- Original Message ----- From: "dh" <dh(a)metrohm.com>
>
>
>> Hi Nasser,
>> the result from Mathematica is:
>> -(2/(-2 + z))
>> The inverse z transform of this:
>> -2^n UnitStep[-1 + n]
>> now you can write this as:
>> - (1/2)^(-n) UnitStep[n-1]
>> what is consistent with where we started.
>>
>
> Hello Daniel;
>
> Well, yes, ofcourse. But the point is what you started with an
> expression which is _not_ the Z transform result I should get from my
> original expression, which is
>
> -(1/2)^n)*UnitStep[-n - 1];
>
>> However, if we back transform your "hand" result, we get:
>> (-(1/2))^n Binomial[-1, n]
>> what does not look like your initial expression.
>> Daniel
>>
>
> My hand calculations shows that the Z transform of -(1/2)^n)*UnitStep[-n
> - 1] is 1/(1- 0.5 z^-1), with ROC of |z|<1/2, this is correct. (unless
> you show me where I made an error).
>
> So, The inverse Z transform of 1/(1- 0.5 z^-1) has to come back as what
> I started with. BUT one must use the ROC |z|<1/2.
>
> A ztransform is not unique without giving the ROC. i.e. 2 same
> Ztransform, but with different ROC, can give back different sequences.
> Becuase for example, and right sided sequence can give the same Z
> transform as a left sided sequence (one will stable and the other not).
> So when doing inverese Z transform, how does it know which one to return
> back if it did not know the ROC?
>
> So, Mathematica result you showed above, saying the InverseZ of my
> sequence is (-(1/2))^n Binomial[-1, n] must be for ROC |z|>1/2 (i.e.
> causal and stable) and not |z|<1/2, which is not what I had.
>
> I do not know how to tell InvserZtransform that the ROC is |z|<1/2, I
> tried this:
>
> InverseZTransform[1/(1-0.5 z^-1),z,n,Assumptions->Abs[z]<1/2]
>
> but result did not change to what I expected.
>
> --Nasser
>
>>
>> On 10.03.2010 20:07, Nasser M. Abbasi wrote:
>>>>> On 10.03.2010 07:45, Nasser M. Abbasi wrote:
>>>>>
>>>>> I am trying to find the Z transform using Mathematica for the signal
>>>>>
>>>>> (-(1/2)^n)*UnitStep[-n - 1];
>>>>>
>>>
>>>
>>>> Hi Nasser,
>>>> Mathematica calculates the unilateral Z transfrom. This is clearly zero in
>>>> your case. But in your case you may get the bilateral by setting n ->
>>>> -n in f:
>>>>
>>>> f = (-(1/2)^(-n))*UnitStep[n - 1];
>>>> ZTransform[f, n, z]
>>>>
>>>> Daniel
>>>>
>>>
>>>
>>> I had a second look at the above solution, but the result obtained still
>>> does not match my hand calculation actually, Here is the output from the
>>> above code:
>>>
>>> -(2/(-2 + z))
>>>
>>> Which can be rewritten as
>>>
>>> 1
>>> -------------
>>> 1- 1/2 z
>>>
>>> In addition, when using GenerateConditions -> True option, I get that
>>> |z|>2
>>>
>>> *But* the result I should get is
>>>
>>> 1
>>> -------------
>>> 1- 1/2 z^-1
>>>
>>> With |z|<1/2. Notice the z^-1 vs z in the denominator.
>>>
>>> so, more tweaking is needed I think. getting close, but Just changing
>>> the "n" from +n to "-n" did not seem to do the trick?
>>>
>>> I need to look more into this. But at least now I know what the correct
>>> definition of Ztransform used by Mathematica is. All of this could have
>>> been avoided if the Ztransform was defined to be 2-sided. Now each time
>>> I have a left sided signal, I have to play tricks to feed it to the
>>> Ztransform. Also, If I have 2 sided signal, I have to break it up and
>>> play more tricks, which can lead to errors.
>>>
>>> --Nasser
>>>
>>>
>>>
>>>
>>
>>
>> --
>> Daniel Huber
>> Metrohm AG
>> International Headquarters
>> Oberdorfstr. 68, CH-9101 Herisau / Switzerland
>> Phone +41 71 353 8606, Fax +41 71 353 89 01
>> Mail <mailto:dh(a)metrohm.com>
>> Web <http://www.metrohm.com
>>
>>
>
>
>
>


--
Daniel Huber
Metrohm AG
International Headquarters
Oberdorfstr. 68, CH-9101 Herisau / Switzerland
Phone +41 71 353 8606, Fax +41 71 353 89 01
Mail <mailto:dh(a)metrohm.com>
Web <http://www.metrohm.com