07-14-2007 01:18 PM
07-14-2007 01:59 PM - edited 07-14-2007 01:59 PM
There is no way to tell where the slowdown occurs unless you also include the missing subVIs?
Where is the "other time series" coming from?
Since you don't have the path wired, it will prompt you for all files. Is that right? Can't you process an entire list of files unattended instead? It seems silly to occupy an operator for hours selecting 999 files in a row. How are you running this? Is it a subVI in a toplevel program?
Overall, your code looks overly complicated, but (except for the missing subVIs) should run pretty fast. How big are the arrays? Since you only seem to operate on the first ~100 elements, make sure you don't drage huge files into this. 😉
Please attach a full set of VIs, some example datafiles, and tell us how it is supposed to be used.
Message Edited by altenbach on 07-14-2007 12:00 PM
07-14-2007 10:09 PM
07-15-2007 11:32 AM
07-15-2007 12:02 PM - edited 07-15-2007 12:02 PM
Message Edited by TonP on 07-15-2007 07:05 PM
07-15-2007 02:42 PM - edited 07-15-2007 02:42 PM
Things just don't add up!
@Schola wrote:
The VI is trying to calculate Approximate Entropy which calculates the maximum likelihood the ratio of adjacent vector (x,y) is similar to adjacent vectors (x,y,z).
You read ONE file, where you take adjacent pairs in the upper part (I guess these are (x,y)), but in the lower part, you take triplets (presumably (x,y,z)). In "tolerance vectors", you then clone these subsets to arrays of either 1000 points (upper) or 1500 point (lower), but compare them with only a 1000 point subset. Now you only run the FOR loop 1 times, while in the first post, the FOR loop had a count of 100. Which one is correct?
You still haven't told us the size of the original array. Are "x,y" and "x,y,z" 2D and 3D coordinates, resp?
Your "Tolerance vectors" subVI is not needed at all, because it just inflates existing data with hot air, while not adding any new information. Most likely it would be much faster to get the two (three) numbers x,y,(z) individually and decimate the size=1000 subset to 2(3) 1D arrays. Now you could just compare the scalar (x,y, or z) each with one of the decimated arrays. Let me know if this is not clear!
Also, you take the absolute value which is definitely not needed because the sum of ones is always zero or greater, right?
Do you have a website explaining the math behind your algoritm?
As mentioned, you definitely can get rid of the "tolerance vectors" subVI entirely, but here is another alternative for your enjoyment. It is probably slightly less efficient to TonP's version, but simpler in code. 😉
Message Edited by altenbach on 07-15-2007 12:49 PM
07-15-2007 02:53 PM