Multitaper method

hi Francois,

I'm replicating some results from a previous analysis in Fieldtrip in Brainstorm,
I did a multitaper time-frequency analysis and I have some doubts about the settings in Brainstorm,

I previously computed power in Fieldtrip by setting:

cfg.foi = 30:2.5:120; as frequencies of interest
cfg.toi = -1.05:0.05:2; as times of interest

cfg.t_ftimwin = ones(length(cfg.foi),1).* 0.4; as fixed time windows of 400 ms
cfg.tapsmofrq = ones(length(cfg.foi),1).* 20; 20 Hz as fixed frequency smoothing

Is not clear for me how I should translate this into BS,
Time step should be 5 ms?
Time resolution should be 400 ms, for me?

I'm not sure about the explanation:
tapsmofrq = frequencies / modulation_factor

But since I decide to have a constant smoothing factor this should be 20 Hz, right? or 0.05?

I was also wondering if there any way to set a pad parameter,
In Fieldtrip I did cfg.pad = 'nextpow2' to get integers in my power time series, it could nice to do it in BS as well,

One last question, I'm replicating my results but I already know I have some effects between 70-95 Hz, could I simply do 1 big calculation between 70 and 95 Hz without affecting the results I got before?

Thanks for any hint,

José

Hi José,

Not all the options in the FieldTrip function are available in the corresponding Brainstorm process. We hardcode some (less sensitive) parameters in order to decrease the complexity of the interface and the risks of manipulation errors. Many Brainstorm users would not understand what all these parameters mean and would not set all these values correctly. The simplication of the parameters that is proposed here is inspired from the one in SPM12 function:
https://github.com/spm/spm12/blob/master/spm_eeg_specest_mtmconvol.m

The Brainstorm version of this parameter definition:
https://github.com/brainstorm-tools/brainstorm3/blob/master/toolbox/timefreq/bst_timefreq.m#L549

Time step should be 5 ms?
Time resolution should be 400 ms, for me?

It looks like this is correct.

tapsmofrq = frequencies / modulation_factor
But since I decide to have a constant smoothing factor this should be 20 Hz, right? or 0.05?
In Fieldtrip I did cfg.pad = 'nextpow2' to get integers in my power time series, it could nice to do it in BS as well,

With the Brainstorm or SPM12 versions of this multitaper, you won't be able to set these two parameters as you want. If you really want to modify these values, we'd have to think of another solution. If you would like to help us improve the Brainstorm access to the FieldTrip multitaper, one solution would be to add hidden parameters to the process function process_ft_mtmconvol, and use them in bst_timefreq if they are defined (instead of recomputing them with the Brainstorm/SPM logic).
If you'd like to propose any modification to the code, please open a new PR on the Brainstorm github repository.

One last question, I'm replicating my results but I already know I have some effects between 70-95 Hz, could I simply do 1 big calculation between 70 and 95 Hz without affecting the results I got before?

I'm not sure what your concern is. Can you explain with more details your question?

François

Hi Francois,

Thanks for you feedback,

The Brainstorm version of this parameter definition:
https://github.com/brainstorm-tools/brainstorm3/blob/master/toolbox/timefreq/bst_timefreq.m#L549

Ok, from here it looks like something is done to keep the time axis uniform, that's ok for and I not need the nextpow^2

Time step should be 5 ms?
Time resolution should be 400 ms, for me?

It looks like this is correct.

Ok, thanks

tapsmofrq = frequencies / modulation_factor

But since I decide to have a constant smoothing factor this should be 20 Hz, right? or 0.05?

With the Brainstorm or SPM12 versions of this multitaper, you won't be able to set these two parameters as you want.

You mean I cannot set the smoothing constant, say, 10 Hz or something?
So, if I set a modulation_factor of 10 what would do this? As a frequency increases the smoothing increases by a factor of 10, right?

So I guess what I could do is to restrict my analysis to a FOI of 70:2.5:100,
Then with a modulation_factor of 4 my smoothing would go from 15.5 to 25, is that correct?

One last question, I'm replicating my results but I already know I have some effects between 70-95 Hz, could I simply do 1 big calculation between 70 and 95 Hz without affecting the results I got before?

I'm not sure what your concern is. Can you explain with more details your question?

There are always spectral leakage in TF. I was wondering if with the multi-taper method which involve smoothing this could be more important. Say, if before I found something when looking between 30 and 120 Hz, if I recompute looking only between 70 and 95 Hz I would lose some signal the before contributed to my effects. I guess I can just try it,

Thanks for your help!
José

Correct.
If you doubt about what is done in the computation, put a breakpoint at line 570 in bst_timefreq.m (click on the left of the line in the Matlab editor) before calling the process from the Brainstorm interface, then explore the contents of the variables.