Skip to content

Conducting a Recording

jalevitt edited this page Jan 22, 2024 · 4 revisions

CONDUCTING A RECORDING WITH LLAMAS


This page with give you directions for how to set up and complete a recording with LLAMAS.

  1. SETTING UP EQUIPMENT

LLAMAS does not have any ability to check EEG impedances, so you should use Recorder (for BrainVision equipment) to check impedances before you begin. If you are recording in the MR scanner, we recommend checking impedances before each new recording for safety reasons. The equipment cannot be connected to both Recorder and the LSL app at the same time, so you will need to switch between them.

The Kalman filter built in to LLAMAS for BCG artifact removal is dependent on the use of an EEG reference layer. For instructions on how to build one and use one please see 1, 2, and 3, especially the supplement.. If you do not plan to use the Kalman filter, then you don't need a reference layer. Note that we have added an option to use a Kalman filter without needing a referencing layer (Kalman_cwl) and instead using carbon wire loops. This has not been validated as thoroughly, so please use at your own risk.

Before you begin your recording, you need to make sure that all your equipment is properly configured and that data is streaming into an LSL stream. Assuming you are using BrainVision/BrainProducts equipment, we recommend the BrainAmp LSL app to get your data into LSL, although other solutions exist. To test that this is stream is available in MATLAB, you will need the MATLAB LSL bindings, and you can search for a stream by entering into your MATLAB command line:

>> lib = lsl_loadlib(); result = lsl_resolve_byprop(lib,'type','EEG');

If the variable 'result' is non-empty, then there is an LSL stream for LLAMAS to open. If it is empty, then you need to troubleshoot why your LSL stream is not available.

  1. SETTING UP LLAMAS

To open a new LLAMAS window, enter >> EEG_LLAMAS into your MATLAB command line. Before you begin a new recording, you should double check all your settings. Please see the Interface page of the wiki for info on how to choose settings. It is very likely that you will want the updateMainWindow option selected to plot the data in real time, and Kalman_chunk to remove BCG artifacts if you are in the MR scanner.

You should also make sure that you have navigated to your EEG_LLAMAS folder within MATLAB, or else you should use the 'Set Path' button to choose a new default path.

  1. STARTING A RECORDING

Once you have set up equipment, checked impedances, created an LSL stream, and confirmed your settings, you can begin a new recording. To do this, press 'Begin Recording.' You will see several lines of text output in your MATLAB command window. If MATLAB hangs after printing 'Resolving an EEG stream...' then LLAMAS is having trouble finding an LSL stream, and it is likely that you need to double check the availability of your LSL stream.

There will likely be a pause of several seconds, and then data will begin streaming into the Streaming Figure Window (assuming you have updateMainWindow selected as an option). You may hear a series of 5 clicks from your computer at the beginning of your recording, if you have PsychToolBox installed. This is to test that audio output is working properly, and can be commented out if desired.

During your recording, you may see integers being continuously printed into you MATLAB command window. This is a display of your chunk size, i.e. how many samples are being received at once from LSL at your downsampled frequency. This allows you to monitor performance/latency in real time as data is being collected, and see if there are spikes in latency, as indicated by sudden increases chunk size.

While your data is being collected, raw data (not downsampled or preprocessed) is written into a .txt file into your Recordings folder (or wherever else you have chosen with the 'Set Path' button). This is a safeguard against potential crashes or runtime errors. In the event of a crash or error, this .txt file should still exist, and therefore a copy of your data. LLAMAS will also create a .txt log file which contains some basic information about the recording.

  1. ENDING YOUR RECORDING

To end a recording, you can close the streaming data window, or you can press the stop switch in the main window. In either case, you will soon be prompted to save your recording. This may take several seconds. After this is done, the EEG variable from LLAMAS, which contains your data will be exported to your MATLAB workspace. You can use the 'Save' button to re-save your recording if you wish. You can now begin a new recording if you wish; your setting will be stored from the previous recordings.

Clone this wiki locally