MindRove / MindRoveSDK

Apache License 2.0
5 stars 4 forks source link

Clarification on `DataFilter.detrend()` Functionality and Detrend Operations Options #3

Closed mikigom closed 1 year ago

mikigom commented 1 year ago

As I proceed with my work, I have come across the DataFilter.detrend() function in the SDK and I would like to understand it in more detail.

I understand that detrending is an important pre-processing step in signal processing, as it helps to remove any trend that might be present in the signal data. However, I noticed that there are two distinct detrending operations in the SDK: DetrendOperations.CONSTANT.value and DetrendOperations.LINEAR.value.

I am looking for clarification on the following points:

  1. What specific roles does the DataFilter.detrend() function play within the MindRoveSDK?
  2. What are the differences between DataFilter.detrend( - , DetrendOperations.CONSTANT.value) and DataFilter.detrend( - , DetrendOperations.LINEAR.value)?

Specifically, I am interested in understanding:

Any additional examples or documentation would be greatly appreciated.

rokaijano commented 1 year ago

Basically with the CONSTANT option a mean value will be subtracted from the signal, while with the LINEAR option, a mean and a gradient will be calculated and that will be subtracted We use the Brainflow implementation for the DataFilter, so implementation wise you can check: https://github.com/brainflow-dev/brainflow/blob/0754d7337876af37ec5e08fbda8dac3c04efe7b2/src/data_handler/data_handler.cpp#LL1120C1-L1159C10

Please close this issue if you don't have any more questions regarding this.