--
You received this message because you are subscribed to the Google Groups "AnalyzingNeuralTimeSeriesData" group.
To unsubscribe from this group and stop receiving emails from it, send an email to analyzingneuraltimes...@googlegroups.com.
Visit this group at http://groups.google.com/group/analyzingneuraltimeseriesdata.
For more options, visit https://groups.google.com/d/optout.
Thank you so much for helping us with this.I'm also copying a student in the lab on this email who is working with me on this.
What concerned me was most, was that this was not a short time FFT, but just an FFT (we're trying to look at resting alpha asymmetry).I figured that we might see some differences in rounding, but that overall, the results would correlate more than .7.I'm attaching my sample data and my code (The data is a 128x500*18 matrix called EEG).
My hope is that what is happening is that I'm scaling the results of the FFT in some nonlinear and inappropriate way, but I'm not sure if my way or the EEGLAB way is appropriate. I haven't been able to get a good grasp of the different ways to transform FFT results to estimate power, and I haven't found a good resource for understanding this step.
I also wonder if eeglab is doing some smoothing to the data? aside the the differences in scale, the plot of the spectral profile from eeglab is much smoother.
I'm attaching my code and the MAT file.Thanks again very much. We've already bought two copies of your book in the lab. It is tremendously clear and helpful.Best,Adam
--
You received this message because you are subscribed to the Google Groups "AnalyzingNeuralTimeSeriesData" group.
To unsubscribe from this group and stop receiving emails from it, send an email to analyzingneuraltimes...@googlegroups.com.
Visit this group at http://groups.google.com/group/analyzingneuraltimeseriesdata.
For more options, visit https://groups.google.com/d/optout.
To unsubscribe from this group and stop receiving emails from it, send an email to analyzingneuraltimeseriesdata+unsub...@googlegroups.com.
Visit this group at http://groups.google.com/group/analyzingneuraltimeseriesdata.
For more options, visit https://groups.google.com/d/optout.
Visit this group at https://groups.google.com/group/analyzingneuraltimeseriesdata.
Hi all,
We have a similar problem to those above in regard to reconciling results from pwelch and spectopo. We have tried ensuring our parameters are the same, and we have converted spectopo into mv.
Our spectopo code is:
[spectra,freqs] = spectopo(EEG.data,length(EEG.data),EEG.srate,'winsize',2500,'nfft',500,'overlap',1250); % Match Spectopo Parameters to PWELCH
spectra_mv = 10.^(spectra/10); % Convert Back to mV from dB
spectra_dmv = log10(1+spectra_mv); % Log Transform the Resulting PSD Matrix to Obtain Better Distribution
spectra_tdmv = spectra_dmv'; % Transpose Data
spectra_ftdmv = spectra_tdmv(1:40,:); % Extract FREQRANGE 1:40
clear spectra freqs spectra_mv spectra_dmv spectra_tdmv
Our personal pwelch script uses:
EEG_test1093 = EEG.data'; % transpose
restEEG = EEG_test1093; % identify the experimental data you are working with
fs=500; %sampling rate
window=2500; %at a sampling rate of 500hz, 2500samples is 5 sec
freqrange=1:40; %identify the frequency range you want to extract PSD in
computing the ERD across 1:fqs
% calculate PSDs useing pwelch.m
[restPSD,freqs]=pwelch(restEEG,window,[],freqrange,fs); % the [] is to signal the default of 50% overlapping window
% log transform the resulting PSD matrix to obtain better distribution
restPSDlog=log10(1+restPSD); % takes the natural log
PSDlog_test1093 = restPSDlog;
clear fs EEG_1093RS restEEG freqrange restPSD restPSDlog window
When searching in spectopo, we noticed that pwelch is used in a for-loop to perform multiple pwelch calculations (spectopo lines 912-974) - however our script performs only one calculation. Additionally, it seems as though spectopo has deconstructed the EEG.data structure, and reconstructs it after performing the pwelch calculations (using the matsel function in the pwelch line). Lastly, we have noticed that transposing data occurs at different times in the calculations.
Most importantly, is our pwelch calculation correct? And if possible, can you help us understand why the results are different?
We have attached the code.
Much thanks in advance.
Courtney