f1

Compute F1 (or higher order, e.g., F2) and DC response metrics for periodic stimuli, such as drifting gratings. This works for spike data (rtype 0) and "continuous" data (rtype 1).

The amplitude is 1 for a perfect sine function that goes from -1 to 1. The phase will be 0 degrees for cos(x), and -90 for sin(x). Thus, when a cosine function is shifted rightward, the phase will go from 0 to -180, and will then jump to +180 and come back to zero. The phase values are relative to the start of the data window, thus the first data point in the window is at x=0.

Note, if a data segment is analysed that has a length that is not a multiple of the cycle length, then the phase and amplitude values can be inaccurate. To limit the analysis duration, "period", the full_cycle_flag is set to its default value of 1 (see below).

Output types

Parameters

Examples are given below.

Example - appending statistics to an outfile

f1
group 0
stat

chan gx0

start 0
period 1000           # Period will be automatically adjusted downward
                      # to be an integer multiple of the cycle length
                      # if "full_cycle_flag" is 1

full_cycle_flag  1    # Adjust analysis duration to multiple of the cycle
f1_param tf           # Name of temporal frequency parameter 

Example - writing trial data to outfile

#
#  write data
#
f1
group 1 contrast
data

f1_param tf1