signal.normalize's BadCoefficients warning is too scary #7345
Labels
maintenance
Items related to regular maintenance tasks
scipy.signal
task
A straightforward change, verification or fix.
It's easy to design digital filters with leading zeros and turn them into LTI objects. For example:
This raises the warning:
BadCoefficients: Badly conditioned filter coefficients (numerator): the results may be meaningless
I feel this is somewhat overstated, since any FIR filter designed by
firwin
with a window that goes to zero at the ends (as many of the do) will have a leading zero, yet will do fine as a filter.This can show up even just from calls to
signal.decimate
. One can get this warning from running:This has led colleagues of mine to believe that something inside the
decimate
function is fundamentally broken.I propose we tone done the warning message, just letting the user know that some elements were trimmed.
firwin
could maybe also be edited to use something likewin[1:-1]
, which would avoid raising a warning altogether.The text was updated successfully, but these errors were encountered: