LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

filtering multiple waveforms simultaneously

I want to continuously acquire 32 channels (voltage, sampled 200Hz each, PCI 6031E) and I want to filter each channel to display it on a chart. The program scans say 10 samples of each channel, giving a 32x10 2D array of data. Next, in a for loop, I take every row and I filter every channel sequentially. However, this way every channel should be filtered, but they are screwed up. I also tried using software generated sinewaves to pass to the filters to exclude hardware causes and the same problem persists.
The filter (eg butterworth) is set to remember the filter state, but it doesn't know that it should have 32 different states, I presume. Meaning, filtering 10 samples of channel 3 should not use the filter states of filterin
g channel 2; but it should remember the filtering state of the previous 10 samples of channel 3.
I have not found a decent solution for this problem. The best result I got was when I cut-and-pasted 32 filter icons on the block diagram, and setting the init/cont parameter to true. This solution is not very elegant, however, and I don't understand why this does work. If I place many copies of the filter on the diagram, does that mean that each icon can remember its own filter state? While if I place 1 icon in a loop, it remebers only 1 state?

any help would be greatly appreciated
0 Kudos
Message 1 of 2
(3,197 Views)
I suggest using the waveform based filtering VI, Digital IIR Filter.vi. It is polymorphic on the input type (single waveform or array of waveforms), and was designed for the same use case you have described. They maintain individual state for each channel separately. It should be easy to bundle your array into a waveform, just be careful to timestamp the data correctly.
Message 2 of 2
(3,197 Views)