本文整理汇总了Python中mne.io.Raw.apply_hilbert方法的典型用法代码示例。如果您正苦于以下问题:Python Raw.apply_hilbert方法的具体用法?Python Raw.apply_hilbert怎么用?Python Raw.apply_hilbert使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类mne.io.Raw
的用法示例。
在下文中一共展示了Raw.apply_hilbert方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_hilbert
# 需要导入模块: from mne.io import Raw [as 别名]
# 或者: from mne.io.Raw import apply_hilbert [as 别名]
def test_hilbert():
"""Test computation of analytic signal using hilbert
"""
raw = Raw(fif_fname, preload=True)
picks_meg = pick_types(raw.info, meg=True, exclude='bads')
picks = picks_meg[:4]
raw_filt = raw.copy()
raw_filt.filter(10, 20)
raw_filt_2 = raw_filt.copy()
raw2 = raw.copy()
raw3 = raw.copy()
raw.apply_hilbert(picks)
raw2.apply_hilbert(picks, envelope=True, n_jobs=2)
# Test custom n_fft
raw_filt.apply_hilbert(picks)
raw_filt_2.apply_hilbert(picks, n_fft=raw_filt_2.n_times + 1000)
assert_equal(raw_filt._data.shape, raw_filt_2._data.shape)
assert_allclose(raw_filt._data[:, 50:-50], raw_filt_2._data[:, 50:-50],
atol=1e-13, rtol=1e-2)
assert_raises(ValueError, raw3.apply_hilbert, picks,
n_fft=raw3.n_times - 100)
env = np.abs(raw._data[picks, :])
assert_allclose(env, raw2._data[picks, :], rtol=1e-2, atol=1e-13)
示例2: test_hilbert
# 需要导入模块: from mne.io import Raw [as 别名]
# 或者: from mne.io.Raw import apply_hilbert [as 别名]
def test_hilbert():
"""Test computation of analytic signal using hilbert
"""
raw = Raw(fif_fname, preload=True)
picks_meg = pick_types(raw.info, meg=True, exclude='bads')
picks = picks_meg[:4]
raw2 = raw.copy()
raw.apply_hilbert(picks)
raw2.apply_hilbert(picks, envelope=True, n_jobs=2)
env = np.abs(raw._data[picks, :])
assert_allclose(env, raw2._data[picks, :], rtol=1e-2, atol=1e-13)