View source: R/brain_sense_spectrogram.R
| brain_sense_spectrogram | R Documentation |
This function generates spectrograms for Medtronic BrainSense time-domain signals across one or more data passes. Optionally, the user can select specific passes to plot, filter by frequency band, save the plots, and extract the underlying spectrogram data.
brain_sense_spectrogram(
dataset = NULL,
wl = 512,
ovlp = 75,
collevels = seq(-80, 0, by = 0.2),
save_as = NULL,
output_dir = getwd(),
passes = NULL,
band = NULL
)
dataset |
A JSON-like object (e.g., parsed with |
wl |
Integer. Window length for FFT. Default is 512. |
ovlp |
Numeric. Overlap percentage between successive windows. Default is 75. |
collevels |
Numeric. A sequence of color levels for the spectrogram image (in dB). Default is |
save_as |
Character. File format to save plots ("png", "pdf", or "jpeg"). If NULL (default), plots are not saved. |
output_dir |
Character. Path to the directory where plots will be saved. Default is current working directory. |
passes |
Integer vector. Indices of passes to plot (e.g., |
band |
Character. One of "Delta", "Theta", "Alpha", "Beta", "Gamma". If provided, filters signal to this frequency band before generating the spectrogram. |
WARNING: This function may be computationally intensive and take significant time to execute. Please wait until all plots are rendered.
A list of data frames (invisible). Each data frame corresponds to one spectrogram and contains:
Time in seconds
Frequency in Hz
Spectral power in dB
Channel label
Pass index (i)
brain_sense_spectrogram(dataset, passes = c(2), band = "Beta")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.