bugGNU Octave - Bugs: bug #49989, cheby2 row vector instead of col...

 
 

bug #49989: cheby2 row vector instead of col vector output (matlab compatibility)

Submitted by:  Nicholas Jankowski <nrjank>
Submitted on:  Thu 05 Jan 2017 06:06:53 PM UTC  
 
Category:  Octave Forge Package Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Matlab Compatibility
Status:  Duplicate Assigned to:  None
Originator Name:  Nicholas Jankowski Open/Closed:  Closed
Release:  4.2.0 Operating System:  Any

Add a New Comment (Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Thu 05 Jan 2017 06:29:22 PM UTC, comment #1: 

Closing as a duplicate of bug #49318.

Yes, this is more than cosmetic, since certain Matlab functions are written to take either zeros/poles or numerator/denominator vectors, and the only difference is the orientation of the vectors.

Mike Miller <mtmiller>
Project Administrator
Thu 05 Jan 2017 06:06:53 PM UTC, original submission:  

a rather minor point discovered while looking into other issues with the cheby2 output, but in Matlab 2016b the output for the three parameter outputs from cheby2 are a column vectors, not row vectors.  see below:

Octave 4.2.0 with signal package 1.3.2 produces a row vector for both 2 and 3 output forms (col vector shown for easier display):

>> [B,A] = cheby2 (6, 40, [.529, 491] ./ 500);
>> B',A'
ans =
  8.90541716849785e-001
  -4.25665492382555e-003
  -5.33467290744681e+000
  1.27494736456810e-002
  1.33238571650098e+001
  -8.49283328956992e-003
  -1.77594519196901e+001
  -8.49283328957783e-003
  1.33238571650098e+001
  1.27494736456818e-002
  -5.33467290744681e+000
  -4.25665492382585e-003
  8.90541716849786e-001
ans =
    1.000000000000000
   -0.210723363038901
   -5.736976149830144
    0.993069856933727
   13.750880097196202
   -1.875521271354126
  -17.622691144507598
    1.774180136499473
   12.733794662040827
   -0.840544043983077
   -4.918069100804973
    0.159535771399183
    0.793064549449763

>> [z, p, k] = cheby2 (6, 40, [.529, 491] ./ 500);
>> z',p',k
ans =
  -0.998508536714621 - 0.054595806689042i
  -0.999200417981141 - 0.039981554575987i
  -0.999892834857655 - 0.014639631153939i
   0.999999629939819 - 0.000860302403063i
   0.999997237948947 - 0.002350339225981i
   0.999994846158521 - 0.003210553908087i
   0.999994846158521 + 0.003210553908087i
   0.999997237948947 + 0.002350339225988i
   0.999999629939819 + 0.000860302403063i
  -0.999892834857655 + 0.014639631153939i
  -0.999200417981141 + 0.039981554575987i
  -0.998508536714621 + 0.054595806689042i
ans =
   0.999127933531105 - 0.004541708147102i
   0.997641561439144 - 0.003320150100321i
   0.996786037682028 - 0.001214339758741i
   0.996786037682028 + 0.001214339758741i
   0.997641561439140 + 0.003320150100324i
   0.999127933531105 + 0.004541708147102i
  -0.982512668323050 + 0.076121922741012i
  -0.959189288744979 + 0.054388983584852i
  -0.946491894064797 + 0.019639416902708i
  -0.946491894064797 - 0.019639416902708i
  -0.959189288744978 - 0.054388983584852i
  -0.982512668323050 - 0.076121922741012i
k =  0.890541716849785

Matlab 2016b output:

>> [B,A] = cheby2 (6, 40, [.529, 491] ./ 500);
>> B',A'
ans =
   0.890541716849784
  -0.004256654923828
  -5.334672907446804
   0.012749473645703
  13.323857165009775
  -0.008492833289568
-17.759451919690147
  -0.008492833289548
  13.323857165009830
   0.012749473645662
  -5.334672907446820
  -0.004256654923823
   0.890541716849788
ans =
   1.000000000000000
  -0.210723363038894
  -5.736976149830150
   0.993069856933699
  13.750880097196170
  -1.875521271354099
-17.622691144507659
   1.774180136499390
  12.733794662040875
  -0.840544043983065
  -4.918069100804970
   0.159535771399179
   0.793064549449764

>> [z,p,k] = cheby2 (6, 40, [.529, 491] ./ 500)
z =
-0.999892834857654 + 0.014639631153937i
-0.999892834857654 - 0.014639631153937i
-0.998508536714622 + 0.054595806689042i
-0.998508536714622 - 0.054595806689042i
-0.999200417981141 + 0.039981554575986i
-0.999200417981141 - 0.039981554575986i
  0.999999629939820 + 0.000860302403068i
  0.999999629939820 - 0.000860302403068i
  0.999994846158522 + 0.003210553908087i
  0.999994846158522 - 0.003210553908087i
  0.999997237948947 + 0.002350339225985i
  0.999997237948947 - 0.002350339225985i
p =
-0.982512668323059 + 0.076121922741010i
-0.982512668323059 - 0.076121922741010i
-0.959189288744962 + 0.054388983584849i
-0.959189288744962 - 0.054388983584849i
-0.946491894064806 + 0.019639416902724i
-0.946491894064806 - 0.019639416902724i
  0.999127933531107 + 0.004541708147103i
  0.999127933531107 - 0.004541708147103i
  0.997641561439139 + 0.003320150100321i
  0.997641561439139 - 0.003320150100321i
  0.996786037682028 + 0.001214339758742i
  0.996786037682028 - 0.001214339758742i
k =
   0.890541716849784

while many functions in the signal package seem to be fine with either a row or column vector, it would seem there may be cases where code compatibility is impacted by the difference.

Nicholas Jankowski <nrjank>

 

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

Attach Files:
   
   
Comment:
   

No files currently attached

 

Digest:
   bug dependencies.

Items that depend on this one: None found

 

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

    Do you think this task is very important?
    If so, you can add your encouragement to it.
    This task has 0 encouragements so far.

    Only project members can vote.

     

     

     

    Follow 4 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2017-01-05 mtmiller StatusNone => Duplicate
        Open/ClosedOpen => Closed
        Dependencies- => Depends on bugs #49318
    2017-01-05 nrjank Carbon-Copy- => Added mtmiller

    Back to the top


    Powered by Savane 3.5