示例#1
0
 def test_savgol_filter(self):
     """Test function savgol_filter."""
     d_3d = self._get_data(3)
     ds = DatasetEphy(d_3d, times='times', **kw)
     ds.savgol_filter(10., verbose=False)
示例#2
0
plt.xlabel('Times')
plt.title('Electrophysiological data of the first subject, for the first '
          'channel')
plt.show()

###############################################################################
# Data smoothing
# --------------
#
# If you have MNE-Python installed, you can also smooth the data using
# :class:`frites.dataset.DatasetEphy.savgol_filter`. One important thing is
# that operations are performed inplace, which means that once launched, the
# data are modified inside the dataset without copy

# high cut-off frequency at 4Hz
dt.savgol_filter(4)

plt.plot(dt.times, dt.x[0][:, 0, :].T)
plt.xlabel('Times')
plt.title('Smoothed dataset')
plt.show()

###############################################################################
# Temporal slicing
# -----------------------
#
# The dataset also supports some basic slicing operations through time. Slicing
# is still performed inplace

# temporal selection between [0.25, 1.75]
dt = dt.sel(times=slice(0.25, 1.75))