LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Trying to decimate with Signal Compression but get the wrong result.

Here is my problem: I'm sampling a signal with 1kHz sampling rate for 24 hours or more so this would generate a huge amount of data. I only need data for every minute so I need to compress 60K samples into one, taking the minimum of that 60K samples. I tried using the Signal Compression VI but it doesn't do what it supposed to.

My understanding is that the Signal Compression would take the "Reduction factor" amount of data and then would generate one number and would start over taking another bunch and generate one number and so on...

Is there anything else I'm forgetting?
0 Kudos
Message 1 of 12
(4,238 Views)
Hello Thomas,
The Sample Compression Express VI will take your signal input and then reduce that data into a smaller number of points. The Reduction factor specifies how many points in the input signal to convert to one point in the output signal. For example if you input an array of 100 points and your reduction factor is 50, it will convert every 50 points into 1 and output 2 points. If you input 100 points and your reduction factor is 25 it will output 4 points. I hope this helps!

Best Regards,
Chris J
0 Kudos
Message 2 of 12
(4,213 Views)
Thanks Chris!
That was my understanding so I guess there must be a bug in LabView because it generates bogus numbers. I input 60K points and I want 1 out (the minimum) so I sample w/1KHz and I want 1 point after every minute.
Sample compression generates a lot more and comes back with numbers that's not included in the input... Is this a known bug?
0 Kudos
Message 3 of 12
(4,203 Views)
If its a compression of the original data the most "appropriate" thing for the VI to do would be an average and not a minimum. If this is the case it should be possible to get a number not actually in the input data stream. If you need a minimum from 60k points I would custom write it in a while loop with a shift register...
0 Kudos
Message 4 of 12
(4,200 Views)
I guess the while loop is an option but I need the minimum, not the average and this VI supposed to be able to do that.
Thanks anyway...
0 Kudos
Message 5 of 12
(4,192 Views)
Hello Thomas,
Perhaps I don’t understand your question. I don’t appear to have any trouble running this VI. For example, if I want to reduce 100 points to 4 points I select a reduction factor of 25. The VI then takes the first 25 points and finds the min, max, last, mean, or median and stores 1 number to represent those points. It then does the same with the next 25 points and so on until it has an array of 4 points to output. Is this not the behavior you are seeing?

Best Regards,
Chris J
0 Kudos
Message 6 of 12
(4,171 Views)
Hi Chris,

That's exactly the problem that it's not what I get. I want to reduce 10K points to 5 so I set the reduction factor to 2000 but I get 10 points instead of 5.

T.
0 Kudos
Message 7 of 12
(4,161 Views)
Hi Thomas,
That is definitely not expected behavior. You can post a screenshot of your code here so that other viewers can see if there is perhaps a flaw in the coding. However, it does sound like you may have a bad install. You may want to contact NI Technical Support about this issue. You can contact NI at: http://sine.ni.com/apps/we/niae_asc.main .

Best Regards,
Chris J
0 Kudos
Message 8 of 12
(4,149 Views)
Hi Chris,

I attached a screenshot of the original version which did not work.
I was able to work around the problem by putting a timer in that resets the Sample Compression every minute (that's the frequency I need the data).

Thanks,
T.
0 Kudos
Message 9 of 12
(4,143 Views)
Hello Thomas,

That looks alright. I ran a similar thing here without any problems. I would recommend contacting Technical Support with this issue.

Best Regards,
Chris J
0 Kudos
Message 10 of 12
(4,122 Views)