10-15-2008 08:20 AM
Hi All,
Attached is a .vi that I recieved from this forum (Altenbach I believe).
Currently this vi copies every x line from a source file to a new file. It works great however now I am interested in reducing the sampling rate. For example I would like to grab every line initially, then grab every other line, then every third line etc. I was thinking that the easiest way to do this is to introduce a feature that counts up (i.e. grab on line then skip a line, then skip 2, then skip 3, then skip 4...etc to the end of the file).
Any thoughts or help would be greatly appreciated. (Note: I am a very new user to labview and it may be a simple change that I am missing)
Solved! Go to Solution.
10-16-2008 07:16 AM
At the frontpanel you have a control, called "decimation factor", this should be what you are looking for.
Christian
10-16-2008 07:19 AM
Hi Christian,
Thank controll sets the number of lines skipped for the entire file. (e.g. if I enter 5, then every 5th line is copied.)
What I am interested in doing is have that value change as the file is being copied. So initially I would like to skip no lines, then 1 line, then 2 lines, then 3 lines, etc.
Essentially it will act as a decreasing sampling rate.
10-16-2008 09:34 AM
Withing the while loop you are indexing the array using a multiplication of the iteration terminal and the decimation factor.
What you would need is to use the logic which index the array in your way, instead of this fixed decimation factor, thats all.
10-16-2008 09:41 AM
I've played around with trying to do that but with no luck.
I am very new to lab view and am likely making some simple errors.
Would you possibly have the time to quickly modify the vi that posted so that it is close to what i need and then i can play with it from there.
Sorry for the hassle.
Thanks!!
10-16-2008 11:43 AM
Attachement is compiled for 8.5.1
10-16-2008 11:58 AM
10-16-2008 11:59 AM
sjberg wrote:Attached is a .vi that I recieved from this forum (Altenbach I believe).
Just for my reference, the original thread is here. It's always best to provide some context. 🙂
10-16-2008 12:03 PM
10-16-2008 12:03 PM - edited 10-16-2008 12:04 PM
Christian_M wrote:Attachement is compiled for 8.5.1
I don't think the calculation for N is still correct. We probably need a while loop to see when we run out of elements (or do some more fancy math).
Ideally, the decimation rate should depend on how fast the important values change with each line: Skip many lines if the value is nearly constant, but retain most lines if the signal changes significantly between lines, for example.