Builds a null distribution for the group-average spectrum by resampling each subject series, then computes empirical p-values, z-scores, and optional FDR correction across frequencies.
Arguments
- x
numeric matrix with shape
subjects x bins, or a grouped-series object.- fs
sampling rate in Hz along the bin axis.
- flim
optional length-2 frequency bounds.
- null
null generator; one of
"shuffle_labels"or"circular_shift".- nrep
number of null draws.
- 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.- 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.- p_adjust
p-value adjustment; one of
"none"or"fdr".- fcor
logical; apply 1/f correction to each subject spectrum.
- seed
optional random seed for reproducible null draws.