Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature WPLI #411

Merged
merged 70 commits into from
Feb 23, 2023
Merged

Conversation

ojoenlanuca
Copy link
Collaborator

To further increase the number of functions in the phase_analysis module of ‘elephant’, we implemented the ‘weighted_phase_lag_index()’-function to calculate the WPLI, which is a measure of phase-synchronization and based on the imaginary part of the complex-valued cross-spectrum of two signals. This measure was first introduced in ‘An improved index of phase-synchronization for electrophysiological data in the presence of volume-conduction, noise and sample-size bias’ by Vinck et al., 2011. Correctness was tested among other things via ‘ground-truth’-testing with: MATLABs package FieldTrip and its function ft_connectivity_wpli() and its wrapper ft_connectivity(); as well as with python package MNE and its function spectral_connectivity().

…nits for artifical data in WPLITestCase;; added temparali plots for visual comparsion of results in test-functions
…he wpli;; removed negative frequency removal, to return frequencies in range of [-f_0 / 2; f_0 / 2], with f_0 as samplling frequency
…arious variables to meet lowercase-convention;; use now assert_all_close instead of assert_almost_equal like numpy recomended
…fft, to avoid negative frequency removal by hand
…used for WPLI-ground-truth calculation by FieldTrip
…ameter for rfftfreq, resulting different array-sizes of wpli and freq
…on in the WPLI-TestCase;; use this multisine artificial LFP dataset besides ground-truth testing also to check, if WPLI is 0, 1 or -1 at certain frequencies;; remove now unused code
…FieldTrips ft_connectivity() and MNEs spectral_connectivity(), both using multitaper FFT, at certain frequencies
… used artificial datasets and differenct ground-truths
@pep8speaks
Copy link

pep8speaks commented Mar 16, 2021

Hello @ojoenlanuca! Thanks for updating this PR. We checked the lines you've touched for PEP 8 issues, and found:

Line 416:25: E127 continuation line over-indented for visual indent

Comment last updated at 2022-07-13 13:12:07 UTC

@ojoenlanuca ojoenlanuca marked this pull request as ready for review March 16, 2021 10:22
@ojoenlanuca ojoenlanuca marked this pull request as draft March 16, 2021 10:30
@ojoenlanuca
Copy link
Collaborator Author

Could you have a look at this PR and share your feedback/opinion about it? @mdenker , @rjurkus , @kohlerca

@mdenker mdenker added the enhancement Editing an existing module, improving something label May 21, 2021
@mdenker mdenker added this to the v0.12.0 milestone May 21, 2021
…lly, because they won't be included in this elephant-PR;; updated versions of generate_artificial_datasets and ft_connectivity -Scripts are included in the G-Node GIN elephant-date PR of the branch feature_PhaseAnalysis_WPLI
…'elephant-data' repository from the G-Node GIN server;; increased slightly the atol value in 'test_WPLI_is_zero'-testfunction because of changes in the artifical-data generation (more trials + larger trail length)
@coveralls
Copy link
Collaborator

coveralls commented Jul 21, 2021

Coverage Status

Coverage: 87.497% (+0.04%) from 87.457% when pulling c7bd4df on INM-6:feature_WPLI into 99d3555 on NeuralEnsemble:master.

@ojoenlanuca ojoenlanuca marked this pull request as ready for review July 22, 2021 07:26
…factored variable names to match lowercase convention; decorated explicitly test_WPLI_raises_error_if_AnalogSignals_have_diff_sampling_rate() to be a static-method
@Moritz-Alexander-Kern Moritz-Alexander-Kern added enhancement Editing an existing module, improving something and removed enhancement Editing an existing module, improving something labels Jul 1, 2022
@Moritz-Alexander-Kern
Copy link
Member

@Moritz-Alexander-Kern
Copy link
Member

Moritz-Alexander-Kern commented Jul 12, 2022

This PR on GIN, elephant-data has to be merged in order to continue with this PR.

Since work on WPLI was started, the structure of elephant-data was changed. Work on this will continue once the GIN PR was adapted.

Done, see: #9 Feature: Phase Analysis Dataset

@Moritz-Alexander-Kern Moritz-Alexander-Kern dismissed mdenker’s stale review July 13, 2022 13:22

Changes have been implemented.

@Moritz-Alexander-Kern
Copy link
Member

Moritz-Alexander-Kern commented Jul 13, 2022

Hi @ojoenlanuca ,

please let me know if you accept the changes done to your contribution.
If so, this PR is ready to be merged. 🎉

@Moritz-Alexander-Kern Moritz-Alexander-Kern merged commit 02a6fed into NeuralEnsemble:master Feb 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Editing an existing module, improving something
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants