def _speccheck(self, filt=None, dcomplex=None, filtorder=None, cycle=None,
width=None):
"""Check spectral parameters."""
# Check the filter name :
if filt is not None:
if filt not in ['fir1', 'butter', 'bessel']:
raise ValueError("filt must either be 'fir1', 'butter' or "
"'bessel'")
else:
self._filt = filt
# Check cycle :
if cycle is not None:
cycle = np.asarray(cycle)
if (len(cycle) is not 2) or not cycle.dtype == int:
raise ValueError("Cycle must be a tuple of two integers.")
else:
self._cycle = cycle
# Check complex decomposition :
if dcomplex is not None:
if dcomplex not in ['hilbert', 'wavelet']:
raise ValueError("dcomplex must either be 'hilbert' or "
"'wavelet'.")
else:
self._dcomplex = dcomplex
# Convert filtorder :
if filtorder is not None:
self._filtorder = int(filtorder)
# Convert Morlet's width :
if width is not None:
self._width = int(width)
评论列表
文章目录