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

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

[Octave-bug-tracker] [bug #40155] signal package: zp2sos return value is


From: Mike Miller
Subject: [Octave-bug-tracker] [bug #40155] signal package: zp2sos return value is not compatible with Matlab
Date: Wed, 09 Oct 2013 03:32:01 +0000
User-agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/29.0.1547.57 Safari/537.36

Update of bug #40155 (project octave):

                  Status:               Need Info => Confirmed              
                 Summary: Octave does not produce same results as Matlab for
iir scripts => signal package: zp2sos return value is not compatible with
Matlab

    _______________________________________________________

Follow-up Comment #5:

I had someone run the following in Matlab:


N=7;
Wn=.4;
res='low';
[a,b]=butter(N,Wn,res)
[z,p,k]=butter(N,Wn,res)
sos=zp2sos(z,p,k)
[sos,g]=zp2sos(z,p,k)


Here are the results. As I suspected, the return value of zp2sos depends on
the number of output arguments. If the caller does not request the gain as a
separate value, it is incorporated into the sos array.


a =

    0.0048    0.0339    0.1017    0.1695    0.1695    0.1017    0.0339   
0.0048

b =

    1.0000   -1.3893    1.6750   -1.0539    0.5086   -0.1448    0.0263  
-0.0020

z =

    -1
    -1
    -1
    -1
    -1
    -1
    -1

p =

   0.2550 + 0.7653i
   0.2550 - 0.7653i
   0.1664 + 0.2222i
   0.1664 - 0.2222i
   0.1940 + 0.4668i
   0.1940 - 0.4668i
   0.1584          

k =

    0.0048

sos =

    0.0048    0.0048         0    1.0000   -0.1584         0
    1.0000    2.0000    1.0000    1.0000   -0.3328    0.0771
    1.0000    2.0000    1.0000    1.0000   -0.3880    0.2555
    1.0000    2.0000    1.0000    1.0000   -0.5101    0.6507

sos =

    1.0000    1.0000         0    1.0000   -0.1584         0
    1.0000    2.0000    1.0000    1.0000   -0.3328    0.0771
    1.0000    2.0000    1.0000    1.0000   -0.3880    0.2555
    1.0000    2.0000    1.0000    1.0000   -0.5101    0.6507

g =

    0.0048


    _______________________________________________________

Reply to this item at:

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

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




reply via email to

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