Question Regarding Baseline Correction in Time-Frequency Analysis of Auditory MMN Data

10 vues (au cours des 30 derniers jours)
Hi all,
I am currently working with auditory MMN data where each stimulus lasts for 300 ms with an interval of 500 ms. I plan to perform time-frequency analysis using epochs from -300 ms to 500 ms to investigate theta-band brain activity. In the time-frequency analyses, the signal was processed with a series of complex Morlet wavelets.
However, I have encountered an issue with baseline correction when performing wavelet transform. Given that the lowest frequency of interest is around 4 Hz (which corresponds to a period of 250 ms), baseline correction requires including at least one full cycle of this frequency. But in wavelet transform, Edge Effects of Windows would result in losing one cycle data.
Given this situation, does this mean that my data might not be suitable for time-frequency analysis? Are there alternative approaches or solutions for baseline correction in this scenario?
Any advice or suggestions would be greatly appreciated.
Thank you!
Best regards,
Elaine
  2 commentaires
Star Strider
Star Strider le 7 Sep 2024
What baseline needs to be corrected?
What sort of tiime-frequency analysis are you planning to do? (What function or functions are you intending to use?)
Elaine
Elaine le 8 Sep 2024
I want to carry out wavelet time frequency transformation (using Morlet wavelets) in matlab with following code
cfg = [];
cfg.channel = 'all';
cfg.method = 'tfr';
cfg.output = 'pow';
cfg.foi = 4:30;
cfg.toi = -0.3:0.001:0.5;
cfg.width = 3;
filename = 'F:\Example_data\1_LH.set';
EEG = pop_loadset(filename);
ft = eeglab2fieldtrip(EEG, 'preprocessing');
sub_tf = ft_freqanalysis(cfg,ft);
Since there are some background brain activities in the baseline, I want to remove any activity common to the average baseline time period allowing for TF power to be interpreted as levels of activity relative to the baseline period. But it's tricky to select the baseline window. the whole period of (-300,0)ms is not suitable. The baseline should stop before the stimulus onset (0 ms) for avoiding temporal smearing. Since the lowest frequecy I am interest in is 4Hz, the baseline window should start after -175ms and stop before -125ms, but a 50ms baseline is not long enough. So I am stuck in this issue and don't know whether time frequency analysis could be implemented with existing data.

Connectez-vous pour commenter.

Réponses (1)

William Rose
William Rose le 8 Sep 2024
Modifié(e) : William Rose le 8 Sep 2024
[Edit: fix spelling errors]
I understand that you want to do time-frequency analysis on EEG data evoked by auditory stimuli. Each stimulus lasts for 300 ms and there is a 500 ms gap between stimuli. You chop up the EEG data into 800 ms long epochs, starting 300 ms before each stimulus. You are investigating the mismatch negativity response. Perhaps you are investigating the ability of wavelet time-frequency analysis (wavelet TFA) to estimate the presence, or relative magnitude, of the MMN response. You want to include frequencies as low as 4 Hz in your analysis. You want to remove baseline variation, but you are concerned that removal of baseline variation will affect the frequencies of interest in the signal.
I recommend that you do a linear detrend of the time domain signal in each epoch, to remove the mean and linear trend, if any, from the baseline. Then apply a 1.5 Hz Butterworth high pass filter to the signal, to attenuate any remaining baseline variations at frequencies of 1.5 Hz and lower. This will not affect a 4 Hz component too much. I realize that in theory, a high pass Butterworth also removes the mean value and linear trend. In practice, you are likely to get better results if you detrend, and then apply a high pass filter. You can demonstrate this with synthetic signals.
You make two statements which I do not fully understand.
1."Given that the lowest frequency of interest is around 4 Hz (which corresponds to a period of 250 ms), baseline correction requires including at least one full cycle of this frequency."
I don't understand why "baseline correction requires including one full cycle". Any kind of frequency analysis requires at least one full cycle of the lowest frequency being analyzed, and the analysis will be more reliable if more than one full cycle is measured. I do understand that if you correct too much for possible baseline variation, you may reduce important low frequency components in your signal. Your epoch duration is 800 ms, which is more than 3 cycles of a 4 Hz signal. There are 500 ms (2 full cycles of 4 Hz) from stimulus onset to end of epoch. I think you are OK. More on that below.
2. "But in wavelet transform, Edge Effects of Windows would result in losing one cycle data."
I do not know enough about wavelet transforms to know if this is true. When you divide the signal into epochs with 800 ms duration, you are, in effect, applying an 800 ms long rectangular window to the signal. If you were doing Fourier analysis, the low frequencies in the spectrum would be 1.25, 2.5, 3.75, 5.0,... Hz, and I would not put much faith in the spectrum estimates at 1.25 and 2.5 Hz, due to the rectangular window edge effects and the presence of only one or two cycles in the epoch. But the wavelet transform is different; it uses logarithmically spaced frequencies, and the lowest frequency in the cwt() is higher than 1/(epoch duration). See examples below.
Matlab's cwt() includes the optional argument cwt(..., ExtendSignal=1) or cwt(..., ExtendSignal=0). The Matlab help says "If ExtendSignal is false, the signal is extended periodically. Extending the signal symmetrically can mitigate boundary effects." The Help also says the default is 1. I recommend experimenting with simulated data to understand the effect of this option on your data.
The frequencies in the CWT depend on what wavelet you select for analysis. I recommend the Morlet wavelet ("amor"), since it give the lowest low frequency of the three options. The actual lowest and highest frequencies also depend on the sampling rate. The frequencies do not depend on the ExtendSignal option value.
Example:
Te=0.8; % epoch duration (s)
Fs=1000; % sampling rate (Hz)
N=Te*Fs; % epoch duration (samples)
x=randn(1,N); % signal for analysis
[cw,f]=cwt(x,'amor',Fs); % compute cwt and vector of frequencies
disp(f([1,2,end-2,end-1,end])') % display highest and lowest freqs
368.2804 343.6178 4.0690 3.7965 3.5422
[cw,f]=cwt(x,'morse',Fs);
disp(f([1,2,end-2,end-1,end])')
434.1245 405.0525 4.7964 4.4752 4.1755
[cw,f]=cwt(x,'bump',Fs);
disp(f([1,2,end-2,end-1,end])')
454.4634 424.0293 14.2020 13.2509 12.3635
You can see from the results above that the lowest frequency is lower (3.54 Hz), and the spacing is finer, with the "amor" (Morlet) wavelet family. If you change the sampling rate (Fs), you will notice other changes.
  2 commentaires
Elaine
Elaine le 8 Sep 2024
Thank you so much for your prompt response and detaild explanation!
I will try the linear detrend and then apply a high pass filter to get rid of potential baseline variations .
As for the length requirement for the baseline correction and the edge effects in time frequency analysis, I have checked on the website of Brainstorm(Tutorials/TimeFrequency - Brainstorm (usc.edu) and also in the paper by Santiago Morales(https://www.sciencedirect.com/science/article/pii/S1878929322000111). It's said that the baseline should stop before the stimulus onset (0 ms) for avoiding temporal smearing. Since the lowest frequecy I am interest in is 4Hz, the baseline window should start after -175ms and stop before -125ms, but a 50ms baseline is not long enough.
Thanks again for your time and effort!
William Rose
William Rose le 8 Sep 2024
@Elaine, Thank you fo the additional information and links. You have educated me. I now think the situation regarding edge effects and baseline is even worse than you have stated, and that your protocol will not allow you to investigate frequencies as low as 4 Hz.
I now understand that, when you say you want to remove baseline variation, the way you do this is by measuring the power spectrum (using the cwt) before each stimulus, and comparing the baseline spectrum to the power spectrum after stimulus onset. My answer above was for removing low frequency drift from the signal, and does not address the duration of baseline required to do spectrum estimation at baseline.
The website you cited says here that the Morlet wavelet with 1 Hz center frequency has a FWHM of 3 s. Therefore a Morlet wavelet with 4 Hz center frequency has a FWHM of 0.75 s, and edge effects occur when one is withing half of the FWHM, i.e. within about 0.38 s, for a Morlet wavelet with 4 Hz center frequency. Does the wavelet transform (wt) returned by Matlab's [wt,f]=cwt() utilize a wavelet with 4 Hz center frequency to compute the 4 Hz value in the wt? I assume it does, but I am not 100% sure. Assuming it does, then you want 0.38 s on either side of your baseline estimation window, and the duration of the baseline estimation window should be at least 0.75 s, if you want to estimate frequencies as low as 4 Hz. Therefore th total pre-stimulus period would be (at least) 1.50 s = 0.38+0.75+0.37. You divide your epochs so that the pre-stimulus period is 0.30 s. Therefore, following the arithmetic above, the lowest frequency in the baseline spectrum which you should attempt to estimate is 20 Hz. (For a 20 Hz Morlet wavelet, FWHM=3 s/20= 0.15 s. YOu need 0.075 s on each side plus 0.15 in the middle = 0.30 s total baseline duraiton, which is what you have.)

Connectez-vous pour commenter.

Catégories

En savoir plus sur Continuous Wavelet Transforms dans Help Center et File Exchange

Produits


Version

R2023b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by