-
Notifications
You must be signed in to change notification settings - Fork 9
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
Resampler - work in progress #14
Comments
ODK_ASSERT_LTE(idx + 2, fp.size()); to prevent issues with unsigned size() values of 0 (or add ASSERT_LT, which requires a change in two codebases). But this immediately triggers a Unit test error -- I will look into that.
I will look into the ASSERT problems and push an updated version probably by tomorrow. |
Great! Regarding 2) It seems that I am having issues here with real-world data. Especially with start of the stream. I cannot guarantee that the first package (lets call it start of stream - |
I added a fix that addresses the problem with reading past the last element of the input vector. OXYGEN-SDK/examples/sync_resample_source/odkex_sync_resample_source.cpp Lines 161 to 163 in d1d688e
Currently, the assumption is that all data starts at time 0, but it should not be hard to initialize m_last_timestamp of the Resampler to a different value here:
ADD_CONTIGUOUS_SAMPLES should be able to handle pauses in the beginning of the stream (after the initial pause, all samples must be provided as it is a sync channel). |
I will test the improvements on my code base. @matthiasstraka When talking about real-world data, lets first define a use-case: For example, microcontrollers are streaming ADC-samples to the host by sending, e.g. 1000 samples every 100 mS - giving us 10.000 samples/second. The microcontrollers are synced by, e.g. gPTP and have a common understanding when exactly 1000 samples are acquired so that the timestamp is a global time among all microcontrollers. Scenario A Scenario B So, i think the Packet Loss
Hence we can calculate the missing number of samples and fill up the stream again with either 0 or NaN. |
Hi,
@matthiasstraka, I have several questions regarding the newly implemented
Resampler
- as we can directly discuss source code here it might be the easiest to discuss questions within this issue and simply close it when we are confident everything is working.Out of Range issues
I think the following check should be
but is
OXYGEN-SDK/odk/framework/src/odkfw_resampler.cpp
Line 59 in 257b418
First Sample Timestamp
The first sample timestamp should be calculated based on the current amount of samples?
So, instead of
OXYGEN-SDK/odk/framework/src/odkfw_resampler.cpp
Line 101 in 257b418
So, I suggest to do
Furthermore, an additional safety check is a good idea to prevent negative timestamps
What are your thoughts on that?
The text was updated successfully, but these errors were encountered: