LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Exponential File Size Reduction

Solved!
Go to solution

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)

0 Kudos
Message 1 of 11
(4,137 Views)

At the frontpanel you have a control, called "decimation factor", this should be what you are looking for.

 

Christian

0 Kudos
Message 2 of 11
(4,081 Views)

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.

0 Kudos
Message 3 of 11
(4,077 Views)

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.

0 Kudos
Message 4 of 11
(4,048 Views)

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!!

0 Kudos
Message 5 of 11
(4,043 Views)
Solution
Accepted by topic author sjberg

Attachement is compiled for 8.5.1

Message 6 of 11
(4,027 Views)
Thanks Christian. I feel like a leacher when I blatantly ask for the code.
0 Kudos
Message 7 of 11
(4,023 Views)

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

Message 8 of 11
(4,022 Views)
Thanks Altenbach. I'm still figuring out this ni world Smiley Happy
0 Kudos
Message 9 of 11
(4,020 Views)

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. 

Message Edited by altenbach on 10-16-2008 10:04 AM
0 Kudos
Message 10 of 11
(4,019 Views)