raphaelvallat / yasa

YASA (Yet Another Spindle Algorithm): a Python package to analyze polysomnographic sleep recordings.
https://raphaelvallat.com/yasa/
BSD 3-Clause "New" or "Revised" License
417 stars 113 forks source link

Apply downsampling/filtering on all channels at once for *_detect_multi #13

Closed raphaelvallat closed 4 years ago

raphaelvallat commented 4 years ago

The goal is to save some computation time.

raphaelvallat commented 4 years ago

%timeit mne.filter.filter_data(data, sf, 0.5, 30, verbose=0)

gives similar results to...

%%timeit
for chan in data:
    mne.filter.filter_data(chan, sf, 0.5, 30, verbose=0)

...because MNE also used a for loop internally. So we will not speed up computation time by applying the filtering on all channels at once.

raphaelvallat commented 4 years ago

Closing this issue as I doubt that it will significantly improve execution time. Please feel free to re-open.