# Merge EEG and EMG data filtered differently in one raw object

**URL:** <https://mne.discourse.group/t/merge-eeg-and-emg-data-filtered-differently-in-one-raw-object/4258>\
**Category:** Support & Discussions\
**Created:** [January 12, 2022, 10:29pm UTC](https://mne.discourse.group/t/merge-eeg-and-emg-data-filtered-differently-in-one-raw-object/4258 "2022-01-12T22:29:02Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![GanshengT](https://yyz2.discourse-cdn.com/free1/user_avatar/mne.discourse.group/ganshengt/32/646_2.png) [@GanshengT](https://mne.discourse.group/u/GanshengT)\
**Post date:** [January 12, 2022, 10:29pm UTC](https://mne.discourse.group/t/merge-eeg-and-emg-data-filtered-differently-in-one-raw-object/4258/1 "2022-01-12T22:29:02Z")

</div>

- MNE version: 0.24.0
- operating system: macOS 12

Assumed that I have two raw objects. One named raw\_eeg contains EEG data band-passed in 1-45 Hz, and the other one named raw\_emg contains EMG data band-passed in 10-200 Hz.

It is required raw\_eeg.info[‘highness’] == raw\_emg.info[‘highness’] if I want to merge these concurrently recorded data by using ` raw_eeg.addchannels([raw_emg])`

If I try to manually set raw\_emg.info[‘highness’] as raw\_eeg.info[‘highness’], a warning message appeared “DeprecationWarning: highpass cannot be set directly. Please use methods inst.filter() instead. This warning will turn into an error after 0.24”

I would like to know what is the best way to merge EEG and EMG data that are filtered differently

Thanks

---

<div class="post-metadata">

**Author:** ![mscheltienne](https://yyz2.discourse-cdn.com/free1/user_avatar/mne.discourse.group/mscheltienne/32/827_2.png) [@mscheltienne](https://mne.discourse.group/u/mscheltienne)\
**Post date:** [January 13, 2022, 4:19pm UTC](https://mne.discourse.group/t/merge-eeg-and-emg-data-filtered-differently-in-one-raw-object/4258/2 "2022-01-13T16:19:30Z")

</div>

Hello,

I think this is a bug in the concatenation because you should be able to filter differently for different channels. For instance, this code snippet creates a valid raw instance with different filters applied to both channel types:

```python
import numpy as np
from mne import create_info
from mne.io import RawArray

n_ch, n_times = 3, 1000
data = np.random.RandomState(0).randn(n_ch, n_times)
info = create_info(n_ch, 1000., ['eeg', 'eeg', 'emg'])
raw = RawArray(data, info)
raw.filter(l_freq=1, h_freq=10, picks='eeg')
raw.filter(l_freq=20, h_freq=200, picks='emg')
raw.plot(scalings=dict(eeg=4, emg=4))

```

Providing `force_update_info=True` does force the concatenation:

```python
import numpy as np
from mne import create_info
from mne.io import RawArray

data = np.random.RandomState(0).randn(2, 1000)
info = create_info(2, 1000., 'eeg')
raw = RawArray(data, info)
raw.filter(l_freq=1, h_freq=10, picks='eeg')

data = np.random.RandomState(0).randn(1, 1000)
info = create_info(['emg1'], 1000., 'emg')
raw_emg = RawArray(data, info)
raw_emg.filter(l_freq=20, h_freq=200, picks='emg')

raw.add_channels([raw_emg], force_update_info=True)
raw.plot(scalings=dict(eeg=4, emg=4))

```

I will have a look to the concatenation of raw instances with different filters when I have the time.

Mathieu

---

<div class="post-metadata">

**Author:** ![GanshengT](https://yyz2.discourse-cdn.com/free1/user_avatar/mne.discourse.group/ganshengt/32/646_2.png) [@GanshengT](https://mne.discourse.group/u/GanshengT)\
**Post date:** [January 17, 2022, 4:31pm UTC](https://mne.discourse.group/t/merge-eeg-and-emg-data-filtered-differently-in-one-raw-object/4258/3 "2022-01-17T16:31:18Z")

</div>

Thank you Mathieu, force\_update\_info does the trick.
