octave-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #57359] [octave forge] (signal) residuez gives


From: Hg200
Subject: [Octave-bug-tracker] [bug #57359] [octave forge] (signal) residuez gives an incorrect result for [1 1 1.5 .5], [1 1.5 .5]
Date: Sun, 18 Sep 2022 20:23:54 -0400 (EDT)

Follow-up Comment #6, bug #57359 (project octave):

Coming back to the original example from the OP. It's solution is

++
H(z) = (1+z^-1+1.5*z^-2+0.5*z^-3)/(1+1.5*z^-1+0.5*z^-2)
     = -1/(1-(-0.5)*z^-1) + 2/(1-(-1)*z^-1) + 0+1*z^-1
--

Therefore, the result from the residuez.m function must be either

++
r=[-1,2] and p=[-0.5,-1]

or

r=[2,-1] and p=[-1,-0.5]
--

Both expressions are correct because you can swap the fractions while the
result remains the same:

++
[-1/(1-(-0.5)*z^-1)] + [2/(1-(-1)*z^-1)] = [2/(1-(-1)*z^-1)] +
[-1/(1-(-0.5)*z^-1)]
--

What's wrong is the k (or f) argument, because the polynomial part in the PFE
is

++
0+1*z^-1

and not

1+0*z^-1
--

In Matlab the k part is expressed as k(1)+k(2)*z^-1+.... Therefore the correct
answer is [0,1] and not [1,0]. The reason why this is happening is explained
in comment #2.

In the patch i have removed the if statement because fliplr([]) is IMO already
a valid Octave statement.



    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?57359>

_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]