LabVIEW Idea Exchange

cancel
Showing results for 
Search instead for 
Did you mean: 
Mark_Holm

Single Precision Measures of Mean.vi

Status: New
Measures of Mean.vi only takes double precision float as input. When I use single precision to save space, and where A/D resolution is the limiting factor anyhow, it is pretty annoying to have to promote a whole array of data to double just to get the median (or another of the functions in Measures of Mean). Can't this thing be recompiled to be able to do both double and single?
2 Comments
nanocyte
Active Participant

I need an integer implementation of the regular median. I'm on an RT target so the conversion to dbl is not trivial. Integer comparisons should be slightly higher performance too right?

X.
Trusted Enthusiast
Trusted Enthusiast

Those VIs (located in the Probabilty & Statistics palette) are based in part on DLLs.

They shouldn't.

They should be polymorphic.

The code for geometric mean reads as follows:

Screen Shot 2016-12-30 at 09.48.21.png

It WILL result in overflow in cases where there is no good reason for it to do so.

A similar problem is present in the "trimmed case.