temporal_filter: Temporal filtering (bandpass, highpass, lowpass) with DCT or...

View source: R/DCT_FFT_detrending.R

temporal_filterR Documentation

Temporal filtering (bandpass, highpass, lowpass) with DCT or FFT

Description

Temporal filtering (bandpass, highpass, lowpass) with DCT or FFT

Usage

temporal_filter(
  X,
  TR,
  hpf = 0.008,
  lpf = NULL,
  method = c("DCT", "FFT"),
  verbose = FALSE
)

detrend(X, TR, hpf = 0.008, method = c("DCT", "FFT"))

Arguments

X

A numeric matrix, with each column being a timeseries to filter For fMRI data, X should be T timepoints by V brain locations.

Alternatively, a single integer giving the number of timepoints in data. The return value will be the suitable set of DCT bases. Only works with method == "DCT".

TR

The time step between adjacent rows of X, in seconds.

hpf

The frequency of the highpass filter, in Hertz. Default: .008.

lpf

The frequency of the lowpass filter, in Hertz. Default: NULL (skip lowpass filtering). If both are provided, lpf > hpf must be true.

method

"DCT" (default) or "FFT". FFT is not compatible with lpf yet.

verbose

Print messages? Default: FALSE.

Value

Filtered X, or if X was an integer, the set of DCT bases to use for nuisance regression (not including an intercept).

Examples

temporal_filter(matrix(rnorm(700), nrow=100), TR=.72)

fMRItools documentation built on April 12, 2025, 1:32 a.m.