mne-tools / mne-features

MNE-Features software for extracting features from multivariate time series
https://mne-tools.github.io/mne-features/
BSD 3-Clause "New" or "Revised" License
142 stars 32 forks source link

[WIP] Adding parameters log and ratios_triu to compute_pow_freq_bands #62

Closed hubertjb closed 3 years ago

hubertjb commented 3 years ago

This PR introduces parameters log and ratios_triu to compute_pow_freq_bands (again, if there's interest in including this in the library!). This one might require some discussion.

log controls whether the power is log-transformed. If log=True, the band ratios are calculated as "log-ratios" (e.g., log(alpha_pow/beta_pow)). Since this then leads to a linear relationship between a log-ratio an its log-inverse ratio (i.e., log(alpha_pow/beta_pow) = -1 * log(beta_pow/alpha_pow)), I added an additional parameter, ratios_triu which controls whether we should compute all possible pairs (which is currently the default behaviour) or only the upper part of the matrix of possible pairs. I included tests for the different scenarios, and ended up dividing the test for compute_pow_freq_bands into a couple smaller ones.

agramfort commented 3 years ago

thx @hubertjb !