Hi,

I use visual inspection along with trial and component removal techniques to clean up the EEG signal. I then apply surface laplacian before performing ERD. The steps for ERD include averaging across trials. I was looking at ERD for each trial before averaging to visualize any trend across trials. Some of the trials so more than a 2SD deviation. Is that the reason why we average across trials? Are these trials showing these deviations due to the noise present in the baseline period for these trials? Should I look at the baseline across each trial to spot any deviation? If yes, how to look at a baseline that is not just visual inspection?

Hi Priya. Single-trial EEG data are generally noisy, which is the reason why averaging over trials is a good idea.

During data cleaning, you can look at the single-trial time-domain data to check for artifacts, but I don’t think looking at all of your single-trial spectral results is a good idea.

Thank you Mike.

I knew looking at ERD for every trial is not the right direction but my objective is to see how the max ERD values change over time. I have data from nearly 100 trials and each trial is 9 seconds long. would it make sense if i average ERD across every 12 or so trials and see how the values change?

my hypothesis is that once the participant is comfortable with the task or has any learning effect, the level of ERD will go down and i thought it might be apparent if i look at ERD for every trial.

I see. Yes, you can definite use the single-trial data, possibly averaged into trial bins as you suggest. In my previous reply, I meant that it’s not a good idea to reject single trials based on normalized TF plots.

btw, another possibly way to test your hypothesis would be to run a within-subjects correlation analysis, where you correlate the power at each TF point with the trial number. If power decreases over trials, then you’d find a negative correlation, etc.

Thank you, Mike. I understand that instead of eliminating single trials based on percent normalized TFplots, it would be better to averages multiple trials in a trial bin. I can then do a within-subjects correlation to see if the power decreases over these trials bins.

My primary concern was that the noisy baseline gives rise to spurious normalized power values for each trial. But after doing a power analysis across all baselines (baseline per trial) in the beta range, I realize that single-trial is noisy.

After looking at your lectures and the “Analyzing time series” book on the baseline, I am considering averaging all the baselines across all trials and then using that for calculating ERD for each trial.

Single-trial baselining is tricky. I’m generally not a fan: In my experience, the single-trial TF maps are unstable. But people have different opinions and experiences. This issue has been discussed several times in this forum.

Thank you so much for explaining the concept of baseline normalization in chapter 18. Based on your recommendation and my data, I wanted to adopt the following steps:

- Isolate electrode of interest with all datapoints and all trials (electrode x datapoints x trials)
- Bandpass filter the data between 10 - 30 Hz
- Square the data to obtain the power.
- For each subject and condition, find a mean baseline power across the baseline time period, then across all trials.
- Calculate ERD using this baseline power across all trials.
- Calculate median ERD across all trials.
- Plot ERD across time.

The expected result, the baseline period will hover around 0% till one second prior to trigger onset (at 0) then there will be ERD. The reason for choosing the median for trials is so I could reduce the effect of outliers on my ERD.

The problem however is the actual result shows the baseline in the negative percent and then the ERD.

If I choose to find the median across time or across trials for the baseline power, the baseline period in the time series is really positive and ERD shift closer to zero with lower negative percent changes.

Why does the median change the ERD values so drastically?

That sounds mostly fine. Note that simply squaring bandpass filtered signals (step 3) does not give you power – you would need to square the Hilbert transform of the bandpass filtered signal.

Differences between mean and median indicate unusual values in the data, which could be outliers or noise, or just trials with unusually large power (that is, non-representative but valid data). The median is a nonlinear measure of central tendency, so you can get sudden changes in the time series. If you are concerned about these results, you could do some additional data cleaning, such as manual trial rejection or automatic rejection of trials with excessive power.

Thank you, I understand what you mean by the non-representative but valid data. For step 3. to square the Hilbert transform of the signal, I do (imag(Hilbert transform(signal))).^2 ?

Nope, you work from the complex-valued signal. So: `abs(hilbert(signal)).^2`

(of course that code might need modifications depending on the dimensions and possible subselections of the `signal`

variable).

Dear Mike,

My fundamental question about Hilbert transform:

we calculate the magnitude of the Hilbert transform of the bandpass filtered signal and squared to obtain an estimate of instantaneous power

What is the benefit of using Hilbert transform? Does the envelope allow for more accuracy with the ERD computation? If yes, how?

I am trying to understand the steps and logic behind this step.

Hi Priya. The motivation for the Hilbert transform is the same as the motivation for complex-valued Morlet wavelets (and also for complex-valued sine waves in the Fourier transform): Without it, there is a phase dependency of the signal that prevents you from computing the power (or amplitude) time series. You can see that phase relationship by taking the real part of the output of the Hilbert transform instead of the magnitude.

I discuss this idea in my youtube videos about why we need complex Morlet wavelets for time-frequency analysis, and why we need complex sine waves for Fourier analysis.