# Adding ECG signal with raw EEG data as an MNE raw object

**URL:** <https://mne.discourse.group/t/adding-ecg-signal-with-raw-eeg-data-as-an-mne-raw-object/10821>\
**Category:** Support & Discussions\
**Created:** [February 19, 2025, 5:32pm UTC](https://mne.discourse.group/t/adding-ecg-signal-with-raw-eeg-data-as-an-mne-raw-object/10821 "2025-02-19T17:32:17Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![chholak](https://yyz2.discourse-cdn.com/free1/user_avatar/mne.discourse.group/chholak/32/2599_2.png) [@chholak](https://mne.discourse.group/u/chholak)\
**Post date:** [February 19, 2025, 5:32pm UTC](https://mne.discourse.group/t/adding-ecg-signal-with-raw-eeg-data-as-an-mne-raw-object/10821/1 "2025-02-19T17:32:17Z")

</div>

Hi there,

I am using MNE 1.9.0 on macOS 14.

I have an Excel file with the raw EEG data and ECG data, with independent timestamps and sampling frequencies. For example, the sampling frequency of EEG is 1000 Hz, whereas the sampling frequency of ECG signal is 512 Hz.

I can read the EEG raw data as an MNE raw object by reading it as an array using mne.io.RawArray, but I cannot figure out how to read the ECG signal into MNE since ECG signal cannot be a part of the same input array (since the sampling frequencies of EEG and ECG are different). I couldn’t find any other function to import the ECG signal separately after creating the raw object for the EEG.

What options do I have? The only thing I can think of is interpolating ECG signal to match the timestamps and sampling frequency of the EEG.

Thanks,  
Parth

---

<div class="post-metadata">

**Author:** ![Contamior](https://yyz2.discourse-cdn.com/free1/user_avatar/mne.discourse.group/contamior/32/4046_2.png) [@Contamior](https://mne.discourse.group/u/Contamior)\
**Post date:** [February 20, 2025, 7:03am UTC](https://mne.discourse.group/t/adding-ecg-signal-with-raw-eeg-data-as-an-mne-raw-object/10821/2 "2025-02-20T07:03:15Z")

</div>

Oversamle/Downsample ECG/EEG? Add ECG singal to different mne.raw object do preprocessing and whatever you want, then analyze results together? Options you have as far as I see.

Best regards, Ekizyan Avedik

---

<div class="post-metadata">

**Author:** ![chholak](https://yyz2.discourse-cdn.com/free1/user_avatar/mne.discourse.group/chholak/32/2599_2.png) [@chholak](https://mne.discourse.group/u/chholak)\
**Post date:** [February 20, 2025, 4:14pm UTC](https://mne.discourse.group/t/adding-ecg-signal-with-raw-eeg-data-as-an-mne-raw-object/10821/3 "2025-02-20T16:14:21Z")

</div>

Thank you! I can try those. 🙂
