Print

Print


I am analyzing intracranial EEG data, using the spm_eeg_tf.m command for time-frequency decomposition. I'm experiencing a puzzling issue where the output power amplitude values that are being stored in the M/EEG object seem to have a ceiling value such that any estimate above that value becomes the ceiling value. I'm finding this issue when performing TF analysis with both epoched and continuous data. I've also found it across multiple SPM versions, operating systems (Linux/Ubuntu/Mac), Matlab versions (2013-2018), and types of TF analysis (e.g. Morlet wavelet, Hilbert transform).

I dug into the spm_eeg_tf function and found that my issue seems to arise at line 151 (for epoched data) or 224 (for continuous data): 
Dtf(:, :, :, k) = trial.fourier.*conj(trial.fourier);

The left side of the equation seems to be storing the power amplitude values at a given frequency into a new SPM M/EEG object, whereas the right side seems to contain a vector of the raw power amplitude estimates. However, when I plot the left and right sides of this equation separately (e.g. attached, for estimating power at 1 Hz for either epoched or continuous data), the plots look different. Specifically, within the object (but not within the raw estimate), it seems that any value above exactly 3199.9 gets assigned to that ceiling value. I don't know where the value 3199.9 comes from or how the ceiling is being set. For the epoched data, there are exactly 3201 time points in each epoch, but I also ran the continuous TF analysis independently and still got a 3199.9 ceiling (across multiple machines, SPM versions etc.), and the value is also exactly 3199.9 when I use a different epoch length.

One possible solution that I thought of was to divide the correct estimates by a constant so that nothing exceeds the ceiling value -- and then store into the M/EEG object. When I do that, the problem gets fixed for some frequency bands but not for others, which still seem to have some arbitrary ceiling and floor values.  

Overall, it seems that I am having a problem with the transform between raw power amplitude estimates and what is stored in the M/EEG object, perhaps because the object somehow developed some type of preset restrictions?

I'd much appreciate any insight and could provide more detail if helpful.

Regards,

Aaron