|
4 | 4 |
|
5 | 5 | import numpy as np |
6 | 6 | import pytest |
7 | | -from numpy.testing import assert_allclose, assert_array_almost_equal |
8 | | -from scipy.fft import rfft |
| 7 | +from numpy.testing import assert_array_almost_equal |
9 | 8 |
|
10 | 9 | from mne.time_frequency import psd_array_multitaper |
11 | | -from mne.time_frequency.multitaper import _mt_spectra, dpss_windows |
| 10 | +from mne.time_frequency.multitaper import dpss_windows |
12 | 11 | from mne.utils import _record_warnings |
13 | 12 |
|
14 | 13 |
|
@@ -79,22 +78,3 @@ def test_adaptive_weights_convergence(): |
79 | 78 | ): |
80 | 79 | psd_array_multitaper(data, sfreq, adaptive=True, max_iter=2) |
81 | 80 | psd_array_multitaper(data, sfreq, adaptive=True, max_iter=200) |
82 | | - |
83 | | - |
84 | | -def test_mt_spectra_batched_matches_reference(): |
85 | | - """Test that batched tapered spectra match an explicit channel loop.""" |
86 | | - rng = np.random.default_rng(0) |
87 | | - x = rng.standard_normal((3, 17)) |
88 | | - sfreq = 200.0 |
89 | | - dpss, _ = dpss_windows(17, 2.5, 4, low_bias=False) |
90 | | - |
91 | | - x_mt, freqs = _mt_spectra(x, dpss, sfreq) |
92 | | - x = x - np.mean(x, axis=-1, keepdims=True) |
93 | | - ref = np.array([rfft(sig[np.newaxis, :] * dpss, axis=-1) for sig in x]) |
94 | | - ref[..., 0] /= np.sqrt(2.0) |
95 | | - if 17 % 2 == 0: |
96 | | - ref[..., -1] /= np.sqrt(2.0) |
97 | | - |
98 | | - assert x_mt.shape == ref.shape |
99 | | - assert_allclose(x_mt, ref) |
100 | | - assert freqs.shape[0] == x_mt.shape[-1] |
0 commit comments