def get(self, x, **kwargs):
"""
"""
# Check size of x:
if len(x.shape) == 1:
x = x.reshape(1, len(x), 1)
elif len(x.shape) == 2:
x = x[np.newaxis, ...]
self._nelec, self._npts, self._ntrials = x.shape
# Split x in window:
if self._window is not None:
x = np.transpose(
np.array([x[:, k[0]:k[1], :] for k in self._window]), (
1, 2, 0, 3))
# Compute PSD:
return welch(x, fs=self._sf, axis=1, **kwargs)
评论列表
文章目录