# [Scipy-svn] r4998 - trunk/scipy/signal

scipy-svn@scip... scipy-svn@scip...
Thu Nov 6 05:55:19 CST 2008

```Author: cdavid
Date: 2008-11-06 05:54:41 -0600 (Thu, 06 Nov 2008)
New Revision: 4998

Modified:
trunk/scipy/signal/filter_design.py
Log:

Modified: trunk/scipy/signal/filter_design.py
===================================================================
--- trunk/scipy/signal/filter_design.py	2008-11-06 11:54:13 UTC (rev 4997)
+++ trunk/scipy/signal/filter_design.py	2008-11-06 11:54:41 UTC (rev 4998)
@@ -2,6 +2,7 @@
"""

import types
+import warnings

import numpy
from numpy import atleast_1d, poly, polyval, roots, real, asarray, allclose, \
@@ -11,6 +12,8 @@
from scipy import special, optimize
from scipy.misc import comb

+    pass

abs = absolute

@@ -170,8 +173,11 @@
b = asarray([b],b.dtype.char)
while a[0] == 0.0 and len(a) > 1:
a = a[1:]
-    while allclose(b[:,0], 0, rtol=1e-14) and (b.shape[-1] > 1):
-        b = b[:,1:]
+    if allclose(b[:,0], 0, rtol=1e-14):
+        warnings.warn("Badly conditionned filter coefficients (numerator): the "
+                      "results may be meaningless", BadCoefficients)
+        while allclose(b[:,0], 0, rtol=1e-14) and (b.shape[-1] > 1):
+            b = b[:,1:]
if b.shape[0] == 1:
b = b[0]
outb = b * (1.0) / a[0]
@@ -1543,3 +1549,5 @@
m = numpy.arange(0,N)
h = win*special.sinc(cutoff*(m-alpha))
return h / numpy.sum(h,axis=0)
+