Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Signal2control module ideas #208

Open
stephenwhitmarsh opened this issue Feb 24, 2018 · 5 comments
Open

Signal2control module ideas #208

stephenwhitmarsh opened this issue Feb 24, 2018 · 5 comments

Comments

@stephenwhitmarsh
Copy link
Member

After exploring electrogastography, it became clear that this poses some (expected) practical problems.
EGG signal is at around 0.05 Hz, requiring minimally a minute long timewindow for the power estimate. More problematic, is that the fluctuations of power are expected to occur even slower. Which makes automatic/manual calibration very tricky indeed. I see two solutions:

  1. further develop a manual calibration, which would include somehow visualizing manually-set max/min. This could be done in plotcontrol, but it is also clear it would need colors&labels to distinquish the different control signals in a single plot. Still, this would be somewhat regressive, as we have found manual calibration to be inconsistent with our ultimate goal of automatic processing. However, there might be future uses of this and we should just bite the bullet IMHO.
  2. There are more features that are interesting in EGG. First of all the phase. I can image a preprocessing module (somewhat wide) bandpass filtering, and then sampling the instantaneous phase to create a control signal. This would then sonify the phasechanges over time, and reflect changes in frequency (speed of phase change) as well. I think it might also be more robust in terms of calibration as this does not concern a smoothed signa (i.e. not based on a sliding timewindow of amplitude), and could therefor be applied over 'just' a couple of minutes. This would require a new module that, according to a set 'stepsize' or 'delay' take the last sample in a buffer, and put that in redis as a control signal. Additionally, one could use an average over a certain timewindow. Alternatively, one could base the sampling on the timestamp, but this requires a different use of the FTbuffer as we have done so far. What are your thoughts on this @robertoostenveld?

Cheers,
Stephen

@stephenwhitmarsh
Copy link
Member Author

Another use of the second tactic would be for the accelerometers and motion capture signals.

@robertoostenveld
Copy link
Member

considering Fourier analysis: effects of spectral leakage will be very large for the 1st approach, since the window cannot be made arbitrary long. When you make it too long the effect of control will disappear.

I think that temporal analysis (with appropriate filters that have very long filter kernels) will be better. But estimating phase will be hard if the signal is not very periodic (1) and if its amplitude fluctuates (2). Both 1 and 2 cause the signal to become wider in the fourier spectrum.

I propose to start developing something in MATLAB, ignoring the noise for the moment.

@stephenwhitmarsh
Copy link
Member Author

stephenwhitmarsh commented Feb 24, 2018 via email

@robertoostenveld
Copy link
Member

robertoostenveld commented Feb 24, 2018 via email

@stephenwhitmarsh
Copy link
Member Author

Yes, ofcourse, I agree with the width of the EGG spectral peak. What I wanted to emphasize is that in my previous lab we have been arguably successful in identifying the EGG peak and extracting the phase. The example picture here is ofcourse of a representative subject - it is different from subject to subject:
http://iec-lnc.ens.fr/IMG/Files/Visual/Publications/2017_Richter.NIMG.pdf

But you are absolutely right that with a relatively small filterorder (still huge given the low frequency), we will have a pretty wide power/phase estimate. For the analysis of variance in the phase, the width of the filter allowed shifts in frequency. If I remember correctly, something like a half-width of 0.01 Hz was used. Practically, however, the filter-order was really a matter of a couple of minutes. Still, the point I wanted to make is

  1. that we do see to find a peak in the spectrum around EGG freq (0.05Hz), a bit higher in this subject: https://www.youtube.com/watch?v=HyRIeE0ZnX8
  2. using a phase-estimate of a bp-filtered signal will give us a more interesting control signal, which I agree will be under the influence by changes in amplitude. In fact, in my last experimental data, strange shifts in phase were caused by drops in signal (amplitude). However, it is a matter of 'doing the best we can'. How good that is, we should just have to see.

I agree we should do some offline tests. I will measure some EGG, say 20 minutes, this/next week, and take a look.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants