pluxbiosignals / unity-sample

Unity Sample APP intended to show a practical integration of PLUX devices with the Unity environment, encompassing functionalities such as: the search of compatible Bluetooth devices and also the start/stop of a real-time acquisition.
15 stars 3 forks source link

On Data Received being called every 1 second in Unity #13

Closed chajuss closed 1 year ago

chajuss commented 1 year ago

Hi,

My Unity project take 2 sources of Plux data (ECG & Resp). Using your Hybrid8Test.cs example, I'm setting everything and manage to get RAW data from the sensors, however the callback for OnDataReceived is being triggered every 1 second, which is not good for ECG data as I'm losing critical samples.

Is there a way to change the rate in which this callback is being triggered?

Thanks

GRamosPlux commented 1 year ago

Dear @chajuss,

Thank you very much for opening this issue and for being part of our enthusiastic community of users! We will be pleased to clarify the pertinent question that you attentively formulated.

Regarding the 1 second interval, between the communication of two packages of data, your perception is totally correct, for the current sample, the team applied a subsampling factor to limit the refresh rate of the GUI, i.e., as you properly mentioned, per second only one package of data reaches the GUI.

In order to remove this "filtering/subsampling" stage (and receive all acquired samples in the GUI), the changes highlighted below can be helpful:

On the other hand, if you would like to keep the subsampling but change its periodicity, this can be achieved by editing the value 1 (line 321 of the following example >>> Subsampling Customization). For example, decreasing the periodicity to 0.5s can be achieved by replacing the 1 by 0.5.

We strongly hope that the previous information can be helpful. The team will carefully wait for your important feedback!

My best and sincere regards, @GRamosPlux

chajuss commented 1 year ago

@GRamosPlux Thanks for your fast reply, your suggestion solved my issue!

GRamosPlux commented 1 year ago

Dear @chajuss,

These are excellent news, thank you very much for your extremely attentive update!

If any new question arises, please, do not hesitate to open a new Discussion. It is always a pleasure to support our esteemed community of users.

In the meantime, let us wish you a continuation of an excellent day and exciting discoveries in your research.

My best and sincere regards, @GRamosPlux