Back to the main page.
Bug 1739  ft_specest_mtmfft: rework description and implementation of angletransform
Status 
ASSIGNED 
Reported 
20120925 13:58:00 +0200 
Modified 
20130118 10:43:49 +0100 
Product: 
FieldTrip 
Component: 
specest 
Version: 
unspecified 
Hardware: 
PC 
Operating System: 
Windows 
Importance: 
P3 enhancement 
Assigned to: 
Roemer van der Meij 
URL: 

Tags: 

Depends on: 

Blocks: 

See also: 

Roemer van der Meij  20120925 13:58:43 +0200
Rework the description and implementation, and change the respective FAQ question. The current description is not correct, the implementation is a bit unintuitive, although the result reflects the original purpose.
Being:
In an FFT, the phase of any fourier coefficient can be described as the initial phase (i.e. the phase at the first sample) of the bestfit cosine of that particular frequency with the data.
In our data, the timepoint of the first sample can be different over trials. To make the absolute phases of our fft interpretable, each trial/freq needs to be phaseshifted, such that the phase of a particular frequency reflects the phase at t=0 of the best fit cosine to the data (our chosen convention).
In a simple example: if a perfect 2Hz oscillation is at it's peak at t=250ms, without a phaseshift, the phase of the 2Hz coefficient would be:
 trial starts at 0ms > +/ pi
 trial starts at 125ms > pi/2
 trial starts at 125ms > pi/2
 trial starts at 250ms > 0
 trial starts at 500ms > +/ pi
After phaseshift it will be:
 trial starts at 0ms > +/ pi
 trial starts at 125ms > +/ pi
 trial starts at 125ms > +/ pi
 trial starts at 250ms > +/ pi
 trial starts at 500ms > +/ pi