Question on dss_line() usage
See original GitHub issueHi, its awesome that there is an implementation of the ZAPline algorithm in Python! I’m trying to use it, but I somehow fail to remove the noise components with it. I’m convinced that I must be doing something obvious wrong - any idea what it may be?
I’m using Elekta MEG data (322 MEG channels, after Signal Space Separation) that show an artifact at 60Hz stemming from a presentation display. Here is its PSD:
Here’s the code I am running:
>>> import mne
>>> from meegkit.dss import dss_line
# read in the data with mne-python
>>> raw_fname = Path(datadir) / f'sub-{subject}/meg' / f'sub-{subject}_task-memento_proc-sss_meg.fif'
>>> raw = mne.io.read_raw_fif(raw_fname)
>>> raw.load_data()
>>> data, artifact = dss_line(raw._data.T, fline=60, sfreq=1000)
Power of components removed by DSS: 0.00
Putting the data back into the MNE Raw Object and visualizing the psd plot shows an almost identical profile, with the 60Hz component being pretty much unaffected.
Any idea what I might be doing wrong here? Thanks much in advance!
Issue Analytics
- State:
- Created 2 years ago
- Comments:7 (4 by maintainers)
Top Results From Across the Web
OpenDSS / Discussion / Help: Best way to iteratively solve?
Hiho,. So I'm currently adressing some performance issues, that I have (On my side of things, using Java, etc. Not really important, here.) ......
Read more >Questions about the DSS keys on Yealink T21P E2
It looks like I have different options to program the green DSS buttons on our phones. One of the options is Park. To...
Read more >Ultimate MACD Indicator for ThinkorSwim
Here is a MACD indicator for ThinkorSwim. It uses a color coded MACD line to show changes. There is a moving average of...
Read more >Questions to GUI users on available GUIs [Archive] - Doom9's ...
I hope the thread will be useful to explore different natures of GUIs and users. 1.) How much experience do you have in...
Read more >Tips to fix your SSH authentication issues - ARDC Support
an extensive list of what can go wrong with SSH access, and how to troubleshoot.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I can confirm that that was part of the problem. The other problem seems to be that your 60hz peak is not really at 60hz. Using 61Hz works well I think.
Here’s the code I used:
I’ll have a look. There’s at least a couple of reasons I can think of.
Btw, just a quick comment,
raw._data.T
is probably not the best way to access the raw data (even though I’m guilty of using it myself sometimes), as it will include all kinds of system and misc channels (on top of the grad and mag channels).raw.get_data(picks=['meg'])
is probably safer.