04-29-2015 02:19 PM
aparab wrote:I measure voltage amplitude to be specific , min max values & based on that do more measurements .
I divide my waveform into parts atleast 3000 & in each part in the waveform "Y" value is analyzed.
this is time consuming!
Are you sure that you current code is optimized? Sometime rewriting an algorithm will gain you orders of magnitude while changing to SGL would only give you bread crumbs.
Are you sure your current code is fully optimized (inplaceness, no extra data copies, etc). Going to SGL won't gain you that much unless you would run out of memory otherwise. 3000 points is peanuts for any representation.
Please show us some code. 😉
04-29-2015 04:18 PM
As already mentioned, code structure makes more for performance than SGL/DBL in most cases. My guess would be that you're doing calculations every sample or every loop that you really dont need to do that often. We'll see when you post it. 🙂
That being said, SGL can cut calculation times by a lot*, and if the data is so big it'll start to swap halfing the size could be all the difference you need.
*I just did an example where i calculated the average of a 10 million number array (sum of all values divided by the number) and it did in fact go twice as fast with SGL. Not that 10ms of DBLs instead of 5 would cause a problem, but still ...
/Y
04-29-2015 04:33 PM
@Yamaeda wrote:
*I just did an example where i calculated the average of a 10 million number array (sum of all values divided by the number) and it did in fact go twice as fast with SGL. Not that 10ms of DBLs instead of 5 would cause a problem, but still ...
With that many numbers you are getting into precision problems with SGL, see this recent discussion.
There is a good reason that most analysis tools operate exclusively on DBL. 😄
04-29-2015 05:03 PM
@altenbach wrote:
@Yamaeda wrote:
*I just did an example where i calculated the average of a 10 million number array (sum of all values divided by the number) and it did in fact go twice as fast with SGL. Not that 10ms of DBLs instead of 5 would cause a problem, but still ...
With that many numbers you are getting into precision problems with SGL, see this recent discussion.
There is a good reason that most analysis tools operate exclusively on DBL. 😄
Yeah, i had that discussion in mind. It seemed in this case, however, like the 6 digit precision wasn't that big of an issue. 🙂
/Y
04-29-2015 06:22 PM
Try this. You'll have to debug it yourself; I just threw it together, I didn't try it out.
Have fun.
04-29-2015 06:58 PM
Here's another implementation, might be a little easier to digest. Saved in LabVIEW 2014.
I'm really curious to see what kind of performance improvements (if any) you see after performing the conversion. Please post any benchmarks you come up with to this thread if you get a chance.