Computes the Short-Time Fourier Transform (STFT) spectrogram for multi-channel EEG data. Uses a sliding window with configurable overlap and window function to produce a time-frequency power representation.
Usage
eegSTFT(
x,
window_sec = 0.5,
overlap = 0.75,
window_type = c("hanning", "hamming", "rectangular"),
assay_name = NULL,
output_assay = "stft_power"
)Arguments
- x
A PhysioExperiment object with EEG data (2D: time x channels).
- window_sec
Window length in seconds (default: 0.5).
- overlap
Overlap fraction between adjacent windows, from 0 to 1 exclusive (default: 0.75).
- window_type
Window function to apply:
"hanning","hamming", or"rectangular"(default:"hanning").- assay_name
Name of the input assay. If
NULL, the default assay is used.- output_assay
Name of the assay to store STFT power results (default:
"stft_power").
Value
Modified PhysioExperiment with:
3D power array (time_bins x frequencies x channels) in
output_assayTime bin centers, frequency vector, and parameters in
metadata(x)$stft, a list containingtime_axis,freq_axis,window_sec,overlap,window_type,window_length, andhop_size