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

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

[Octave-bug-tracker] [bug #49996] signal package: cheby2 produces zeros


From: Mike Miller
Subject: [Octave-bug-tracker] [bug #49996] signal package: cheby2 produces zeros that are not quite complex conjugate pairs
Date: Tue, 10 Jan 2017 20:28:21 +0000 (UTC)
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:50.0) Gecko/20100101 Firefox/50.0

Follow-up Comment #10, bug #49996 (project octave):

For those looking to fix this and with no access to Matlab (like me), or if
you want a working implementation to derive code from, SciPy has free
implementations of the same filter design functions, so both the outputs and
the algorithms themselves can be analyzed and compared.


>>> from pprint import pprint
>>> from scipy.signal import cheby2
>>> a = cheby2 (6, 40, [.001, .983], btype='bandpass', output='zpk')
>>> (z, p, k) = (list(a[0]), list(a[1]), a[2])
>>>
>>> pprint (z)
[(-0.99866962186808894-0.051565360057387599j),
 (-0.99928680643819134-0.037760806116408051j),
 (-0.99990441719062173-0.013825935146777633j),
 (-0.99990441719062173+0.013825935146777633j),
 (-0.99928680643819134+0.037760806116408051j),
 (-0.99866962186808894+0.051565360057387599j),
 (0.99999539574401186+0.0030345495179681286j),
 (0.99999753249436207+0.0022214871566177065j),
 (0.99999966940456275+0.0008131363754524236j),
 (0.99999966940456275-0.0008131363754524236j),
 (0.99999753249436207-0.0022214871566177065j),
 (0.99999539574401186-0.0030345495179681286j)]
>>>
>>> pprint (p)
[(0.99917623666441646+0.0042929489610568049j),
 (0.99777097697199735+0.0031385196512288016j),
 (0.99696202281637791+0.0011479500050488025j),
 (0.99696202281637791-0.0011479500050488025j),
 (0.99777097697199735-0.0031385196512288016j),
 (0.99917623666441646-0.0042929489610568049j),
 (-0.98362861112405386-0.071960682314650762j),
 (-0.96149154708651674-0.051482086995079612j),
 (-0.94940131856521048-0.018602747339922173j),
 (-0.94940131856521048+0.018602747339922173j),
 (-0.96149154708651674+0.051482086995079612j),
 (-0.98362861112405386+0.071960682314650762j)]
>>>
>>> k
0.89629009720530994


    _______________________________________________________

Reply to this item at:

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

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




reply via email to

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