dsa_fft: performs an FFT on behavioral data

Description Usage Arguments Author(s)

View source: R/dsa_fft.R

Description

dsa_fft A function to compute the fft results for a time series (especially dense sampled behavioral data). By default, dsa_fft will treat the data so that each column is considered one timepoint and computes all steps by row. If your input data is organized with time = rows, change time argument to 'row'. Both sampling frequency and desired frequency resolution (Bin width per frequency bin of FFT) needs to be in Hz.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
dsa_fft(
  data,
  time = "col",
  detrend = "linear",
  window = "tukey",
  scaling = "z",
  padding = "zeros",
  desired_res = 1,
  sfreq = 25,
  desired_out = "amp",
  single_sided = T,
  out = "mod",
  alpha = 0.1,
  verbose = T
)

Arguments

data

requires the dataframe

time

are timepoints across columns or rows? default = "col"

detrend

Detrending the data (default = 'linear', also available: 'dc', '2ndorder' or 'none')

window

Windowing whole time series (default = 'tukey', also available: 'hanning', 'none')

scaling

Rescaling the data (default: 'z' for z-transform, also available: 'none' )

padding

Padding the data (default: 'zeros' for zero-padding, also available: 'mean', 'none')

desired_res

Padding the data up to desired_res (automatically evaluates necessary number of pads to achieve the resolution, default = 1)

sfreq

sampling frequency of inserted datapoints

desired_out

Extract amplitude values (default: 'amp', also available 'power' or 'logPower')

single_sided

Single-sided frequency spectum (default = T)

out

By default, output is Mod (Amplitude) of the signal. Change to 'arg' to get phase or 'complex' to get the complex output.

alpha

only for tukey window

verbose

T/F

Author(s)

Rene Michel


remichel/rmTools documentation built on Dec. 11, 2021, 6:59 a.m.