Skip to contents

Generates a set of Fourier basis functions (sine and cosine pairs) over a given span.

Usage

hrf_fourier(t, span = 24, nbasis = 5)

Arguments

t

A vector of time points.

span

The temporal window over which the basis functions span (default: 24).

nbasis

The number of basis functions (default: 5). Should be even for full sine-cosine pairs.

Value

A matrix of Fourier basis functions with nbasis columns.

Examples

# Create Fourier basis with 5 functions
t <- seq(0, 24, by = 0.5)
basis <- hrf_fourier(t, span = 24, nbasis = 5)
matplot(t, basis, type = "l", main = "Fourier Basis Functions")