# ECG artifacts

**URL:** <https://mne.discourse.group/t/ecg-artifacts/2052>\
**Category:** Mailing List Archive (read-only)\
**Tags:** list-archive\
**Created:** [January 21, 2020, 1:37am UTC](https://mne.discourse.group/t/ecg-artifacts/2052 "2020-01-21T01:37:09Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/free1/uploads/mne/original/1X/85cc6bd2b69cb698a166dc6d880fb550510d0144.jpeg) [@system](https://mne.discourse.group/u/system)\
**Post date:** [January 21, 2020, 1:37am UTC](https://mne.discourse.group/t/ecg-artifacts/2052/1 "2020-01-21T01:37:09Z")

</div>

External Email - Use Caution

Hi All,

I am new to MNE and am having some issues with identifying ECG artifacts, I have gone through the relevant tutorials and examples, but when I run the code the 'ecg\_epochs' image does not look how I would expect it to. I am using the mne.preprocessing.create\_ecg\_epochs function. Please see the image below. I have also tried the mne.preprocessing.find\_ecg\_events functions to no avail  
[cid:image001.png at 01D5D057.7EE66C20]  
Can anyone please point me to what I am doing incorrectly! I have checked the ECG channel, and it has very well defined PQRS waves, so I don't think it is an issue with that channel.

Thanks,  
Siobhan O'Brien  
-------------- next part --------------  
An HTML attachment was scrubbed...  
URL: [http://mail.nmr.mgh.harvard.edu/pipermail/mne\_analysis/attachments/20200121/a5481cde/attachment-0001.html](http://mail.nmr.mgh.harvard.edu/pipermail/mne_analysis/attachments/20200121/a5481cde/attachment-0001.html)  
-------------- next part --------------  
A non-text attachment was scrubbed...  
Name: image001.png  
Type: image/png  
Size: 37765 bytes  
Desc: image001.png  
Url : [http://mail.nmr.mgh.harvard.edu/pipermail/mne\_analysis/attachments/20200121/a5481cde/attachment-0001.png](http://mail.nmr.mgh.harvard.edu/pipermail/mne_analysis/attachments/20200121/a5481cde/attachment-0001.png)

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/free1/uploads/mne/original/1X/85cc6bd2b69cb698a166dc6d880fb550510d0144.jpeg) [@system](https://mne.discourse.group/u/system)\
**Post date:** [January 21, 2020, 7:18am UTC](https://mne.discourse.group/t/ecg-artifacts/2052/2 "2020-01-21T07:18:34Z")

</div>

External Email - Use Caution

It doesn?t look like the ECG channel is being used because in the log it  
says:

?combining channels using ?mean??

You can use the ch\_name argument to provide the channel or alternatively  
set the channel type using raw.set\_channel\_types

Mainak

> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;External Email - Use Caution
> 
> Hi All,
> 
> I am new to MNE and am having some issues with identifying ECG artifacts,  
> I have gone through the relevant tutorials and examples, but when I run the  
> code the ?ecg\_epochs? image does not look how I would expect it to. I am  
> using the mne.preprocessing.create\_ecg\_epochs function. Please see the  
> image below. I have also tried the mne.preprocessing.find\_ecg\_events  
> functions to no avail
> 
> Can anyone please point me to what I am doing incorrectly! I have checked  
> the ECG channel, and it has very well defined PQRS waves, so I don?t think  
> it is an issue with that channel.
> 
> Thanks,
> 
> Siobhan O?Brien  
> \_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_  
> Mne\_analysis mailing list  
> Mne\_analysis at nmr.mgh.harvard.edu  
> [Mne\_analysis Info Page](https://mail.nmr.mgh.harvard.edu/mailman/listinfo/mne_analysis)

-------------- next part --------------  
An HTML attachment was scrubbed...  
URL: [http://mail.nmr.mgh.harvard.edu/pipermail/mne\_analysis/attachments/20200121/e61ae5dc/attachment-0001.html](http://mail.nmr.mgh.harvard.edu/pipermail/mne_analysis/attachments/20200121/e61ae5dc/attachment-0001.html)  
-------------- next part --------------  
A non-text attachment was scrubbed...  
Name: image001.png  
Type: image/png  
Size: 37765 bytes  
Desc: not available  
Url : [http://mail.nmr.mgh.harvard.edu/pipermail/mne\_analysis/attachments/20200121/e61ae5dc/attachment-0001.png](http://mail.nmr.mgh.harvard.edu/pipermail/mne_analysis/attachments/20200121/e61ae5dc/attachment-0001.png)

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/free1/uploads/mne/original/1X/85cc6bd2b69cb698a166dc6d880fb550510d0144.jpeg) [@system](https://mne.discourse.group/u/system)\
**Post date:** [January 21, 2020, 11:53pm UTC](https://mne.discourse.group/t/ecg-artifacts/2052/3 "2020-01-21T23:53:36Z")

</div>

External Email - Use Caution

Thanks Mainak,

Sorry I probably should have shown the code I was using. Below is the code I am using - I do specify the channel accordingly. I have had a play around with the different options in plot\_image? and I get exactly the same graph when I remove combine = ?mean? and have no inputs to plot\_image.

ecg\_epochs = mne.preprocessing.create\_ecg\_epochs(eeg\_data, event\_id=999, ch\_name = 'EKG')  
ecg\_epochs.plot\_image(combine='mean')

Is there anything else you think it could be?

Thanks for your help!  
Siobhan

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/free1/uploads/mne/original/1X/85cc6bd2b69cb698a166dc6d880fb550510d0144.jpeg) [@system](https://mne.discourse.group/u/system)\
**Post date:** [January 22, 2020, 10:09am UTC](https://mne.discourse.group/t/ecg-artifacts/2052/4 "2020-01-22T10:09:43Z")

</div>

External Email - Use Caution

Hi Siobhan -- no clue. If you can share your data along with a script that  
is no longer than 15 lines, I could perhaps try to help debug. It's hard to  
guess what could have gone wrong from two lines of code.

Mainak

> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;External Email - Use Caution
> 
> Thanks Mainak,
> 
> Sorry I probably should have shown the code I was using. Below is the code  
> I am using - I do specify the channel accordingly. I have had a play around  
> with the different options in plot\_image? and I get exactly the same graph  
> when I remove combine = ?mean? and have no inputs to plot\_image.
> 
> ecg\_epochs = mne.preprocessing.create\_ecg\_epochs(eeg\_data, event\_id=999,  
> ch\_name = 'EKG')
> 
> ecg\_epochs.plot\_image(combine='mean')
> 
> Is there anything else you think it could be?
> 
> Thanks for your help!
> 
> Siobhan
> 
> \*From:\* mne\_analysis-bounces at nmr.mgh.harvard.edu \<  
> mne\_analysis-bounces at nmr.mgh.harvard.edu\> \*On Behalf Of \*Mainak Jas  
> \*Sent:\* Tuesday, 21 January 2020 6:19 PM  
> \*To:\* Discussion and support forum for the users of MNE Software \<  
> mne\_analysis at nmr.mgh.harvard.edu\>  
> \*Subject:\* Re: [Mne\_analysis] ECG artifacts
> 
> \* External Email - Use Caution \*
> 
> It doesn?t look like the ECG channel is being used because in the log it  
> says:
> 
> ?combining channels using ?mean??
> 
> You can use the ch\_name argument to provide the channel or alternatively  
> set the channel type using raw.set\_channel\_types
> 
> Mainak
> 
> \* External Email - Use Caution \*
> 
> Hi All,
> 
> I am new to MNE and am having some issues with identifying ECG artifacts,  
> I have gone through the relevant tutorials and examples, but when I run the  
> code the ?ecg\_epochs? image does not look how I would expect it to. I am  
> using the mne.preprocessing.create\_ecg\_epochs function. Please see the  
> image below. I have also tried the mne.preprocessing.find\_ecg\_events  
> functions to no avail
> 
> Can anyone please point me to what I am doing incorrectly! I have checked  
> the ECG channel, and it has very well defined PQRS waves, so I don?t think  
> it is an issue with that channel.
> 
> Thanks,
> 
> Siobhan O?Brien
> 
> \_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_  
> Mne\_analysis mailing list  
> Mne\_analysis at nmr.mgh.harvard.edu  
> [Mne\_analysis Info Page](https://mail.nmr.mgh.harvard.edu/mailman/listinfo/mne_analysis)
> 
> \_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_  
> Mne\_analysis mailing list  
> Mne\_analysis at nmr.mgh.harvard.edu  
> [Mne\_analysis Info Page](https://mail.nmr.mgh.harvard.edu/mailman/listinfo/mne_analysis)

-------------- next part --------------  
An HTML attachment was scrubbed...  
URL: [http://mail.nmr.mgh.harvard.edu/pipermail/mne\_analysis/attachments/20200122/3b3c892b/attachment-0001.html](http://mail.nmr.mgh.harvard.edu/pipermail/mne_analysis/attachments/20200122/3b3c892b/attachment-0001.html)  
-------------- next part --------------  
A non-text attachment was scrubbed...  
Name: image001.png  
Type: image/png  
Size: 37765 bytes  
Desc: not available  
Url : [http://mail.nmr.mgh.harvard.edu/pipermail/mne\_analysis/attachments/20200122/3b3c892b/attachment-0001.png](http://mail.nmr.mgh.harvard.edu/pipermail/mne_analysis/attachments/20200122/3b3c892b/attachment-0001.png)
