> 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/analysis/eda-gsr/gsr-r-notebooks-gsr-signal-quality.md).

# GSR R-Notebooks: GSR Signal Quality

Run the GSR Signal Quality R notebook to assess Shimmer or Biopac GSR/EDA data by signal-to-noise ratio and percentage of missing signal per stimulus.

*This article will walk you through the new GSR signal quality notebook and how you can use it to assess your GSR signal. This notebook works with GSR/EDA signals collected with Shimmer or Biopac.*

## 1. Prerequisites

Supported stimulus types: All

Supported sensors: Shimmer, Biopac

## 2. How to Analyze in iMotions Desktop

When you add your R-notebooks during your Signal Processing step, you can now analyze your GSR/EDA signal quality based on the R-notebook "GSR Signal Quality" which outputs two metrics:

(1) Signal-to-Noise ratio in decibels

(2) Signal missing in %

In order to access these metrics, please choose the GSR signal quality notebook during the Signal Processing step and add it to your active flows for the desired device. If you have multiple EDA/GSR devices, add the notebook separately for each device and give each active flow a unique name.

Single device:

![Signal\_quality\_1.jpg](https://286068319-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNLNBWkNpljDaAj5rQtNa%2Fuploads%2Fgit-blob-e956e11820dd89f0403d66ebe30d2d72a58d2402%2F1915991fbc_signal_quality_1.webp?alt=media)

Multiple devices:

![Signal\_quality\_2.jpg](https://286068319-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNLNBWkNpljDaAj5rQtNa%2Fuploads%2Fgit-blob-4be95751b151c8bdcdac2c214d0faae37b671f80%2F077341cee5_signal_quality_2.webp?alt=media)

Continue with your analysis by clicking next and selecting the corresponding stimuli.

Once the algorithm has processed, you can go into the individual replays and review the Signal Quality for your respondents and stimuli. The signal quality is always calculated on the signal that is present, not considering signal lost. Hence always review these metrics together, to understand how much signal you have, and how much Noise this signal contains.

## 3. GSR Signal Quality Metrics and Algorithm

### Metrics & Algorithm

#### Signal-to-Noise Ratio

**Signal-to-noise ratio**(abbreviated**SNR**or**S/N**) is a measure that states how much signal relative to noise is contained in a signal or time series. SNR is defined as the ratio of signal power to the noise power, often expressed in[decibels](https://en.wikipedia.org/wiki/Decibel). A ratio higher than 1:1 (greater than 0dB) indicates more signal than noise.

The Signal Quality Notebook calculates the SNR based on the following steps as described in [\[Schumm, J. 2008\]](#references):

* Retrieval of the calibrated GSR signal (expressed in microSiemens, µS) from the sensor.
* Determination of the sampling rate based on timestamps
* Estimation of the Power Spectral Density (PSD) using the Fast Fourier Transform (FFT). Resulting frequencies are in range \[0, Fn], where Fn (0.5 \* samplingRate) is Nyquist Rate.
* Based on the selected **frequency cutoff** parameter, the PSD is separated into **signal** (frequencies below the cutoff) and **noise** (frequencies at or above the cutoff). The default cutoff is 5 Hz, which keeps the electrodermal activity range of an adult human (0 to 1.5 Hz (Schumm et al. 2008)) well inside the signal band. You can lower the cutoff to 1.5 Hz.
* Computation of the **Signal-to-noise ratio** (in decibel) using the following formula: SNR=10\*log10(?signalPSD / ?noisePSD)
* Estimation of the proportion of **signal missing** based on the number of samples recorded, the duration of the stimulus and the estimated sampling rate of the device.

A negative value for the SNR indicates poor signal quality (more noise than signal). Also, based on our experience, a value superior to 20 dB seems sufficient to assess the good quality of the signal (at 20 dB, the noise has less than 1% of the power of the signal, or about 10% of its amplitude). However, it is hard to make a quality statement concerning values between 0 and 20. These stimulus/respondent pairs should be further investigated by having a look directly at the signal.

#### Signal Missing

Signal missing will give you the percentage of signal missing in relation to the stimulus length.

This is calculated based on the number of collected samples (and hence missing samples) over expected samples based on stimulus length expressed in %.

**This metric used to be included in the GSR Peak Detection Notebook and Output. It is now part of the Signal Quality Output.**

### Examples

The following examples illustrate different scenarios to make it easier to combine these metrics in a sensible fashion.

**Example 1: No Signal missing, SNR above 20 db**

Here no signal has been lost, and with an SNR above 20 dB the noise has less than 1% of the power of the signal.

![Signal\_quality\_3.jpg](https://286068319-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNLNBWkNpljDaAj5rQtNa%2Fuploads%2Fgit-blob-f7a4f61874192ca199d5c79039882f05608150fa%2F466d7d7f8a_signal_quality_3.webp?alt=media)

**Example 2: Signal missing, SNR above 20 db**

Here the SNR is good with db above 20 but parts of the signal are missing. This is also apparent in the peak detection where the missing signal is shown as a dashed line.

![Signal\_quality\_4.jpg](https://286068319-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNLNBWkNpljDaAj5rQtNa%2Fuploads%2Fgit-blob-bf555ee39608eba82d4cd3c4ef4ffbd54bf7a099%2F89f279e5c4_signal_quality_4-1-.webp?alt=media)

When you create a scene during the time window when parts of the signal are missing, the percentage of signal missing for that scene increases accordingly to the scene/stimulus length.

![Signal\_quality\_5.jpg](https://286068319-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNLNBWkNpljDaAj5rQtNa%2Fuploads%2Fgit-blob-b3734026006890bd1bc108ef59ba9e822799bd09%2F5c87a86200_signal_quality_5.webp?alt=media)

**Example 3: No Signal missing, SNR below 0 (more noise than signal)**

Here no signal is missing but the measurement contains more noise than signal with -6.91db.

![Signal\_quality\_6.jpg](https://286068319-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNLNBWkNpljDaAj5rQtNa%2Fuploads%2Fgit-blob-c83667d6fb5e38aa7a28735321ac4427c0558057%2Ffbce013f31_signal_quality_6.webp?alt=media)

You can run the signal quality notebooks before running any other GSR notebook, or together with the peak detection and aggregation notebook.

Depending on the signal quality you can exclude respondents from further analysis after exporting the GSR Signal quality and removing respondents accordingly. This can be done using the segmentation settings and a csv file which includes only respondents with a sufficient signal. For more information on how to do that, please review the following article:Respondent Segmentation using a CSV file.

## 4. The Outputs

In order to export the Signal quality including the SNR and Signal Missing, go to the Export dialogue and choose GSR Signal Quality Export under the R-processing tab. This will result in a txt file including all stimuli and respondents, **SNR and signal missing**.

Before you exclude respondents, make sure you have an overview of the average signal quality for each stimulus and respondent. If the overall quality is high, 20db is a valid threshold.

## References

Schumm, J., M. Bachlin, C. Setz, B. Arnrich, D. Roggen, and G. Troster. 2008. “Effect of Movements on the Electrodermal Response After a Startle Event.” In *2008 Second International Conference on Pervasive Computing Technologies for Healthcare*, 315–18.


---

# 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/analysis/eda-gsr/gsr-r-notebooks-gsr-signal-quality.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.
