signal threshold
Posted: Mon May 10, 2021 8:18 am
Hello
We are facing a problem that seems pretty simple (and potentially a second one), but we cannot find a way to fix it. Here is the background:
We are currently reading emg signal and trying to calculate a threshold in order to detect emg bursts. In fine, we would like to get a stimulation each time the signal exceeds the threshold.
To start with, we simply want to detect when the (pre-processed) signal exceed the mean plus 3 standard deviations. But, this is where things are getting problematic..., the mean and std are calculated/updated on every trial during a baseline period (and are hence variable and updated).
To do so, we were thinking of (The picture below shows to intended scenario):
- making a stimulation based epoching, extract the mean and the std from the baseline, and feed them into a simple DSP box (this DSP box can either subtract the mean + 3std, to later detect a sign change, or directly check when we exceed mean + 3std, we'll comment on that later). The inputs of this simple DSP would then be:
- the signal (A)
- the mean (B)
- the std (C)
The problem is that when we want to compute (e.g.) A - (B + 3*C) we have a dimension mismatch: A is of dimension 64 (size of the chunk, we have one single channel), while B and C are of dimension 1. The equation works perfectly well if B and C are hard written in the equation (as done for example in the "Use the force" scenario"). But we need to update them... So the question is how to make the simple DSP box performing simple operations between a signal (a matrix) and floats as variables?
Once this is solved (hopefully, it can...), we would like an openvibe stimulation to be triggered when the condition is fulfilled. If we subtract the mean + 3std to the signal, one can use the Sign change detector box that issues a stimulation. But this is suboptimal, as only one stimulation is triggered, and we would like to use to the Stimulation validator to be sure that it is not a false alarm. This does not work for a simple sign change detector (or one needs to ensure that there is not a another sign change..., not easy). So the question is: is it possible to have a simple DSP box to trigger a stimulation, instead of a transformed signal? Or is there another box/way to do so?
Thank you very much for you help
We are facing a problem that seems pretty simple (and potentially a second one), but we cannot find a way to fix it. Here is the background:
We are currently reading emg signal and trying to calculate a threshold in order to detect emg bursts. In fine, we would like to get a stimulation each time the signal exceeds the threshold.
To start with, we simply want to detect when the (pre-processed) signal exceed the mean plus 3 standard deviations. But, this is where things are getting problematic..., the mean and std are calculated/updated on every trial during a baseline period (and are hence variable and updated).
To do so, we were thinking of (The picture below shows to intended scenario):
- making a stimulation based epoching, extract the mean and the std from the baseline, and feed them into a simple DSP box (this DSP box can either subtract the mean + 3std, to later detect a sign change, or directly check when we exceed mean + 3std, we'll comment on that later). The inputs of this simple DSP would then be:
- the signal (A)
- the mean (B)
- the std (C)
The problem is that when we want to compute (e.g.) A - (B + 3*C) we have a dimension mismatch: A is of dimension 64 (size of the chunk, we have one single channel), while B and C are of dimension 1. The equation works perfectly well if B and C are hard written in the equation (as done for example in the "Use the force" scenario"). But we need to update them... So the question is how to make the simple DSP box performing simple operations between a signal (a matrix) and floats as variables?
Once this is solved (hopefully, it can...), we would like an openvibe stimulation to be triggered when the condition is fulfilled. If we subtract the mean + 3std to the signal, one can use the Sign change detector box that issues a stimulation. But this is suboptimal, as only one stimulation is triggered, and we would like to use to the Stimulation validator to be sure that it is not a false alarm. This does not work for a simple sign change detector (or one needs to ensure that there is not a another sign change..., not easy). So the question is: is it possible to have a simple DSP box to trigger a stimulation, instead of a transformed signal? Or is there another box/way to do so?
Thank you very much for you help