Search our resources

Tip: Start typing in the input box for immediate search results from our Support Resources Knowledge Base.
For a more comprehensive search, use the site search in the main menu above.

Easy and accessible closed-loop brain-state-dependent stimulation: a complete walkthrough using TurboLink, bossdevice and bossapp RESEARCH 

Why closed-loop brain-state dependent stimulation?

Neuromodulation of certain brain activities through closed-loop paradigms capable of evaluating the current brain state and trigger stimulation at times of higher excitability has attracted lots of attention in the past decade. As of today, closed-loop protocols have been employed for different scientific and therapeutic purposes using a plethora of different stimulation techniques such as Transcranial Magnetic Stimulation (e.g., Zrenner and colleagues 2018; Singh and colleagues, 2023), Transcranial Ultrasound Stimulation (e.g., in animals: Zhong and colleagues, 2021; Dong and colleagues 2022), Transcranial Direct Current Stimulation (e.g., Leite and colleagues, 2018), Tactile Stimulation (e.g., Zhang and colleagues, 2021), and many more. What all these studies have in common is the goal to achieve longer-lasting effects and improve the relative brain stimulation results.

Among all the above-mentioned techniques, Transcranial Magnetic Stimulation (TMS) stands out as a  well-established therapeutic intervention for several physical and psychiatric disorders for which, however, higher response rates are still needed (George and colleagues, 2010; Levkovitz and colleagues, 2015; Blumberger and colleagues, 2018). Among different approaches investigated to increase therapeutic efficacy, stimulating the brain during different phases of an ongoing natural neural activity through closed-loop paradigms has been shown to yield different long-term effects on the excitability of the targeted neural circuitries (Zrenner et al., 2018; Zrenner and Ziemann, 2024).

The question now is: how do we know WHEN the right time to stimulate a certain area of the brain is?

An online decoding of the ongoing brain activity is required to inform brain stimulation techniques at the right moment to intervene. EEG is the ideal physiological read-out of the brain for time-critical applications thanks to its high temporal resolution (milliseconds) that allows monitoring neural oscillations at different frequencies. A bidirectional relationship between the stimulating system (e.g., TMS) and the stimulated brain is therefore at the core of closed-loop brain-state-dependent applications. On the one hand, the stimulation has a certain effect on the brain related to its parameters (e.g., location, intensity, frequency, etc.) which can be evaluated via the online EEG recording; on the other hand, the simultaneous read-out of the brain state can advise how to best adjust the subsequent stimulus parameters with the goal to optimize the therapeutic outcome.

The goal of closed-loop brain-state-dependent applications is therefore to synchronize the timing of brain stimulation to the ongoing individual natural neural oscillation of interest during each intervention and eventually (if needed) to adjust the stimulation parameters across multiple sessions to maximize the neuroplastic effects (Bergmann, 2018).

Figure 1 – Different brain stimulation approaches and their relationships to the ongoing brain-state. Picture credits to Bergmann, 2018.

What are the requirements and challenges of a closed-loop setup?

Tailoring an external intervention to the individual natural brain activity poses different technical challenges. The setup should in fact:

  1. Provide near to real-time EEG data access as well as raw data saving. The former is necessary to analyze neural activity in real-time and, based on its state, stimulate the brain at the right time. The latter is required to look into the neural dynamics offline and eventually assess the effects of each session so that stimulation features may (or may not) be adjusted for the next run.
  2. Access the EEG data in ultra-fast and reliable (i.e., with minimal jitter) fashion. Minimal data transmission delay and jitter are key factors for time critical applications.
  3. Process the EEG data in real-time and with high accuracy. Millisecond precision is required to minimize the loop delay from the start (i.e., recording the EEG data) till the end (i.e., stimulating the brain based on the desired brain state evaluated in real-time).

The good news is that we now offer a complete setup for closed-loop brain-state-dependent applications that fulfills all these requirements. You can watch an interactive video explaining it on our YouTube channel. Additionally, thanks to recently developed user-friendly software, working with such an advanced setup has become accessible to anyone willing to dive into this research field.

What does a setup for closed-loop brain-state-dependent applications look like?

Choosing the right equipment for your application of interest is the first step to making sure you will have the best data quality possible — even in challenging environments. The schematic below illustrates all the components involved in a setup for closed-loop brain-state-dependent applications.

Figure 2 – An example schematic of our setup for closed-loop brain-state dependent stimulation.

Please note, all the solutions included in this setup are intended for research purposes only.

1.      EEG data recording with actiCHamp (Plus)

When brain stimulation techniques like TMS are involved, it is crucial to be able to handle artifacts properly. Some of these may be related to the equipment used to record the EEG signals (see Figure 3). Thanks to their adequate technical features, both the BrainAmp DC/MR plus and the actiCHamp (Plus) family of amplifiers are very well suited for simultaneous TMS-EEG studies (see our dedicated article How to choose the EEG amplifier that best fits your research). The characteristics of an EEG amplifier that you should look out for when recording with simultaneous brain stimulation like TMS are the following:

  • First of all, the amplifier should have a wide input voltage (at least tens of mV) to avoid saturation due to the strong stimulus amplitude (see Figure 3A below). For example, our actiCHamp (Plus) amplifiers have a ±409.6 mV input range that allows proper detection of big voltage deflection during stimulation. The BrainAmp DC and MR plus amplifiers also offer the possibility of changing parameters depending on the application and for TMS-EEG studies the range ±16.384 mV should be used.
  • Secondly, the amplifier should have antialiasing hardware filters with wide frequency bandwidth (from DC to thousands of Hz) to avoid distorting the stimulus frequency content in the digital domain. A TMS stimulus has frequency content in the range of 3 kHz to 4 kHz depending on the stimulator, thus amplifiers with insufficient bandwidth and low high-cutoff frequency will filter the pulse artifact over a long period of time. The filtered pulse will overlap with the actual neural signal and lead to loss of useful information on the actual neural activity after the stimulation (see Figure 3B below). For example, actiCHamp (Plus) amplifiers have a bandwidth from DC to 8 kHz and can therefore properly capture the stimulus high frequency content. The BrainAmp DC and MR plus amplifiers can handle the TMS pulse well (i.e., artifact duration < 5 ms) despite their narrower bandwidth (i.e., DC to 1 kHz to be selected) thanks to the embedded antialiasing hardware filters specifically designed for the MR environment.
  • Additionally, the amplifier should be able to sample the analog EEG signals at high frequencies (≥ 5 kHz sampling rate) to minimize the ringing artifact (see Figure 3C below). Sampling at high frequencies with our actiCHamp Plus (i.e., at 50 kHz) have recently allowed researchers to observe immediate brain responses to stimulation thanks to the super-fast recovered ringing artifact (Beck and colleagues, 2024).

Figure 3 – Typical artifacts when combining EEG and simultaneous brain stimulation. A) Amplifier saturation can happen if the input range of the amplifier is not big enough and leads to lost samples (figure taken from Hernandez-Pavon and colleagues, 2023). B) Example of a pulse artifact differently filtered when using a BrainAmp DC/MR plus system with hardware antialiasing filter at 250 Hz (red line) and at 1000 Hz. C) Example of different ringing artifact shapes when using an actiCHamp (Plus) at 5 kHz (red line) and 25 kHz (black line).

The last key feature that we need to also consider when working with closed-loop applications, however, is being able to access the data in a super-fast fashion. This is possible only with the actiCHamp (Plus) amplifiers since accessing the drivers of a BrainAmp system would in fact take too long even with fast communication protocols like LSL (~ 5 ms with the new BrainVision LSL Connector for BrainAmp).

As far as electrode technology is concerned, gel-based electrodes should be used to optimize electrode-skin contact and minimize artifactual interferences. Regardless of the technology (passive or active), it is strongly recommended to prepare the cap thoroughly to minimize discharge (or decay) artifacts (see Figure 4), which result from the slow discharge of the capacitive elements laying underneath the TMS coil and thus affected by the stimulation (i.e., electrode, gel, epidermis, dermis and subcutaneous layers as described by Meziane and colleagues, 2013). Since this slow discharging wave may overlap with signals of interest it is important to minimize it by following some good practices:

  • Use TMS-compatible electrodes systems, like the BrainCap TMS or the actiCAP slim/snap.
  • Lower electrode impedances (< 5 – 10 kΩ) to reduce capacitive parts regardless of the electrode’s technology.
  • Optimize cable routing by redirecting them orthogonally with respect to the direction of the current flow (as described by Sekiguchi and colleagues, 2011) in a straight fashion (i.e., no loops) and as fixed as possible to avoid movement.
  • Place Ground and Reference electrode away from TMS hotspot to reduce the spread of the TMS artifacts across each channel.

Figure 4 – Example of typical discharge (or decay) artifact after stimulus, overlapping with signal of interest for quite a significant period of time (~ 40 – 50 ms). Pictures taken from Casarotto and colleagues, 2022.

Of course, using the appropriate equipment and following all the guidelines mentioned, other artifacts may still be present in your recordings, which have a physiological nature. They are therefore participant-specific (e.g., induced muscle artifacts) and stimulation-related (e.g., auditory artifacts). For a comprehensive overview with additional tips and tricks on how to optimize your simultaneous TMS-EEG recording and minimize any artefactual activity, please refer to Casarotto and colleagues, 2022.

The advantage of using active electrode technology is the possibility of working at higher impedances and reducing preparation time as explained in our article How to choose the EEG electrode technology that best fits your research. However, when combining EEG with brain stimulation techniques, you still need to work with very low impedance values for good data quality. Nevertheless, they still offer the benefits of the visual LED feedback, not needing to abrade the skin and being able to flexibly select cap sizes with the same electrodes.

2.      Ultra-fast data access with TurboLink

As mentioned above, the actiCHamp (Plus) amplifiers are the go-to solution for time-critical real-time applications thanks to the possibility of accessing its drivers and extracting the data with minimal latency. The quickest and most stable way of getting the data in ultra-fast fashion is by using the TurboLink, a Linux server designed with the unique scope of streaming data to a dedicated data client (see Figure 5 below). Data transmission is made via UDP protocol, an ideal choice for transferring a high quantity of data at high frequency with low latency and minimal jitter. TurboLink allows streaming all the data (up to 160 EEG channels and 8 AUX channels) recorded by the amplifier with a latency < 1.5 ms and jitter ~ 200 µs to any online signal processor capable of receiving and analyzing them (i.e., data client agnostic).

At the same time, TurboLink allows you to stream the very same data on the computer controlling the EEG data acquisition via BrainVision Recorder and to save them locally for offline analysis. Thus, with one unique device the first two requirements of an optimal closed-loop setup are already fulfilled!

Figure 5 – TurboLink rev.2 (left) and rev.3 (right)

It is possible to stream data from actiCHamp (Plus) amplifiers via self-developed methods based on the Remote Data Access (RDA) (in combination with BrainVision Recorder) or Lab Streaming Layer (LSL). However, these will not achieve the same minimal latency and jitter (normally RDA ~ 50 ms to 100 ms and LSL ~ 2 ms). Several data access and transmission aspects need to be optimized, verified and maintained, which are not at all trivial (e.g., PC configuration, TCP/IP handshakes, network configurations, etc.). TurboLink instead is an out-of-the-box solution which provides faster and more stable access without having to worry about any of the above.

3.      Phase-dependent real-time signal processing with bossdevice RESEARCH

In our setup for closed-loop brain-state dependent stimulation we use the bossdevice RESEARCH by sync2brain GmbH (see Figure 6), a millisecond-resolution online signal processor based on a Simulink Real-Time data model that allows for brain oscillations state synchronized (i.e., boss) experiments.

Figure 6 – The bossdevice RESEARCH developed by sync2brain

In a nutshell, the algorithm continuously monitors the neural oscillations of a target brain area in real-time, estimates the upcoming phase values based on the present status, searches for a desired brain oscillation state based on user-defined parameters and, once found, sends a standard digital output to activate an external intervention (like a TMS stimulator). These actions can be repeated as many times (i.e., trials) as required in your investigation.

But what does this advanced algorithm really do?

Let us walk you through all the different automatic steps that the bossdevice RESEARCH performs with millisecond-accuracy in real-time. These are also visually represented in Figure 7-top.

  • Step #1: the bossdevice RESEARCH receives the data from the actiCHamp (Plus) amplifier with TurboLink. All the channels initially set up in BrainVision Recorder will be streamed and received by the bossdevice RESEARCH up to 128 EEG and 8 AUX channels. The bossdevice RESEARCH requires data to be sampled at 5 kHz (which can be set up in BrainVision Recorder) and to be transmitted in 5-samples UDP packets at 1 kHz transfer rate (to be set up in the TurboLink web interface).
  • Step #2: to optimize the signal-to-noise ratio, the algorithm applies first a spatial filter via the means of Hjorth transformation only to a sub-set of channels representative of the brain area of interest (Figure 7-bottom A), previously specified by the user. The filter takes a sliding window of data (Figure 7-bottom B), it subtracts the mean value and then applies a 5-point sum-of-difference operator. The size of the sliding window varies based on the frequency band of interest (e.g., 500 ms for α band).
  • Step #3: the resulting spatially reconstructed signal is then further processed in two parallel streams. In one processing stream, a spectral analysis is performed to estimate the power in the desired frequency spectrum (also previously specified by the user).
  • Step #4: in the second processing stream, the spatially filtered signal goes through different steps to estimate its phase in a specific near-future window of time. First, the signal is filtered forward and backward by a FIR bandpass filter in the frequency range of interest and the artefactual edges are removed (Figure 7-bottom C). The resulting (shorter) vector of EEG data is then iteratively forward predicted by an auto-regressive forecasting model (Figure 7-bottom D). A Hilbert transformation is then applied to the predicted data to determine the upcoming phase angle at “time zero” (Figure 7-bottom E).
  • Step #5: if the spectral power (as evaluated in the first processing stream) exceeds a pre-defined desired threshold and a pre-defined phase angle is crossed (as predicted in the second processing stream), then a digital output in the form of a TTL trigger is sent in output to an external device (Figure 7-bottom F), which will eventually send a stimulation pulse (Figure 7-bottom G).

Figure 7 – Functionality of the bossdevice RESEARCH algorithm. Top: schematic of the Simulink Real-Time data model adapted from the Supplementary Material of Zrenner and colleagues, 2018 as a visualization. Bottom: visualization of the actual steps executed by the bossdevice RESEARCH algorithm, pictures from Gordon and colleagues 2021.

As previously mentioned, the actiCHamp (Plus) with TurboLink could theoretically stream the data as UDP packets to any data client capable of processing them. It is therefore possible to develop a custom-made program on your own, especially if your research question focuses on different neural features. However, this requires time, resources and lots of troubleshooting. If you are looking for a ready-to-use solution that is widely accepted by your peers, the bossdevice RESEARCH will best fit your research needs.

For each one of the above-described steps several parameters need to be adjusted. These determine which EEG signal will be considered as input, which oscillations are of interest (i.e., frequency and amplitude thresholds need to be selected), and which target phase should trigger a stimulation pulse. Deciding which brain area, frequency band and phase angle should be monitored is a prerogative of your research question and you can adjust them by controlling the bossdevice RESEARCH via the bossapp RESEARCH. 

4.      User-friendly control of your closed-loop brain-state dependent experiment with bossapp RESEARCH

The bossapp RESEARCH has been developed as an add-on product for the bossdevice RESEARCH with the goal to support researchers of different backgrounds in this field by lowering the barrier of designing complex TMS protocols and facilitating EEG data visualization and postprocessing. The app allows speeding up and making the interaction with the bossdevice RESEARCH and the experiments with closed-loop TMS more user friendly. 

Figure 8 – the bossapp RESEARCH user interface when the software opens.

With the bossapp RESEARCH you can interactively setup the following experimental parameters:

  • The brain area of interest whose signal should be continuously monitored by the real-time data model.
  • The neural oscillation(s) of interest with respective target amplitude(s) and phase value(s) that the real-time data model should assess and forward estimate, respectively. The bossdevice RESEARCH can analyze data in theta (4-8 Hz), alpha (8-14 Hz), and beta (14-30 Hz) frequency bands, and it is possible to monitor multiple bands simultaneously. Most importantly though, the bossdevice RESEARCH can evaluate the natural peak frequency within each band by means of Power Spectral Density algorithm, which can then be used to optimize the real-time data model and synchronize the external stimulation with the natural neural rhythm of each participant.
  • The digital output(s) (i.e., TTL pulses) to external devices, which allow you to control the start of your intervention directly from the bossapp RESEARCH. You still need to prepare the stimulation paradigm directly on your stimulation device and make sure it can be initiated by an external trigger coming in. Once this is done, though, you do not need to worry about anything else as the bossapp RESEARCH will guide the stimulation timing in sync with the ongoing neural brain state of interest.

Furthermore, the bossapp RESEARCH gives you the opportunity of visualizing data and processed features of the ongoing experiment online, as you can watch in our tutorial video here, specifically:

  • The Raw Data of the EEG channels of interest as they get streamed from the actiCHamp Plus with TurboLink, as well as the Spatial Filter Data, result of the online Hjorth transformation applied on the EEG channels of interest. These can be visualized in the subtabs of the EEG tab by clicking on the Enable switch button.
  • The Amplitude, Phase and Instability of oscillations in the three available frequency bands, available in the Oscillations tab by clicking on the Enable switch button. The Amplitude plot is also interactive and allows you to define a minimum value below which no digital outputs should be sent by simply clicking on its Y-axis. This gives you the opportunity to fulfill a minimum spectral power requirement and discard signals that are not powerful enough to be experimentally significant (i.e., noise).
  • The Eye Blinks and Range Artifacts traces, also here with interactive plots in the Artifacts tab by clicking on the Enable switch button, which allow you to define a maximum noise value above which no digital outputs should be sent — by simply clicking on its Y-axis. When the signal goes above a pre-defined threshold, the Clean signal status light turns red and the bossdevice RESEARCH temporarily stops sending digital outputs. This gives you the opportunity to hold back any intervention while significant interferences, which would reduce the quality of your data, are present. Future developments will also allow you to set thresholds for Muscle and Preinnervation artifacts (not active in the currently available app version v1.0.5).
  • The Power Spectral Density (PSD) and related Signal to Noise Ratio (SNR) of an ongoing window of 180 seconds of spatially filtered data (predefined in the Advanced tab > Spectrum buffer field). Thanks to these interactive plots available in the Spectrum tab you can detect the peak frequency and eventually update the frequency filter settings in a highly user-friendly manner.
  • The Phase Estimation Accuracy via means of polar histogram plots based on a window of 10 seconds of data (predefined in the Advanced tab -> Phase Error buffer field). To target a specific phase within a target frequency, the bossdevice RESEARCH must predict it shortly into the future because it takes some time to perform calculations and generate, send and receive triggers. Because the EEG signal is complex and mixed with noise, the autoregressive forward prediction algorithm is imperfect. By using this visualization tool, the bossdevice RESEARCH compares the phase of the predicted signal with the phase of the real signal that eventually happened. At each comparison point, the “Phase error”, a measure of how early or late the predicted phase is compared to the real phase, is calculated. This is perhaps the most outstanding of the available visualization tools as it gives you the chance to assess the accuracy of the autoregressive forward prediction step in real-time and eventually adjust your parameters to optimize the protocol and the desired intervention effects.

The bossdevice RESEARCH is independent of the bossapp RESEARCH, it can therefore work via the command line and MATLAB interface available here. This, however, requires you to set up your experimental parameters via programming and will not offer as intuitive and interactive visualization tools as the bossapp RESEARCH.

5.      TMS requirements for simultaneous EEG recording

A closed-loop setup by the book starts and ends with a stimulator. With our setup you have the freedom to choose the stimulator device that you want to use for your investigations, but we would still like to share with you some important features that you should look for when planning simultaneous TMS and EEG recording.

  1. Trigger IN and OUT: first of all, you should be able to control your stimulator with external triggers and start the desired stimulation protocol precisely when a TTL pulse is received. Therefore, a proper trigger input should be available. Furthermore, to be able to perform trial-based analysis offline, a trigger output is required to control the timing of the actual start of the stimulation (e.g., in comparison to the trigger sent by the bossdevice RESEARCH for example). Therefore, it is important to check if specific cables are necessary to connect the outputs from the bossdevice RESEARCH to the stimulation device (and the output from the stimulation device to the TriggerBox Plus, for example).
  2. TMS hardware artifacts: before any data recording you should thoroughly check the entity of artifacts generated by your specific stimulator in the EEG data. On top of the artifacts mentioned in the beginning of this article, there may be other TMS-related artifacts you should also check out. For example, after delivering a stimulus, the TMS machine needs to recharge itself, and this generates so-called “recharge artifacts” in the EEG data. If this happens in the window of the signal of interest, it may be confounded as neural activity. It is, therefore, important to have the option to delay the recharge of the coil, to make sure that eventual artifacts will be outside of the window of interest. Additionally, there could be line noise artifacts, although today most stimulation devices have low line noise induction effects.

How to prepare a closed-loop brain-state dependent setup?

Let’s imagine now you are setting up your experiment, here are the steps you should follow. You can watch the following tutorial video and then read through each step right below.

You are currently viewing a placeholder content from YouTube. To access the actual content, click the button below. Please note that doing so will share data with third-party providers.

More Information

Step #1: prepare your actiCHamp Plus with TurboLink

Setting up the actiCHamp Plus with TurboLink is easy and requires very few steps:

  1. Connect the power cable for TurboLink
  2. Make sure to connect the TurboLink license dongle (starting with UT) to the USB 3.0 connector second-row left.
  3. Connect the dedicated Ethernet port to the computer running BrainVision Recorder for local data recording and visualization
  4. Connect the other dedicated Ethernet port to your signal processor for online data processing.
  5. Connect the TurboLink USB 2.0 connector first-raw right to your actiCHamp (Plus) for fast data access.



    Figure 9 – TurboLink rev.2 (top left) and rev.3 (top right) connections. Bottom: example connections of TurboLink rev.2 with actiCHamp Plus amplifier

  6. On your recording computer, first change the used ethernet port IP address to 192.168.5.21 (subnet mask 255.255.255.0) and launch the actiCHamp-TurboLink tool, which sets the firewall rules for BrainVision Recorder to properly work with TurboLink.
  7. Open BrainVision Recorder in Administrator mode, navigate to the Configuration tab and click on Select Amplifier. From the drop-down menu in the just popped-up window, select the option actiCHamp-TurboLink without modifying the shown IP address.

Figure 10 – On the left, how to set up the TurboLink IP address in the used ethernet port on your computer.
On the right, amplifier selection window in BrainVision Recorder when working with actiCHamp (Plus) with TurboLink.

You can now connect your participant to the actiCHamp (Plus) amplifier and proceed by creating your workspace in BrainVision Recorder as usual. You will notice that, when coupled with TurboLink, the sampling rate of your actiCHamp (Plus) amplifier is limited to a maximum of 10 kHz to better manage the challenging amount of data during the ultra-fast online processing.

Remember that, at any point during the recording, it is possible to check the status of TurboLink via its dedicated online control panel available at http://192.168.5.21:8000 (i.e., open it in the browser of the computer running BrainVision Recorder). This web interface is also important to run firmware updates and to change some internal features, which may be data client specific (e.g., transfer rate of 1000 Hz when working with the bossdevice RESEARCH, see next section).

Figure 11 – TurboLink web console.

If you have troubles working with TurboLink, you will find troubleshooting tips in the BrainVision Recorder Manual (Appendix E Troubleshooting). You can also always reach out to our Technical Support team at techsup@brainproducts.com for tailored assistance.

Step #2: connect the bossdevice RESEARCH

To set up the bossdevice RESEARCH, please make sure to follow these steps. Connecting the bossdevice RESEARCH is also rather easy (see Figure 12).

  1. Connect the power cable to the bossdevice RESEARCH.
  2. Connect the ethernet cable coming from the TurboLink to the Biosignal input Ethernet port to receive the EEG data from actiCHamp Plus in real-time.
  3. Connect the Control PC input Ethernet port to the control computer running the MatLab experimental script or the bossapp RESEARCH.
  4. On the front panel, there are four BNC ports that can be used to send TTL triggers in output whenever a desired brain state pattern is detected. It is possible to configure the delivery of up to 4 output signals simultaneously. One of those BNC connections typically goes to the stimulator. A second BNC connection could go to our TriggerBox Plus to forward the same triggers to the EEG amplifier for timing control purposes (e.g., comparing triggers from bossdevice RESEARCH and TMS).
  5. In the right-side panel there are two LPT ports via which 8-bit markers can be sent/received.

Figure 12 – bossdevice RESEARCH connections

Step #3: define your protocol with the bossapp RESEARCH

Navigating through the bossapp RESEARCH is very user-friendly and the visualization options it offers are a great tool to monitor the performance of the online signal processor and the quality of your experiment.

To get started, install the app on your computer following the instructions reported here. The first time that you open the app, you will be asked to accept the EULA, load your license file and enter the IP address in the top left field (which should be 192.168.7.5).

Then, and any other time that you open the app afterwards, you can follow the steps below.

  1. Open the app and:
    1. Click directly on the Disconnected button underneath to establish the communication between the app and the bossdevice RESEARCH (see Figure 13 below, left side). You will notice that the adjacent Main Control section will light up, which means that the app is now ready to start the bossdevice RESEARCH.
    2. Click on the Start button to initiate the data model (see Figure 13 below, right side). If the EEG amplifier is not in monitoring nor in recording mode, the EEG Amplifier light will be red. Start monitoring the data in BrainVision Recorder so that EEG signals are streamed into the bossdevice RESEARCH and you will be able to work with all the visualization tools of the bossapp RESEARCH. You will notice the EEG Amplifier light will then turn green, meaning data are being successfully received (see Figure 14 below).


      Figure 13 – How to connect the bossapp RESEARCH to a bossdevice RESEARCH. First make sure the entered IP address matches the one assigned to the bossdevice RESEARCH (by default 192.168.7.5). Then, click on the Disconnected button to establish the connection (left). Once active, click on the Start button (right) to start the internal data model.

      If you do not have an active bossapp RESEARCH license, the Main Control Start button will not work. You will, however, still be able to navigate through the app interface and appreciate all the available tools it can offer. If you then are interested in acquiring a license, please reach out to us at sales@brainproducts.com or to your local distributor.

  2. Next, you should define your brain area of interest by selecting the EEG channels you would like the spatial filter (i.e., Hjorth transformation) to be applied to. This can be done by navigating to the EEG tab -> Configuration subtab, creating a new configuration and entering the name and the physical channel number in the Spatial Filter Weights table only for the electrodes of interest (see Figure 14). You should also provide a spatial filter weight value which, depending on your protocol, amplifies (positive) or reduces (negative) the contribution of the respective channel in the spatial filter. All the remaining channels will be by default set with a 0-value weight, thus they will not contribute to the spatial filter.
    You may then save your configuration and load it in the next experiment.


    Figure 14 – Example EEG channels configuration in the bossapp RESEARCH to monitor occipital alpha activity. Three channels on the occipital cortex have been selected with a weight of 1 each (i.e., same contribution) to monitor occipital alpha oscillations during eyes-closed resting state. The channel names and physical numbers reported in Channel Label and Ch. Index fields, respectively, correspond to the layout for actiCAP snap caps 32 channels.

  3. Navigate then to the Protocol tab to set up your experimental condition(s) and parameters (see Figure 15).
    1. Create a new protocol (1) and add new conditions (2) with meaningful names (3).
    2. Decide which frequency band you would like the data model to monitor. You may decide to target one or multiple frequency bands by ticking the corresponding Enable box (4).
    3. For each frequency band of interest, define the Target Phase you want the data model to detect by double clicking on the frequency Target field of your frequency band(s) of interest and editing the values in the dedicated pop-up window (5). Add a bit of tolerance around the phase target value as estimating exactly one unique is not trivial.
    4. Set up your digital outputs by double clicking on the Trigger Configuration column (6). Click on the Port# box(es) of the BNC port(s) that you would like to send TTL pulses from; adjust the TTL pulse ms length in the Pulse Width [s] field if you need to match a particular sampling rate for example; define, if required, a delay before sending the trigger out in the Time [s] field (for example, to start different intervention in sequence once the previous one(s) are finished).
    5. Depending on the intervention paradigm setup on your external stimulation device, you can decide how many Cycles (i.e., trials) each condition should consist of (7). The bossapp RESEARCH will monitor the selected frequency band in the configured brain area, estimate the upcoming phase value and, if the defined target phase is predicted, send the predefined digital outputs for as many times as the cycles number states.
    6. To make the experiment even smoother, you can set the conditions to start automatically one after the other by selecting the Autostart option (8).
    7. Lastly, if certain conditions should be initiated/stopped by external markers coming in the bossdevice RESEARCH through the dedicated LPT port, you can specify them in the last three available columns (9).


      Figure 15 – Example Protocol configuration for monitoring alpha frequency band in the bossapp RESEARCH. In this protocol, oscillations in the alpha band are monitored (see only Enable Alpha box selected) in one condition. “Alpha Peak” looks for the peaks of the ongoing alpha oscillations as defined by a Target Phase [rad] value of 0 radiants in the Alpha Target cell. The protocol runs for a total of 60 trials as specified in the Num. Cycles cells. In each trial, when the target phase is detected, two TTL pulses are sent in output from BNC ports 1 and 2 (as specified in the Trigger Configuration table), without any delay upon detecting the upcoming desired phase target (defined in Time [s] cells equal to 0), and with Pulse Width [s] of  4 ms (in order match the 5 kHz sampling rate used to record data with actiCHamp (Plus)). As previously mentioned, one TTL would go to the stimulator, the other would go to the TriggerBox Plus for trigger timing control purposes.

  4. To synchronize the stimulation with the natural rhythm of each individual brain activity, you should first evaluate the peak frequency in the frequency band of interest. To do that:
    1. First, record at least 3 minutes of data and then click on the Update Spectrum button in the Spectrum tab to generate the Power Spectral Density and related Signal-to-Noise ratio plots.
    2. Hover over the PSD plot to visualize the peak frequency value in your band of interest and note it down (see Figure 16A below).
    3. Next, navigate to the Oscillations tab and click on the Tune Filters button to change the peak frequency for the filter in your band(s) of interest (see Figure 16B below).
    4. Start monitoring the oscillation amplitude, phase and instability by selecting the desired frequency band of interest in the Oscillation section and turning on the Enable switch button. If the data model frequency filter is properly tuned around the individual peak frequency, the Phase plot will show a sawtooth pattern.
    5. If relevant for your investigation, set a minimum oscillations amplitude value by clicking on the Y-axis of the first Amplitude plot. You may in fact want to stimulate the brain only when a minimum spectral power is present.

      It is possible to update the spectrum plot at any time, especially if you feel that the original peak frequency could be better estimated. You can also refresh the buffer by clicking on the Clear Buffer button, especially if not clean data have been streamed. If you want to save the obtained plots for offline usage, you can click on the Export Spectrum button and they will be saved as a pdf on your computer.


      Figure 16 – bossapp RESEARCH Spectrum (A) and Oscillations tab (B). In the Spectrum tab at the top, the Power Spectral Density plot and related Signal to Noise Ratio plots are visible, with the cursor hovering over the highest peak in the alpha frequency range to highlight the peak frequency value. In the Oscillations tab at the bottom, the Tune Filters button was selected to edit the peak frequency in the alpha bandpass filter.

  5. You are now ready to start your experiment. Go back to the Protocol tab, click on the condition that you would like to run first in your experiment and then click on the Start button in the Protocol Control section. In the #Trigger remaining field, you will see a countdown from the original number of Cycles (i.e., trials) until the end of the sequence. If you have selected the Autostart? button for your subsequent conditions, these will start automatically, otherwise approval for continuing with the next conditions needs to be given manually.
  6. To evaluate the performance of the online signal processor and the accuracy of the phase estimation by the autoregressive forward prediction model trial-by-trial switch to the Phase Estimation Accuracy tab, select the desired frequency band in the Oscillation section and click on the Update button (see Figure 17 below).

Figure 17 – Example of a histogram polar plot within the Phase Estimation Accuracy tab of the bossapp RESEARCH. A perfect phase estimation would result in a histogram polar plot with an error of 0 degrees, and in cases where phase estimation accuracy was high, the error would be spread around. The mean phase error is expressed in terms of “Circular Mean” and its standard deviation as “Circular Standard Deviation”. If the circular mean is between 0 and 180 degrees, the predicted phase is, on average, early compared to the real phase. If the circular mean is between 180 and 360, the predicted phase is, on average, late compared to the real phase.

If the estimated accuracy is not good, you could further optimize your experimental parameters by checking that the originally detected peak frequency in your band of interest is indeed correct or needs to be updated, and by setting artifacts thresholds that would prevent trials to happen in noisy data periods.

Safety and maintenance

When your experiment is finished, remember to switch off the TurboLink and bossdevice RESEARCH before unplugging them from the mains. This will ensure no shocks happen.

Remember to follow our guidelines to properly maintain the equipment.

Worldwide Caution: Our products are scientific equipment for INVESTIGATIONAL USE ONLY!
Medical use, e.g., for diagnosis, treatment of disease or other such purposes, is strictly forbidden.


References

  1. Zrenner, C., Desideri, D., Belardinelli, P. and Ziemann, U., 2018. Real-time EEG-defined excitability states determine efficacy of TMS-induced plasticity in human motor cortex. Brain stimulation11(2), pp.374-389.
  2. Singh, N., Saini, M., Kumar, N., Padma Srivastava, M.V. and Mehndiratta, A., 2023. Individualized closed-loop TMS synchronized with exoskeleton for modulation of cortical-excitability in patients with stroke: a proof-of-concept study. Frontiers in Neuroscience17, p.1116273.
  3. Zhong, Y., Wang, Y., He, Z., Lin, Z., Pang, N., Niu, L., Guo, Y., Pan, M. and Meng, L., 2021. Closed-loop wearable ultrasound deep brain stimulation system based on EEG in mice. Journal of Neural Engineering18(4), p.0460e8.
  4. Dong, S., Yan, J., Xie, Z., Yuan, Y. and Ji, H., 2022. Modulation effect of mouse hippocampal neural oscillations by closed-loop transcranial ultrasound stimulation. Journal of Neural Engineering19(6), p.066038.
  5. Leite, J., Morales-Quezada, L., Carvalho, S., Thibaut, A., Doruk, D., Chen, C.F., Schachter, S.C., Rotenberg, A. and Fregni, F., 2017. Surface EEG-transcranial direct current stimulation (tDCS) closed-loop system. International journal of neural systems27(06), p.1750026.
  6. Zhang, W., Song, A., Zeng, H., Xu, B. and Miao, M., 2021. Closed-loop phase-dependent vibration stimulation improves motor imagery-based brain-computer interface performance. Frontiers in Neuroscience15, p.638638.
  7. George, M.S., Lisanby, S.H., Avery, D., McDonald, W.M., Durkalski, V., Pavlicova, M., Anderson, B., Nahas, Z., Bulow, P., Zarkowski, P. and Holtzheimer, P.E., 2010. Daily left prefrontal transcranial magnetic stimulation therapy for major depressive disorder: a sham-controlled randomized trial. Archives of general psychiatry, 67(5), pp.507-516.
  8. Levkovitz, Y., Isserles, M., Padberg, F., Lisanby, S.H., Bystritsky, A., Xia, G., Tendler, A., Daskalakis, Z.J., Winston, J.L., Dannon, P. and Hafez, H.M., 2015. Efficacy and safety of deep transcranial magnetic stimulation for major depression: a prospective multicenter randomized controlled trial. World Psychiatry, 14(1), pp.64-73.
  9. Blumberger, D.M., Vila-Rodriguez, F., Thorpe, K.E., Feffer, K., Noda, Y., Giacobbe, P., Knyahnytska, Y., Kennedy, S.H., Lam, R.W., Daskalakis, Z.J. and Downar, J., 2018. Effectiveness of theta burst versus high-frequency repetitive transcranial magnetic stimulation in patients with depression (THREE-D): a randomised non-inferiority trial. The Lancet, 391(10131), pp.1683-1692.
  10. Zrenner, C. and Ziemann, U., 2024. Closed-loop brain stimulation. Biological Psychiatry, 95(6), pp.545-552.
  11. Bergmann, T.O., 2018. Brain state-dependent brain stimulation. Frontiers in psychology9, p.2108.
  12. Sekiguchi, H., Takeuchi, S., Kadota, H., Kohno, Y. and Nakajima, Y., 2011. TMS-induced artifacts on EEG can be reduced by rearrangement of the electrode’s lead wire before recording. Clinical Neurophysiology122(5), pp.984-990.
  13. Beck, M.M., Christiansen, L., Madsen, M.A.J., Jadidi, A.F., Vinding, M.C., Thielscher, A., Bergmann, T.O., Siebner, H.R. and Tomasevic, L., 2024. Transcranial magnetic stimulation of primary motor cortex elicits an immediate transcranial evoked potential. Brain Stimulation17(4), pp.802-812.
  14. Hernandez-Pavon, J.C., Veniero, D., Bergmann, T.O., Belardinelli, P., Bortoletto, M., Casarotto, S., Casula, E.P., Farzan, F., Fecchio, M., Julkunen, P. and Kallioniemi, E., 2023. TMS combined with EEG: Recommendations and open issues for data collection and analysis. Brain Stimulation16(2), pp.567-593.
  15. Meziane, N., Webster, J.G., Attari, M. and Nimunkar, A.J., 2013. Dry electrodes for electrocardiography. Physiological measurement, 34(9), p.R47.
  16. Casarotto, S., Fecchio, M., Rosanova, M., Varone, G., D’Ambrosio, S., Sarasso, S., Pigorini, A., Russo, S., Comanducci, A., Ilmoniemi, R.J. and Massimini, M., 2022. The rt-TEP tool: real-time visualization of TMS-Evoked Potentials to maximize cortical activation and minimize artifacts. Journal of Neuroscience Methods370, p.109486.
  17. Zrenner, C., Desideri, D., Belardinelli, P. and Ziemann, U., 2018. Real-time EEG-defined excitability states determine efficacy of TMS-induced plasticity in human motor cortex. Brain stimulation11(2), pp.374-389

Table of Contents
Go to Top