This repository contains all data, experimental scripts, and analysis scripts for the experiment reported in:
Bouwer, F. L., Fahrenfort, J.J., Millard, S.K., Kloosterman, N.A., & Slagter, H. A. (2023). A Silent Disco: Differential Effects of Beat-based and Pattern-based Temporal Expectations on Persistent Entrainment of Low-frequency Neural Oscillations. *Journal of Cognitive Neuroscience*, 35(6), 990–1020. [https://doi.org/10.1162/jocn_a_01985][1]
Note: the paper is available as a preprint (identical to the published version) on bioRxiv, see https://www.biorxiv.org/content/10.1101/2020.01.08.899278v3
If you would like to use these data in your own work, please cite both the data (from this repository), and the paper.
The experiment was run in Presentation (www.neurobs.com). The analyses were performed using Matlab, and R, and the EEGLAB, FIELDTRIP, MMSE, and ADAM toolboxes in Matlab.
# Content
## Experiment scripts
All scripts and sound files to run this experiment in Presentation, for both the behavioral and EEG experiment. Please adjust accordingly (you need to point the experiment file to the right scenario files).
## Raw data
### Behavioural data
- Raw data can be found in 2 zip-files (1 for each experiment).
- Filenames for Experiment 1: “p[PP number]-Probe task [filenumber].log”. There are 6 files for each participant. Files for participants that had English explanation are appended with EN.
- Filenames for Experiment 2: “E[PP number]-EEG task [filenumber].log”. There are 2 files for each participant. Files for English-speaking participants are appended with EN.
- For information on the codes in the logfiles, see the Presentation scripts for running the experiment
- GMSI scores for all participants can be found in the csv files; only the musical training sub scale was included
### EEG data
- Can be found in the linked Figshare item.
- There is 1 file for each participant
- For explanation of the trigger codes, see the data acquisition and analysis scripts
## Data analysis
### Behavioural data
- To convert the Presentation logfiles into easy-to-read txt, run the Matlab scripts Behavioral.m (for Experiment 1) and Behavioral_from_EEG.m (for Experiment 2)
- Output is ratings.txt with 4 columns: pp (id), condition (beat = 1, memory = 2, random = 3), position (1:6 for Experiment 1 and 4:6 for Experiment 2) and response (rating from 1-4)
- Cleaning_behavioral_data.R; input is the ratings.txt file and the GMSI files; outputs all_data.RData (for the ordinal regression) and Behavioral.RData (for comparing behaviour to the EEG data, see in that folder)
- Ordinal_regression_behavioral_data.R; runs the ordinal regression; outputs all the files in the Ordinal regression folders, with stats from the models
- Plotting_behavioral_data.R; creates the plots for the paper (which were edited a little bit in Illustrator to enhance the colours etc.); outputs files in the Pics folders, which were used for Figures 3 & 4
### Stimulus
- wav file of the woodblock sound (woodblock.wav)
- Script to generate spectrum (stimulus_analysis.m)
- Output of the script: entrainmentstims.mat, with the fftpower (3 conditions, 10 sequences, frequencies), freqs2use (array with frequencies for plotting) and seq_names (condition names for plotting)
- This code and files was used for Figure 2
### EEG
#### Preprocessing
- Preproc.m; script for organizing the BDF files into EEGLAB format. Also removes bad channels, runs ICA, and removes blinks.
- deletebreaks.m; gets rid of stretches of bad data, and recodes the events so everything lines up nicely for subsequent analyses (dependency of Preproc.m)
- Some variables and indices are saved in the stats.mat file (like which ICs to remove to remove blinks)
#### Dependencies
- Some miscellaneous scripts used for the analysis and plotting
#### CNV
Silence:
- erps.m; script for making ERPs, see the script for more details
- Output has ERPs for all conditions, grand averages, outcomes of the permutations tests, and txt files with the amplitudes to compare musicians and non-musicians with the R script for individual differences. See all Matlab scripts for more details.
- Used to make Figure 5 and Figure S1
Control:
- Additional analyses were done as requested by one of the reviewers. These can be found in the script revision_ERPs.m. These were used to create Figure S1.
#### Frequency tagging
Power:
- fourier_on_silence.m; script to do the frequency tagging analysis, see script for more details
- Output has outcome of the fft (mat file), permutation testing results (mat file), and power values extracted in a txt file for input into the R script to make figure 7 and for the analysis on individual differences
- Used to make Figure 6
- Fourier.R; script to create dataset to compare musicians and non musicians and to plot individual data; outputs Fourier.RData for this purpose.
- Used to make Figure 7
Phase:
- Additional analyses were done as requested by one of the reviewers. These can be found in the script revision_phase_on_FFT.m. Used to create Figure 6B.
#### Decoding
- Decoding_on_silence_highpass_filter.m; script used to do the decoding analysis and create Figure 9
- Decoding_within_condition.m; script used to do the decoding within condition; output is a txt file with for each participant decoding accuracy and a .mat file with the group level decoding results (not reported in the paper, as this was for looking at the individual data)
- Decoding.R; script to make Figure S4, and to create dataset to compare musicians and non musicians; outputs Decoding.RData for this purpose.
- This script also runs some stats on the within condition decoding, as per the txt files with stats results.
#### MMSE
- mmse.m; script to compute entropy
- Output is results from the permutation tests, grand averages for all conditions, and txt files with values for entropy and similarity bounds for each participant and condition to compute group differences
- Used to create Figure 8, Figure S2, and Figure S3
- MMSE.R; script to create a small dataframe to compare musicians and non musicians; Outputs MMSE.RData.
#### Behaviour meets EEG
- Ind.diffs.R; loads all EEG data extracted from Matlab, and compares musicians and non musicians.
[1]: https://doi.org/10.1162/jocn_a_01985