> For the complete documentation index, see [llms.txt](https://help.imotions.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://help.imotions.com/lab/sensor-setup/eeg/abm/how-to-collect-and-analyze-ecg-data-from-abm-b-alert-x10-or-x24.md).

# How to collect and analyze ECG data from ABM B-Alert X10 or X24

Place the ECG electrodes of an ABM B-Alert X10 or X24, find the heart rate and IBI files from the ABM SDK, and merge them with stimulus data to compute HRV.

**\[1] ECG sensor placement and data collection**

The **ABM B-Alert systems** also contain two ECG/EKG electrodes on a longer cable strand, which are attached to the chest as follows (remember to ***clean the locations with alcohol*** and ***use electrode cream*** before you put the stickers on):

* **GRAY:** right collarbone (RA=right arm)
* **BLUE:** lowest left rib (LL=left leg)

![](https://286068319-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNLNBWkNpljDaAj5rQtNa%2Fuploads%2Fgit-blob-a96d6edec76b7619179dea2d7b90f4a83d1a3799%2F645f7a4996_cogipcx49u218kcq6a0qa.webp?alt=media) ![](https://286068319-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNLNBWkNpljDaAj5rQtNa%2Fuploads%2Fgit-blob-012e544ed0a49392a113aed334616bcf81fb11f6%2Fc396a424a5_faca9oygjkmtaalmgqubka.webp?alt=media)

The two electrodes constitute a bipolar ECG channel, which is visualized in the iMotions interface and stored with the EEG data.

![](https://286068319-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNLNBWkNpljDaAj5rQtNa%2Fuploads%2Fgit-blob-c2a5ba61f3f9dd845f9d050b9877824763067577%2Fddb09617b0_ajusynumuebzziy2om3la.webp?alt=media)

**\[2] ECG data analysis (HR, IBI, HRV)**

Besides the ECG raw data, the ABM SDK generates ECG-related data files containing information on **Heart Rate (HR)** and **Inter-Beat-Intervals (IBI)**, both beat-by-beat and second-by-second. Based on this, you can extract **Heart-Rate-Variability (HRV)** and other ECG metrics. Heart rate is related to physiological arousal, while HRV mainly reflects autonomic, largely parasympathetic, regulation. Lower HRV is commonly associated with higher stress and mental workload.

These ECG files can be found as follows:

1. In iMotions, right-click on a respondent with ABM data and select "**Browse ABM Files**".
2. This opens the ABM data folder of the study in Windows Explorer.
3. Locate and open the respondent folder.

Check the following 2 files:

* **\<file\_name>HR\_beat.csv.** This file contains the list of heart beats as well as inter-beat-intervals and heart rate on a beat-by-beat basis. Each line in this file is one heart beat.

  ![](https://286068319-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNLNBWkNpljDaAj5rQtNa%2Fuploads%2Fgit-blob-abf4cc203d70f1b4953e5207f87841c07cf09f8a%2Fc91539e184_0kikeajoue2wplhhhqpggq.webp?alt=media)
* **\<file\_name>HR\_epoch.csv.** This file contains the list of heart beats as well as inter-beat-intervals and heart rate on a second-by-second basis. Each line in this file is one second or "epoch" (see column "**Elapsed Time**").

  ![](https://286068319-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNLNBWkNpljDaAj5rQtNa%2Fuploads%2Fgit-blob-fb7a777965413dceed3cd908839157addd85b474%2F51a33786ad_3t9my6ev0kesoya960tbw.webp?alt=media)

One common HRV metric, SDNN, is the standard deviation of the inter-beat intervals (IBI). Compute it from the beat-by-beat IBI values in **HR\_beat.csv** after removing artifacts, and only compare SDNN between recordings of the same length:

![](https://286068319-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNLNBWkNpljDaAj5rQtNa%2Fuploads%2Fgit-blob-76be214aaf68ba38f12df97d88f7479a7f44d919%2F2efc25fad2_qpadzops40ovejdgzu6c8w.webp?alt=media)

**\[3] Merge IBI and HR data with iMotions raw sensor data export files**

As the files **HR\_beat.csv** and **HR\_epoch.csv** are generated outside of iMotions, they unfortunately **do not** contain the iMotions stimulus names. This means that you cannot tell from these files alone which stimulus condition respondents were in when they showed a specific heart rate.

You have to merge the file **HR\_epoch.csv** with the iMotions raw sensor export file of the respondent (**DumpXXX.txt**) in order to do so. The merging is done using the "**Elapsed Time**", which is listed in both files.

1. In iMotions, right-click the study (or analysis) and select "Export" > "Sensor Data". In the dialog, select the ABM B-Alert system to export the "**Elapsed Time**" or epoch index.
2. Open the export file in Excel. Please note that the "**Elapsed Time**" is listed in the column "**Epoch (Raw)**". This means that "Epoch 1" corresponds to "Elapsed Time 00:00:00:000" (the first second), "Epoch 2" corresponds to "Elapsed Time 00:00:01:000" (the second second) and so on.

   \[In more technical terms, "**Epoch (Raw)**" in the iMotions file is one-based, while "**Elapsed Time**" in the HR file is zero-based]

   ![](https://286068319-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNLNBWkNpljDaAj5rQtNa%2Fuploads%2Fgit-blob-dc7796f8f1d78b51f56fb9783a565f62c34feeb7%2F57137b1229_hpungyqdykyqyzlyysak6q.webp?alt=media)
3. Filter the Excel sheet (\[A], \[B]) and select the EventSource \[C] "**ABMBrainState|ABMDeconEEG|ABMRawEEG**" \[D].

   ![](https://286068319-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNLNBWkNpljDaAj5rQtNa%2Fuploads%2Fgit-blob-5ca022774ee66a31513072488326df81cac0748f%2F39554b8534_5rbsiuc8d0iolws7re04hg.webp?alt=media)
4. Now the table shows the second-by-second values, and "Epoch (Raw)" should list the seconds one by one. As a side effect, you can now also see the stimuli second-by-second.

   ![](https://286068319-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNLNBWkNpljDaAj5rQtNa%2Fuploads%2Fgit-blob-1cf7e7713e8978aa419b1239a748c1c38b72ffa3%2Fd580ff9578_0msoa6mtf0ssyss7ihlibw.webp?alt=media)
5. Mark everything and copy the table.
6. Open a new Sheet in Excel, click "Paste" in the menu, and select the option "Paste values".

   ![](https://286068319-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNLNBWkNpljDaAj5rQtNa%2Fuploads%2Fgit-blob-b3c0e5c788cd706e146fc0bff9061a151457f821%2F058937ce50_g1g60oyhquunlvoqqch0oa.webp?alt=media)
7. Note down the first value in the column "Epoch (Raw)" - here it's 7.
8. Insert two columns into the table (one for IBI and one for HR) and save it.
9. Go back to the file **HR\_epoch.csv** and copy all data from epoch 7 downward.

   ![](https://286068319-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNLNBWkNpljDaAj5rQtNa%2Fuploads%2Fgit-blob-ea11af63fe0da3cf2fc6fcfa6c9bbd8d24b0feeb%2Fa260e447a8_hdtrfnad60qdcqv1l4fqg.webp?alt=media)
10. Paste all this data into the iMotions file (from step 8).
11. Now you have merged the HR data and the iMotions stimulus names.
12. You can now continue further filtering the file, for example to list the IBI and HR values for a specific stimulus. The IBI values in **HR\_epoch.csv** are second-by-second values, so their standard deviation is not SDNN. To compute SDNN for a stimulus, use the beat-by-beat IBI values from **HR\_beat.csv** for the same time range.

    ![](https://286068319-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNLNBWkNpljDaAj5rQtNa%2Fuploads%2Fgit-blob-48c67a5067749b57967b044c183ed5650990078c%2Ffa7db5b5b6_isans2n8zkc47bd8rcp3bg.webp?alt=media)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://help.imotions.com/lab/sensor-setup/eeg/abm/how-to-collect-and-analyze-ecg-data-from-abm-b-alert-x10-or-x24.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
