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: Mike Miller
Subject: Re: zp2sos error: cplxpair: could not pair all complex numbers
Date: Wed, 4 Jan 2017 23:58:59 -0800
User-agent: NeoMutt/20161126 (1.7.1)

On Wed, Jan 04, 2017 at 22:59:29 -0800, Mike Miller wrote:
> Here is the reason for the error
> 
>   >> [z, p, k] = cheby2 (6, 40, [fpL, fpH] .* 2 ./ 1000);
>   >> [~, 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
> 
> Now as you can see by the sorted pairs of zeros, the first 5 pairs are
> within tolerance of each other. The last pair is not (the imaginary
> values differ by about 2.8e-14), which is why the call to cplxpair
> fails.

This was simply looking into the stated problem and show that you can
use Octave's interpreter and debugging capabilities to see why the
function fails.

As a filtering problem, as was suggested in the earlier post you
referred to, you may be trying to construct a filter with too tight a
constraint. Approximating as

  cheby2 (6, 40, [.001, .983])

you are trying to design a bandpass filter that is incredibly close to
an all-pass filter, especially at the low end.

If what you want is a lowpass at 491.5 Hz, plus DC rejection, maybe
design a lowpass filter instead with

  cheby2 (6, 40, .983)

and cascade with a separate highpass filter for tight DC rejection?

Just suggestions, and all of this is not to say that there aren't still
possible bugs in any of the bilinear, cheby2, or cplxpair functions.

-- 
mike



reply via email to

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