Closed mattansb closed 4 years ago
Hi Mattan,
Thanks :)
The output you're seeing is sensible behaviour, which I should document better :) The NAs are because the data at that point is essentially unresolvable with the settings you have. When you specify that the wavelets should be 10 cycles per frequency long, think about the length of data that requires: 10 cycles at 10 Hz is 1 second. The epochs in demo_epochs
are only ~650 ms long. The number of cycles is constant at each frequency, so the window scales in time according to frequency. 10 cycles at 20 Hz is 500 ms, so up at 20 Hz you can resolve quite a few timepoints even with ~650 ms epochs. If you drop the n_cycles - 3 or 4 is generally fine for frequencies < 30 Hz tbh, but wavelets are often used for gamma band where 7 cycles is pretty common - you'll see more going on lower down.
Basically, the function sets the output to NA whenever the window would extend beyond the temporal boundaries of the data. In principle, you could return values for those timepoints, as you can just zero-pad or whatever - but you get boundary effects etc, so it makes for unreliable estimates at those time points.
There's a point in the Fieldtrip tutorial on TFR that mentions these boundary effects too, and you can see the same behaviour there.
Cheers, Matt
Ah got it, so I'm just looking at the "edges" (that are NA) of the tfr data set.
Thanks!
Awesome package!
Hi Matt,
This is a really stellar package! Can't wait to see how far it goes (please help me and others never use Matlab again!)
I've been playing around with the functions, and I can't seem to access time-frequency data:
But it still seems to be plotting (something?):
Created on 2020-05-12 by the reprex package (v0.3.0)