===== Spectral Event Pipeline ===== Please refer to the [[https://github.com/LabNeuroCogDevel/7T_EEG/tree/main/Functions/spectral_event_functions | LNCD Github Repository]]\\ Spectral data were computed for every electrode from the 3000 – 4000 ms window of the delay epoch of the task to avoid artifact from preceding eye movements and preparation from an imminent response, and from the 1 second inter-trial fixation epoch. The spectrograms of the data were calculated from 20 to 70 Hz by convolving the signals with a complex Morlet wavelet (Qin and Shen, 2000) with 7 cycles (Shin et al. 2017). Time-frequency representations of power (TFR) were calculated as the squared magnitude of the complex wavelet-convolved data. The TFR was normalized to the median power value for each frequency band, derived from all the power values within the identified stimulus windows of the delay and fixation epochs. Normalized TFR values were calculated in factors of median (FOM) for each frequency, separately for each participant/trial. === To run the spectral events pipeline on all channels averaged together === * RunSpectralEvents.m * Set desired task (Resting_State, MGS, SNR) * Set epoch (Delay or Fix; only is running resting state) * Set seconds; only if running delay epoch * Set band to analyze (gamma, beta, theta, alpha) * Pull subjects from the preprocessed folder * Create the X matrix (createXmatrix.m) that organizes the data in the correct format that the spectral event code expects * Creates an array of values corresponding to the trigger values, called classLabels * Defines event band and frequency values based on which band you're running * Runs the spectral event toolbox, see Spectral Event Toolbox * Saves out large structs of the subjects spectral event data * SpectralEvents_Struct_Extraction.m * Initialize task, epoch, and band * Load in the structs * Extracts out the Event Number, Power, Duration, Max Power, and Max Frequency and generates the average of each * Crates a large table with all the subjects data \\ === To run the spectral events pipeline on each individual channel === * RunSpectralEvents_IndividualChannels.m * Same as above but on every channel * Calls createXmatrix_individualChannels.m * SpectralEvents_Struct_Extraction_IndividualChannels.m * Same as above \\ ====Backlinks ==== {{backlinks>.}}