Compute normalized phase angles. Parameters ---------- data : ndarray, shape (n_epochs, n_sources, n_times) The data to compute the phase angles for. Returns ------- phase_angles : ndarray, shape (n_epochs, n_sources, n_times) The normalized phase angles.
(data)
| 10 | |
| 11 | |
| 12 | def _compute_normalized_phase(data): |
| 13 | """Compute normalized phase angles. |
| 14 | |
| 15 | Parameters |
| 16 | ---------- |
| 17 | data : ndarray, shape (n_epochs, n_sources, n_times) |
| 18 | The data to compute the phase angles for. |
| 19 | |
| 20 | Returns |
| 21 | ------- |
| 22 | phase_angles : ndarray, shape (n_epochs, n_sources, n_times) |
| 23 | The normalized phase angles. |
| 24 | """ |
| 25 | return (np.angle(hilbert(data)) + np.pi) / (2 * np.pi) |
| 26 | |
| 27 | |
| 28 | def ctps(data, is_raw=True): |