Computes per-subject spectra and their group average for a regular matrix of subject-by-bin values or a grouped-series object.
Arguments
- x
numeric matrix with shape
subjects x bins, or a list with fieldsdata,subjects, andbins.- fs
sampling rate in Hz along the bin axis.
- flim
optional length-2 frequency bounds.
- detrend
logical; if
TRUE, remove a linear trend from each subject series before spectral estimation.- detrend_order
non-negative integer polynomial order used when
detrend = TRUE. The default1removes a linear trend, while higher orders remove higher-order polynomial structure.- pad_to
optional FFT length used for zero-padding each subject series before spectral estimation.
- spectrum
spectrum scaling passed to
spectral_peak.- taper
taper passed to
spectral_peak.- average
logical; if
TRUE, include the group-average spectrum.- fcor
logical; apply 1/f correction to each subject spectrum.