LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Reading a signal with a lower frequency than the frequency it's being genertated with

Solved!
Go to solution

I am using the producer-consumer programming structure and I have a signal from one loop, which is being generated point by point with a frequency of 10Hz for example and I need to read that same signal with a lower frequency in the data acquisition loop (with 5Hz for example). My goal is to intentionally skip some samples of the original signal and read less samples in the data acquisition loop but as I am using queues which are working according to the first in - first out principle, I am going to acquire all the samples anyway, only with a lower speed. Do I understand it right so far? If yes, I would like to know how to skip samples programatically in a way corresponding to an acquisition rate of 5Hz or 3Hz for example.

0 Kudos
Message 1 of 2
(729 Views)
Solution
Accepted by topic author Amr95

I'm not sure if I understood correctly.

 

In the consumer, you query/empty the queue and then do something with the elements in it.

 

You want the consumer to do some downsampling based on a user input. In the example, You have 5 Hz and want to go to 3 Hz, which means for every 5 samples, you keep 3 samples and then skip two samples, which in the long run evens out to 3 Hz. You could also spread out the skipped samples, for example: Keep 1, Skip 1, Keep 2, Skip 1, Repeat.

 

Maybe like this?

LLindenbauer_2-1606213007770.png

 

Labview can also do the downsampling for you, if you bring the data into array form, with no need to roll out your own code. Check out https://zone.ni.com/reference/en-XX/help/371361R-01/lvanls/decimatecont/

 

 

0 Kudos
Message 2 of 2
(715 Views)