Back to the main page.

Bug 1503 - apply phase rotation for multitaper in ft_spike spiketriggeredspectrum

Status ASSIGNED
Reported 2012-06-04 11:26:00 +0200
Modified 2012-06-06 12:10:11 +0200
Product: FieldTrip
Component: spike
Version: unspecified
Hardware: PC
Operating System: Mac OS
Importance: P3 normal
Assigned to: Martin Vinck
URL:
Tags:
Depends on:
Blocks:
See also:

Martin Vinck - 2012-06-04 11:26:48 +0200

Multitapering rotates the phases relative to the LFP. We should explicitly correct for this rotation.


Robert Oostenveld - 2012-06-04 11:59:51 +0200

it is of primary importance to have the (desired and therefore hopefully implemented) phase correctly defined. Does a phase of 0 degrees mean that the spike is at the peak of the oscillation? If the phase is -45 degrees, does that mean that the spike is prior to, or after the peak? This definition should be available to the users in the documentation of the function.


Martin Vinck - 2012-06-04 12:03:03 +0200

This is documented in the help of the spiketriggeredspectrum function. A phase of zero corresponds to the peak of the oscillation. A phase of 180 degree corresponds to the through of the oscillation. A movement in the counterclockwise direction corresponds to later phases.


Robert Oostenveld - 2012-06-04 12:06:54 +0200

good that it is already there! I suggest to rephrase it into A phase of zero corresponds to the spike being on the peak of the LFP oscillation. A phase of 180 degree corresponds to the spike being in the through of the oscillation. A phase of 45 degrees corresponds to the spike being just (before/after?) the peak in the LFP.


Martin Vinck - 2012-06-04 12:16:16 +0200

ok I have taken over these exact sentences in put them in the help of the main spiketriggeredspectrum and _fft and _convol implementation In my view the phase rotation of multitapering can be determined by passing a cosine signal centered around the spike and determining the phase offset induced, as the system is linear. Agree?


Robert Oostenveld - 2012-06-04 12:23:36 +0200

(In reply to comment #4) > In my view the phase rotation of multitapering can be determined by passing a > cosine signal centered around the spike and determining the phase offset > induced, as the system is linear. Agree? Agreed.


Martin Vinck - 2012-06-04 13:28:07 +0200

(In reply to comment #5) Added the taper correction for ft_spiketriggeredspectrum_convol.m I've tested the phase distortion induced and it's quite small in the tested cases (0.01 rad), and indeed zero for a symmetric taper. Needs to be added to ft_spiketriggeredspectrum_fft.m as well


Robert Oostenveld - 2012-06-04 18:01:38 +0200

(In reply to comment #4) In the help on the definition the question mark needs to be removed and only before or after should be stated. Imagine explaining a picture with a sine wave, and three spikes sitting on top of it. Where would the 45 degree spike be?


Martin Vinck - 2012-06-04 21:27:34 +0200

(In reply to comment #7) ok, fixed this


Roemer van der Meij - 2012-06-05 05:37:27 +0200

Good idea. The convention described here is the same as I implemented in specestmtm_convol, peak at 0, going counterclockwise Added JM: JM, shall we do this phase rotation correction for mtmconvol as well? Or would you say we already do this implicitly by using the current convention enforcement?


Martin Vinck - 2012-06-05 07:39:11 +0200

(In reply to comment #9) Can I ask what is the convention enforcement? For the crsspctrm output it doesn not matter of course because you rotate both fourierspctra in the same fashion, but for the fourierspctra it does.


Roemer van der Meij - 2012-06-06 09:29:42 +0200

(In reply to comment #10) In very short, i made it such that, at the centre of the wavelet, the cosine is at its peak and the sine is at amp=0 in its upgoing flank. This is irrespective of wavelet length. (Can write a more detailed reply later if you want, traveling atm)


Martin Vinck - 2012-06-06 12:10:11 +0200

(In reply to comment #11) This convention ensures zero phase for a cosine input, but I'd think it doesn't take care of the rotation.