bugGNU Octave - Bugs: bug #44930, signal package: zplane shows...

 
 

bug #44930: signal package: zplane shows non-existent poles and zeros

Submitter:  None
Submitted:  Sun 26 Apr 2015 02:40:47 PM UTC
   
 
Category:  Octave Package Severity:  2 - Minor
Priority:  5 - Normal Item Group:  Matlab Compatibility
Status:  Invalid / Not an Octave Bug Assigned to:  None
Originator Name:  Robert Jenssen Originator Email:  -email is unavailable-
Open/Closed:  * Closed Release:  * other
Operating System:  * Any Fixed Release:  None
Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Mon 27 Apr 2015 04:48:06 PM UTC, comment #5: 

Doug is correct, and it does belong in the zplane function because that it what the function is intended to do. It is used to show the poles and zeros of a filter when the arguments are row vectors.

I think you are expecting that the vectors of coefficients you pass to the zplane function are for positive powers of z. If that were the case, you would be right. But


zplane ([1, 2, 3])


is not working on the polynomial H(z) = z^2 + 2z + 3, it is the polynomial H(z) = 1 + 2z^-1 + 3z^-2.

If you want to plot only zeros with no poles, you will have to calculate the zeros yourself with the roots function and pass the column vector of zeros to zplane. Sorry if you find that wrong, but that is the documented interface of the zplane function.

Mike Miller <mtmiller>
Group Member
Mon 27 Apr 2015 01:09:51 AM UTC, comment #4: 

OK, but IMHO you should put all this Laplace conversion stuff in your function that converts from s-plane to z-plane. It doesn't belong in the zplane() function.

Anonymous
Mon 27 Apr 2015 12:49:10 AM UTC, comment #3: 

No it is not incorrect.


If we start with Laplace space and draw a root Locus we see that the poles move to zeros. And if there are not enough zeroes then the extra poles move out radially to Infinity. ( I am giving you the short version of my lectures) so we can say that there are zeroes out at infinity that these poles are moving to.

Now when we move all this to the Z plane then we can show that infinity in Laplace space maps to zero in Z Space. So now all the missing zeroes in laplace space show up in Z space. 

Of course we can make Z space filters that are not realizable in Laplace space.
So what is correct or incorrect is relative to what the objective is.

The padding is actually making the zeroes from infinity, show up at the origin.


Just my 2C worth.

Doug Stewart <dastew>
Sun 26 Apr 2015 11:29:58 PM UTC, comment #2: 

No, I'm afraid I don't have Matlab. Using a default denominator of 1 is fine; roots([1]) returns []. My criticism is that zplane pads the zero or pole column vectors with 0, implying poles or zeros  at z=0 that are not in the input polynomial.

This is not a Matlab compatibility bug. It is an incorrect result.

Anonymous
Sun 26 Apr 2015 03:31:27 PM UTC, comment #1: 

Thanks for your bug report. Do you have access to Matlab to test this for compatibility? What does Matlab display for an empty denominator argument? Since it is intended to be used with filter coefficients, an implied denominator of 1 makes sense as it behaves now.

As a workaround, you can do what you want with:


zplane (roots ([1, 2, 3]));


Mike Miller <mtmiller>
Group Member
Sun 26 Apr 2015 02:40:47 PM UTC, original submission:  

zplane() is a pole/zero plotter from the signal-1.3.1 package. I sometimes want to plot the zeros of a single polynomial, not a transfer function. For example, zplane([1 2 3]) plots a pole at the origin implying a factor of 1/(z^(-1)-0). The example of a transfer function, H(z), is incorrect. The two transfer functions shown on the right of the "="s are not equal. They differ by a power of z^(-1).

Also the "N-M" or "M-N" triggers the "Octave:neg-dim-as-zero" warning.

Here is a diff showing my proposed change to the Octave code in signal/zplane.m:



$diff -U 3 /usr/local/share/octave/packages/signal-1.3.1/zplane.m zplane.m

--- /usr/local/share/octave/packages/signal-1.3.1/zplane.m        2015-04-25 13:43:13.250880797 +1000
+++ zplane.m        2015-04-27 00:13:59.679500075 +1000
@@ -70,10 +70,8 @@
       if isempty(z), z=1; endif
       if isempty(p), p=1; endif

-      M = length(z) - 1;
-      N = length(p) - 1;
-      z = [ roots(z); zeros(N - M, 1) ];
-      p = [ roots(p); zeros(M - N, 1) ];
+      z=roots(z);
+      p=roots(p);
     endif
   endif


Anonymous

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by dastew (Posted a comment)
  • -email is unavailable- added by mtmiller (Posted a comment)
  • -email is unavailable- added by None (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only group members can vote.

     

    Follow 8 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2015-04-27 mtmiller Open/ClosedOpen Closed
    2015-04-27 mtmiller StatusNeed Info Invalid / Not an Octave Bug
    2015-04-26 mtmiller Severity3 - Normal 2 - Minor
        Item GroupIncorrect Result Matlab Compatibility
        StatusNone Need Info
        Release4.0.0-rc3 other
        Operating SystemGNU/Linux Any
        Summarysignal/zplane.m shows non-existent poles and zeros signal package: zplane shows non-existent poles and zeros

    Back to the top

    Powered by Savane 3.13-758e.
    Corresponding source code