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

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

[Octave-bug-tracker] [bug #49989] cheby2 row vector instead of col vecto


From: Nicholas Jankowski
Subject: [Octave-bug-tracker] [bug #49989] cheby2 row vector instead of col vector output (matlab compatibility)
Date: Thu, 5 Jan 2017 18:06:54 +0000 (UTC)
User-agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:50.0) Gecko/20100101 Firefox/50.0

URL:
  <http://savannah.gnu.org/bugs/?49989>

                 Summary: cheby2 row vector instead of col vector output
(matlab compatibility)
                 Project: GNU Octave
            Submitted by: nrjank
            Submitted on: Thu 05 Jan 2017 06:06:53 PM GMT
                Category: Octave Forge Package
                Severity: 3 - Normal
                Priority: 5 - Normal
              Item Group: Matlab Compatibility
                  Status: None
             Assigned to: None
         Originator Name: Nicholas Jankowski
        Originator Email: 
             Open/Closed: Open
         Discussion Lock: Any
                 Release: 4.2.0
        Operating System: Any

    _______________________________________________________

Details:

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.





    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?49989>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

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