We are trying to figure out how to build a flow meter around the TI microcontroller and USS library.
The settings we are using are as on the screenshots 1 and 2 below.
The ADC capture before the USS algorithm is run is on the screenshot #3.
Our problem is we need to figure out how do we set the "Envelope Crossing Threshold". We are observing the following weird behavior of the algorithm of the USS library: when we set the Envelope Crossing Threshold around 30%, we observe fluctuations of AbsToF that we attribute to capturing different periods of the signal (like the next or the previous) - the fluctuations are exactly around 750uS (our working frequency is 1.25MHz).This is weird as looking at the capture we don't see anything around 30% - the first half wave is around 500 units - around 50% - please see the screenshot #3.
So we are looking for the explanation of this phenomena and more importantly for the guidance on how to set the Envelope Crossing Threshold properly looking at the actual ADC capture.
Further, trying to figure this thing out ourselves, we've changed the open part of the code so that the HMI_PostMeasurement_Update is now AFTER the application of the algorithm. And the result is on screenshot #4. As you can see, now the first wave is exactly around 300 units which is around 30%. So it seems that the data is altered in the algorithm and the Envelope Crossing Threshold is being applied only after that. Of course we are not trying to get any secrets here, but if you guys can comment on why you have altered the signal and how are we supposed to set the Envelope Crossing Threshold given that the signal is actually being altered would be very helpful.