pydsm.ir.guess_ir_length

pydsm.ir.guess_ir_length(h, db=80)

Tries to estimate an appropriate length for the filter response

Parameters:

h : tuple_like

the filter definition either in zpk or in nd form.

db : real, optional

a hint about how to guess the length where the impulse response should be truncated. This is defined on a log scale. The larger the longer the resulting length. Defaults to 80.

Returns:

m : int

a guess about the appropriate number of samples to represent the filter impulse response with the required accuracy

Notes

The guess is based on the slowlest pole of the filter, considering when its response is attenuated to -db. This can be by far too optimistic in some cases and particularly when there are overlapping or similar poles.

Do not try to use this function for filters with poles in 1.