-
Notifications
You must be signed in to change notification settings - Fork 1
Feature/rate of change #47
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
Conversation
TestingWas tested on Linux (booted on a T2 chip, 2019 MacBook Pro) Once with an expression value generator : changing rate of change Example file : https://drive.google.com/file/d/1m3JYEtMVVxy1xB6bwtAg25Uz6f__wSGL/view?usp=sharing And once with live data from Sensors2OSC (device orientation). The live data was then recorded and saved with CSV recorder, and output from the Rate of change object was compared to output from processing with similar algorithms in python, with the same parameters. Example file : https://drive.google.com/file/d/14Kgu6Ltq5tnpljXwV_a8uOMfd2DTg--3/view?usp=sharing Python file |
jcelerier
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Really great work thanks!
I have a couple comments but those can be addressed without issue in later PRs
| }; | ||
|
|
||
| // ring buffer storage | ||
| std::vector<Sample> _buf; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think there's already an unholy amount of different ring buffer implementations in ossia :p
What do you think about reusing the boost one? https://www.boost.org/doc/libs/latest/doc/html/circular_buffer.html
| void update_window_from_params(); | ||
|
|
||
| // parameter watchers | ||
| halp::ParameterWatcher<int> sample_count_watcher; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd like to think about a way to do parameter watching without requiring you to make your own class. What are the features you need from it ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
basically just to indicate when the parameter's value has changed
5894273 to
222c877
Compare
222c877 to
ac63edf
Compare



Summary
Adds a flexible rate-of-change (derivative) calculator for real-time signals. The module supports two windowing strategies—fixed sample count or fixed time window—and provides multiple output unit options. In time window mode, the last known value is held constant when no new data arrives, ensuring continuous output. Diagnostic outputs expose the internal window state for debugging and analysis.
Functionality
Input is:
Parameters are:
SampleCount(fixed number of samples) orTimeWindow(fixed duration)SampleCountmode, minimum 2)TimeWindowmode, 0.001–3600s)per millisecond,per second,per minute, orper hourOutputs are:
Implementation notes