# Filtering of Raw Data - Thresholds

**URL:** <https://mne.discourse.group/t/filtering-of-raw-data-thresholds/9217>\
**Category:** Support & Discussions\
**Tags:** preprocessing, eeg, emg\
**Created:** [August 15, 2024, 1:04pm UTC](https://mne.discourse.group/t/filtering-of-raw-data-thresholds/9217 "2024-08-15T13:04:35Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![annina](https://yyz2.discourse-cdn.com/free1/user_avatar/mne.discourse.group/annina/32/2901_2.png) [@annina](https://mne.discourse.group/u/annina)\
**Post date:** [August 15, 2024, 1:04pm UTC](https://mne.discourse.group/t/filtering-of-raw-data-thresholds/9217/1 "2024-08-15T13:04:35Z")

</div>

Hi Friends

I’m currently preprocessing my polysomnography recordings and have to filter the raw data.  
I’m currently filtering like so:

```python
raw = mne.io.read_raw_edf(edf_path, preload=True, verbose = None)

raw.filter(l_freq = 0.1, h_freq = 45., picks = self.intersection(self.EEG_CHANNELS,my_channels))
raw.filter(l_freq = 0.3, h_freq = 40., picks =self.intersection(self.EOG_CHANNELS, my_channels))
raw.filter(l_freq = 10., h_freq = 90., picks = self.intersection(self.EMG_CHANNELS, my_channels))
raw.filter(l_freq = 0.3, h_freq = 70, picks = self.intersection(self.EKG_CHANNELS, my_channels))

```

I’m not interested in all the channels of my recordings, therefore I created an `intersection()` function.  
The raw data are sampled at 200 Hz, recordings are overnight polysomnographies. After the filtering, I epoch the data and then do power spectral analysis with, but will use the data in Deep Learning approaches as well.

* * *

**Questions**  
What should the frequency ranges be for the different channels?  
Is it reasonable to filter EMG channels up to 90 Hz or should it be much higher? In literature I’ve seen different approaches to filtering EMG, therefore I’m a little unsure.  
But when filtering it up to 90 Hz, the resulting EMG channels are extremely flat.  
Moreover, what about EOG or ECG?

Any suggestions are more than welcome! 😄

Cheers,  
Annina

* * *

Version I’m using:

- MNE version: 1.7.1

* * *
