help-octave
[Top][All Lists]
Advanced

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

Re: zp2sos error: cplxpair: could not pair all complex numbers


From: Nicholas Jankowski
Subject: Re: zp2sos error: cplxpair: could not pair all complex numbers
Date: Thu, 5 Jan 2017 12:30:40 -0500

> If you can help identify what Matlab does in this situation, and what
> should be fixed and where, then maybe something can be done about it.

Running the same script in Matlab 2016b produces no errors and the
following output.
Note Octave output from cheby2 is a row vector, Matlab is a column. I
don't know if this matters. Matlab output follows. Octave 4.2.0,
signal pkg v.1.3.2 ouput shown below that.

-------------------------------------
Matlab 2016b

>> conf.stages=6;
>> conf.reject=40;
>> conf.fsamp=1000;
>> fpL=0.52915085925565918945068233369966;
>> fpH=491.55617297547132693580351769924;
>> [z,p,k]=cheby2(conf.stages,conf.reject,[fpL.*2 
>> ./conf.fsamp,fpH.*2./conf.fsamp])
z =
 -0.999905676503125 + 0.013734558486828i
 -0.999905676503125 - 0.013734558486828i
 -0.998687143937134 + 0.051224881988044i
 -0.998687143937134 - 0.051224881988044i
 -0.999296201278521 + 0.037511359750324i
 -0.999296201278521 - 0.037511359750324i
  0.999999629730721 + 0.000860545419704i
  0.999999629730721 - 0.000860545419704i
  0.999994843220577 + 0.003211468862567i
  0.999994843220577 - 0.003211468862567i
  0.999997236381365 + 0.002351006089707i
  0.999997236381365 - 0.002351006089707i
p =
 -0.983753121609877 + 0.071492541325641i
 -0.983753121609877 - 0.071492541325641i
 -0.961750098624975 + 0.051154896580545i
 -0.961750098624975 - 0.051154896580545i
 -0.949728425507133 + 0.018486078667500i
 -0.949728425507133 - 0.018486078667500i
  0.999127670635969 + 0.004543010951549i
  0.999127670635969 - 0.004543010951549i
  0.997640877892379 + 0.003321080212941i
  0.997640877892379 - 0.003321080212941i
  0.996785136655982 + 0.001214672037223i
  0.996785136655982 - 0.001214672037223i
k =
   0.896584733013338
>> [~, idx] = sort (real (z));
>> z = z(idx)
z =
 -0.999905676503125 + 0.013734558486828i
 -0.999905676503125 - 0.013734558486828i
 -0.999296201278521 + 0.037511359750324i
 -0.999296201278521 - 0.037511359750324i
 -0.998687143937134 + 0.051224881988044i
 -0.998687143937134 - 0.051224881988044i
  0.999994843220577 + 0.003211468862567i
  0.999994843220577 - 0.003211468862567i
  0.999997236381365 + 0.002351006089707i
  0.999997236381365 - 0.002351006089707i
  0.999999629730721 + 0.000860545419704i
  0.999999629730721 - 0.000860545419704i

--------------------------------------------------------------
Octave 4.2.0

>>pkg load signal
>> conf.stages=6;
>> conf.reject=40;
>> conf.fsamp=1000;
>> fpL=0.52915085925565918945068233369966;
>> fpH=491.55617297547132693580351769924;
>> [z,p,k]=cheby2(conf.stages,conf.reject,[fpL.*2 
>> ./conf.fsamp,fpH.*2./conf.fsamp]);
>> z'
ans =
  -0.998687143937134 - 0.051224881988043i
  -0.999296201278521 - 0.037511359750325i
  -0.999905676503125 - 0.013734558486826i
   0.999999629730722 - 0.000860545419713i
   0.999997236381364 - 0.002351006089708i
   0.999994843220576 - 0.003211468862565i
   0.999994843220576 + 0.003211468862565i
   0.999997236381364 + 0.002351006089708i
   0.999999629730722 + 0.000860545419685i
  -0.999905676503125 + 0.013734558486826i
  -0.999296201278521 + 0.037511359750325i
  -0.998687143937134 + 0.051224881988043i
>> p'
ans =
   0.999127670635973 - 0.004543010951549i
   0.997640877892371 - 0.003321080212942i
   0.996785136655987 - 0.001214672037224i
   0.996785136655987 + 0.001214672037222i
   0.997640877892375 + 0.003321080212938i
   0.999127670635973 + 0.004543010951549i
  -0.983753121609872 + 0.071492541325644i
  -0.961750098624987 + 0.051154896580549i
  -0.949728425507125 + 0.018486078667483i
  -0.949728425507125 - 0.018486078667483i
  -0.961750098624987 - 0.051154896580549i
  -0.983753121609872 - 0.071492541325644i
>> k
k =  0.896584733013339
>> [~, idx] = sort (real (z));
>> z = z(idx)'
z =
  -0.999905676503125 - 0.013734558486826i
  -0.999905676503125 + 0.013734558486826i
  -0.999296201278521 - 0.037511359750325i
  -0.999296201278521 + 0.037511359750325i
  -0.998687143937134 - 0.051224881988043i
  -0.998687143937134 + 0.051224881988043i
   0.999994843220576 - 0.003211468862565i
   0.999994843220576 + 0.003211468862565i
   0.999997236381364 - 0.002351006089708i
   0.999997236381364 + 0.002351006089708i
   0.999999629730722 - 0.000860545419713i
   0.999999629730722 + 0.000860545419685i



reply via email to

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