What is the equivalent (or similar) of newtimef (EEGLAB toolbox) in the Wavelet toolbox?
9 次查看(过去 30 天)
显示 更早的评论
Hi all,
I am trying to work on a comparison between Wavelet toolbox and the open source EEGLAB toolbox. I found out that cwt() would give me the best chance of getting what newtimef() returned in EEGLAB.
However, it is still unclear to me on how to get a matrix of log spectral diffs output after cwt.
Any help or pointer would be much appreciated.
Thank you,
P/s: here is my attempt at cwt
% data is a row vector of EEG data
[cfs,f] = cwt(data,'amor',250);
0 个评论
回答(1 个)
Jaynik
2023-9-28
Hi Tyler,
I understand that you are trying to find the equivalent method for the “newtimef” method present in the EEGLAB toolbox from the Wavelet Toolbox and want to perform log spectral difference on the output.
The "cwt" function and the “newtimef” function can both be used for time-frequency analysis; they use different algorithms and provide different representations. They are not equivalent in terms of the specific implementation and the resulting outputs.
The code you have written for performing Continuous 1-D Wavelet Transform is correct.
[cfs, f] = cwt(data, 'amor', 250);
The code above uses an analytic Morlet wavelet, and the sampling frequency is set to 250. To perform the log spectral difference on the coefficient matrix “cfs”, you can do the following:
log_cfs = log(abs(cfs));
log_spec_diff = diff(log_cfs, 1, 2);
Here, “log_cfs” calculates the natural logarithm of the coefficients, and “log_spec_diff” calculates the difference between adjacent elements along the second dimension (columns) of the matrix to obtain the log spectral difference.
Refer to the following link to learn more about the “diff” function:
Hope this helps!
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 EEG/MEG/ECoG 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!