<p>The common steps are:
- Raw Signal (after pre-amplifier and amplification)
- Band pass filter
- Band rejection/Notch filter (cutoff depends on where you're at)
- Anti Aliasing Filter
- Sample/Hold
- MUX(if you have multiple channels)
- ADC
- Digital Signal</p>

<p>like AliceD mentioned you can use FFT based filters and WT as a filter. For WT you basically apply it to the signal(after selecting a mother wavelet) and you will get a number of coeeficients representing different frequency components which can then be subtracted from the raw signal to remove the noises.   </p>

<p>Apart from these filters you could also use spatial filters, a very common one is CSP(common spatial patterns) or others like MEC, CCA, AC, CAR, ICA etc. </p>

CC BY-SA 4.0
2019-07-30T06:22:16.920Z
2019-07-30T06:22:16.920Z
roaibrain
<p><em>Removal of noise</em> can be done in various ways:</p>

<p><strong>Conventional filters</strong>: You could create a digital low-pass filter, such as a Chebyshev or Butterworth filter with a cut-off frequency at 30 Hz (<em>filt</em> or <em>filtfilt</em> function in Matlab).</p>

<p><strong>FFT-based filtering</strong>: FIR filters remove frequencies in the frequency domain. So first a Fourier transform is done and then the frequencies >30 Hz can be removed from the signal simply by assigning '0' to the FFT coefficients at >30 Hz. A reverse FFT then brings your signal back (<em>fftfilt</em> in Matlab).</p>

<p><strong>Wavelet transforms</strong>: Being a relatively complex and processing-power-hungry method, it may not be the method you are after. However, it may be more efficient in removing certain types of noise or to extract certain features from a signal (<em>cwt</em> or <em>dwt</em> functions in matlab).     </p>

<p>I'm not familiar with Python. Finding the corresponding filters in Python should be fairly straightforward. There are more filtering procedures but the above should get you going. </p>

<p><em>Correlation analysis</em> can be done by various methods, including <strong>Pearson product moment correlation</strong>, <strong>Spearman rank order correlation</strong>, <strong>Kendall rank order correlation</strong> and <strong>mutual information</strong>. <a href="https://www.google.com.au/url?sa=t&amp;rct=j&amp;q=&amp;esrc=s&amp;source=web&amp;cd=1&amp;cad=rja&amp;uact=8&amp;ved=0CCMQFjAA&amp;url=http%3A%2F%2Flink.springer.com%2Farticle%2F10.1007%252Fs11571-013-9267-8&amp;ei=8IaGVPvCMsXRmwX05ID4Aw&amp;usg=AFQjCNHqJ-spqchQgXNuD0GvhxyAnjIwqw&amp;sig2=1BOhWqCSCJEfbF9gjFMFxg&amp;bvm=bv.81449611,d.dGY" rel="nofollow">See Bonita et al., 2014, DOI: 10.1007/s11571-013-9267-8</a>.</p>

<p><em>Subtracting the mean signal</em> from a particular channel basically reduces signal offset (the DC signal), comparable to a high-pass filter with a very low cut-off frequency. </p>

CC BY-SA 3.0
2014-12-09T06:05:03.933Z
For calculating correlations, I don't understand why I have to "subtract the mean signal from each", can't I just correlate the data after filtering the noise?
achabacha322
CC BY-SA 3.0
2014-12-09T09:55:46.687Z
I do not know what the "mean signal" means: the mean of different post-stimulus EEGs? Or the mean over different channels? There's not enough info in your question  to answer this.
AliceD
CC BY-SA 3.0
2014-12-09T12:03:52.710Z
Yeah that's all the professor gave me, once I get in touch with him and he explains that part, I'll be back to post it here. Probably next week. Thanks
achabacha322
CC BY-SA 3.0
2014-12-09T13:54:54.620Z
It's not uncommon to find the mean of a channel over the entire recording and then subtract it out.
Josh
CC BY-SA 3.0
2014-12-09T16:43:01.267Z
I was able to finally talk with the professor, he said in my case: Since we have 64 electrodes, we need to get 64 mean signals. Then for example, I will subtract the mean signal for electrode 1 from the signal at every time stamp in electrode 1. And do it for each. I will post the final results of our chord diagram here when I'm done.
achabacha322
CC BY-SA 3.0
2015-06-29T13:45:58.767Z
Fourier transform based Finite Impulse Response filters are just one class of FIR filters. Filters are tricky, distort your signal and often poorly understood. I would suggest reading Steve Lucks chapter on filters before continuing. The most basic FIR filter (which is also very easy to understand) for removing 50/ 60hz line noise (if that would be your goal) would be a boxcar filter.
blackBerry
CC BY-SA 3.0
2014-12-09T05:23:45.720Z
2014-12-10T11:04:16.620Z
2014-12-10T11:04:16.620Z
AliceD
<p>I am a computer science student and I'm doing something for a psychology professor.</p>

<p>We have EEG data from an experiment where a person was shown 140 images for 2 seconds each. We placed 64 electrodes on the scalp so we have 64 channels of continuous data. </p>

<p>We want to correlate each node with every other node so that we can graph it using a <a href="http://bl.ocks.org/mbostock/4062006" rel="nofollow">chord diagram</a>. </p>

<p>Since my professor is abroad, I am having trouble with the directions he gave me to manipulate the data to get the correlations.</p>

<blockquote>
  <p>"Once you are able to read the matrix of channels I suggest subtracting the mean signal from each, filtering to remove noise above 30 Hz."</p>
</blockquote>

<p>My question is how to remove the noise above 30 Hz? For example, data for 1 electrode for 10 milliseconds looks like this (measured in uV):</p>

<pre><code>[ 31172.50, 31173.53, 31174.80, 31177.34, 31173.73,
  31172.85, 31172.75, 31172.70, 31174.95, 31178.95]
</code></pre>

<p>The python script I am using also gives this data:</p>

<pre><code>sampling rate: 1000.0 Hz
time: 0.0 s to 1883.15 s
</code></pre>

<p>Can anyone point me in the right direction what steps to take to remove noise above 30 Hz? And also, is that a good way to compute the correlations between the electrodes?</p>

<neuroscience><measurement><eeg><correlation>
How to filter noise in EEG data
achabacha322
# How to filter noise in EEG data

(Asked by: username_0 on 2014-12-09)

I am a computer science student and I'm doing something for a psychology professor.
We have EEG data from an experiment where a person was shown 140 images for 2 seconds each. We placed 64 electrodes on the scalp so we have 64 channels of continuous data. 
We want to correlate each node with every other node so that we can graph it using a chord diagram. 
Since my professor is abroad, I am having trouble with the directions he gave me to manipulate the data to get the correlations.

"Once you are able to read the matrix of channels I suggest subtracting the mean signal from each, filtering to remove noise above 30 Hz."

My question is how to remove the noise above 30 Hz? For example, data for 1 electrode for 10 milliseconds looks like this (measured in uV):
[ 31172.50, 31173.53, 31174.80, 31177.34, 31173.73,
  31172.85, 31172.75, 31172.70, 31174.95, 31178.95]

The python script I am using also gives this data:
sampling rate: 1000.0 Hz
time: 0.0 s to 1883.15 s

Can anyone point me in the right direction what steps to take to remove noise above 30 Hz? And also, is that a good way to compute the correlations between the electrodes?

**Tags:** neuroscience, measurement, eeg, correlation


---

## 2 answers

### Answer by username_2 on 2014-12-09. Score: 4 | Accepted answer

*Removal of noise* can be done in various ways:

**Conventional filters**: You could create a digital low-pass filter, such as a Chebyshev or Butterworth filter with a cut-off frequency at 30 Hz (*filt* or *filtfilt* function in Matlab).

**FFT-based filtering**: FIR filters remove frequencies in the frequency domain. So first a Fourier transform is done and then the frequencies >30 Hz can be removed from the signal simply by assigning '0' to the FFT coefficients at >30 Hz. A reverse FFT then brings your signal back (*fftfilt* in Matlab).

**Wavelet transforms**: Being a relatively complex and processing-power-hungry method, it may not be the method you are after. However, it may be more efficient in removing certain types of noise or to extract certain features from a signal (*cwt* or *dwt* functions in matlab).

I'm not familiar with Python. Finding the corresponding filters in Python should be fairly straightforward. There are more filtering procedures but the above should get you going.

*Correlation analysis* can be done by various methods, including **Pearson product moment correlation**, **Spearman rank order correlation**, **Kendall rank order correlation** and **mutual information**. [See Bonita et al., 2014, DOI: 10.1007/s11571-013-9267-8](https://www.google.com.au/url?sa=t&rct=j&q=&esrc=s&source=web&cd=1&cad=rja&uact=8&ved=0CCMQFjAA&url=http%3A%2F%2Flink.springer.com%2Farticle%2F10.1007%252Fs11571-013-9267-8&ei=8IaGVPvCMsXRmwX05ID4Aw&usg=AFQjCNHqJ-spqchQgXNuD0GvhxyAnjIwqw&sig2=1BOhWqCSCJEfbF9gjFMFxg&bvm=bv.81449611,d.dGY).

*Subtracting the mean signal* from a particular channel basically reduces signal offset (the DC signal), comparable to a high-pass filter with a very low cut-off frequency.

> **Comments:**
> **username_0**: For calculating correlations, I don't understand why I have to "subtract the mean signal from each", can't I just correlate the data after filtering the noise?  
> **username_2**: I do not know what the "mean signal" means: the mean of different post-stimulus EEGs? Or the mean over different channels? There's not enough info in your question  to answer this.  
> **username_0**: Yeah that's all the professor gave me, once I get in touch with him and he explains that part, I'll be back to post it here. Probably next week. Thanks  
> **username_3**: It's not uncommon to find the mean of a channel over the entire recording and then subtract it out.  
> **username_0**: I was able to finally talk with the professor, he said in my case: Since we have 64 electrodes, we need to get 64 mean signals. Then for example, I will subtract the mean signal for electrode 1 from the signal at every time stamp in electrode 1. And do it for each. I will post the final results of our chord diagram here when I'm done.  
> **username_4**: Fourier transform based Finite Impulse Response filters are just one class of FIR filters. Filters are tricky, distort your signal and often poorly understood. I would suggest reading Steve Lucks chapter on filters before continuing. The most basic FIR filter (which is also very easy to understand) for removing 50/ 60hz line noise (if that would be your goal) would be a boxcar filter.  

---

### Answer by username_1 on 2019-07-30. Score: 0

The common steps are:
- Raw Signal (after pre-amplifier and amplification)
- Band pass filter
- Band rejection/Notch filter (cutoff depends on where you're at)
- Anti Aliasing Filter
- Sample/Hold
- MUX(if you have multiple channels)
- ADC
- Digital Signal

like username_2 mentioned you can use FFT based filters and WT as a filter. For WT you basically apply it to the signal(after selecting a mother wavelet) and you will get a number of coeeficients representing different frequency components which can then be subtracted from the raw signal to remove the noises.

Apart from these filters you could also use spatial filters, a very common one is CSP(common spatial patterns) or others like MEC, CCA, AC, CAR, ICA etc.


---

