def _check_method(method, iir_params, extra_types):
"""Helper to parse method arguments"""
allowed_types = ['iir', 'fft'] + extra_types
if not isinstance(method, string_types):
raise TypeError('method must be a string')
if method not in allowed_types:
raise ValueError('method must be one of %s, not "%s"'
% (allowed_types, method))
if method == 'iir':
if iir_params is None:
iir_params = dict(order=4, ftype='butter')
if not isinstance(iir_params, dict):
raise ValueError('iir_params must be a dict')
elif iir_params is not None:
raise ValueError('iir_params must be None if method != "iir"')
method = method.lower()
return iir_params
filter.py 文件源码
python
阅读 25
收藏 0
点赞 0
评论 0
评论列表
文章目录