freqanalysis_wltconvol.m

Markus Siegel m.siegel at UKE.UNI-HAMBURG.DE
Mon Oct 9 11:05:27 CEST 2006


Hi Brian,

On Oct 7, 2006, at 12:04 AM, Brian Roach wrote:

> Here is my example:
> 1000Hz sample rate for the acquired data
> 4000ms epochs centered on an event (-2000ms before the event to
> 1999 after the event)
>
> cfg =
>
>     output: 'pow'
>     method: 'wltconvol'
>        foi: [1x60 double]
>      width: 6
>     gwidth: 3
>        toi: [1x1000 double]
>
> where foi is 1 to 60Hz (in 1Hz steps), and toi is -.5s to .5s (in
> 1ms steps)
>
> I like that 1Hz is not plotted (NaN) values, since you cannot get 6
> cycles of 1Hz data in my 4s epoch size.  Having run this, I am
> still uncertain about how gwidth influences the data.  Does a
> smaller gwidth just widen the bell curve of the gaussian envelope?
> Is there a trend, such as the higher the gwidth, the better the
> time resolution (because the wavelet has a sharper rise and fall
> time)?

cfg.gwidth does not influence the width of the gaussian envelope and
thus does not have an effect on the temporal or spectral resolution.
The cfg.gwidth parameter determines the length of the morlet-wavelet
but not its shape. The gaussian envelope implies that the wavelet
tails converge towards zero but are not really zero at the edges.
Thus one has to decide where to crop the wavelet-kernel. The gwidth
parameter determines the cropped length in standard deviations of the
gaussian envelope. For cfg.gwidth = 3 the morlet-wavelet is thus
estimated for the central +/- 3 standard deviations of the gaussian
envelope. Hence, smaller gwidth parameter lead to edges of the
wavelets that become more "non-zero" which lead to stronger edge
effects and more noisy picture of your time-frequency transform. Run
your analysis with the above parameters but cfg.gwidth = 1. If you
compare the output to that of cfg.gwidth = 3 this effect should
become clear.

> In my case, does sf = 2Hz/6Hz or 1/3Hz?  I don't think I have these
> values right, and since they influence temporal domain and spectral
> bandwidth, it is important that I know what is right.  It seems
> like if my interpretation of your e-mail is correct, then each
> frequency bin consists of that frequency +/-.167 or (1/6) Hz.  In
> my example above, my 2Hz value would then consist of data from
> 1.8333 to 2.1667Hz.  This would mean that there are gaps in the
> spectral data and a smaller number of cycles or smaller width would
> lead to larger bandwidth (i.e. decreasing frequency resolution).
> What do you think?

The spectral bandwidth of your time-frequency tranform is not
constant but a function of frequency. For your example, the spectral
bandwidth (in standard deviations, Hz) is computed as:

bandwidth = cfg.foi ./ cfg.width;

For a constant cfg.width, the spectral bandwidth increases linearly
with the frequency of interest. While at 18 Hz you have a spectral
bandwidth of 3 Hz, the bandwidth at 60 Hz is 10 Hz.

> Also, does fieldtrip have a function that gives "phase locking
> factor" or inter-trial coherence (ITC)?

Not that I know. However, you could compute ITC yourself based on the
complex output from freqanalysis_mtmconvol run with cfg.output =
'fourier'.

Best,
Markus



More information about the fieldtrip mailing list