qelapsedtimer

Algorithm for masking time when the signal is above a threshold

让人想犯罪 __ 提交于 2021-02-11 15:37:34
问题 I have a realtime signal from a sensor. I need logic to implement a masking time once the signal is above a threshold. As shown below: Here the signal (in blue) crosses a threshold. And I need to mask for any checks for the threshold for a period (masking time). (In this way I can detect only the positive pulse , similarly, I have another check for negative pulse ) See the code below: static QTime time(QTime::currentTime()); // calculate two new data points: double key = time.elapsed()/1000.0

Algorithm for masking time when the signal is above a threshold

做~自己de王妃 提交于 2021-02-11 15:36:46
问题 I have a realtime signal from a sensor. I need logic to implement a masking time once the signal is above a threshold. As shown below: Here the signal (in blue) crosses a threshold. And I need to mask for any checks for the threshold for a period (masking time). (In this way I can detect only the positive pulse , similarly, I have another check for negative pulse ) See the code below: static QTime time(QTime::currentTime()); // calculate two new data points: double key = time.elapsed()/1000.0

QML Timer - How to improve accuracy?

亡梦爱人 提交于 2019-12-31 01:48:08
问题 I'm developing a QML metronome. I used a timer with interval 60000/Beats per minute. However it isn't really accurate. How can I improve the accuracy. Should I use a Timer, or is there a better solution? 回答1: The fundamental issue with QTimer that it uses the Qt event loop for the timing. Unfortunately, it cannot be accurate enough, inherently. The latency for notifications and all that within the event loop is getting in the way. You would need to consider a timer that does not actually