LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

change all VI s in Project from Double to single Precision


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. 😉

0 Kudos
Message 11 of 16
(1,036 Views)

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

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 12 of 16
(1,024 Views)

@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. 😄

0 Kudos
Message 13 of 16
(1,017 Views)

@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

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 14 of 16
(1,011 Views)

 

Try this.  You'll have to debug it yourself; I just threw it together, I didn't try it out.

Have fun.

"If you weren't supposed to push it, it wouldn't be a button."
0 Kudos
Message 15 of 16
(1,000 Views)

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.

Message 16 of 16
(994 Views)