LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to initialize filter state?

Solved!
Go to solution

Hi,

 

In a VI I continuosly acquire and filter several different signals (with for instance the Butterworth Filter or the point by point Butterworth Filter). The problem is that each time I call the filter vi it eithers starts from a 0 state or from the state it had when analyzing the previous signal (depending on the bolean control).

 

What I would need to do is to read the final state of the filter when it finishes filtering a piece of "signal A". Then, the next time I need to filter a piece of signal A, I could feed those values as the initial state to the filter.

 

I actually opened the Butterworth Filter VI, then inside I opened the IIR cascade filter inside, and in there there are shift registers that would give acces to the initial and final states of the filter. But since it is within the Labview libraries, I cannot edit them.  

 

I have also noticed that if I have in the VI independent instances of the VI for each signal, then each one keeps track of its own states. But I have more than 25 different signals (and the number changes all the time) so that is not a viable solution.  

0 Kudos
Message 1 of 2
(3,884 Views)
Solution
Accepted by topic author Pablo Estevez

Found the answer myself, but post it here in case someone else has a similar question.

 

VI's like IIR Cascade Filter with I.C. (initial condition instead of initial state, that is why I couldn't find it before), let you initialize the filter and save its state for later. The only thing is that you have to get your own coefficients with something like Butterworth Coefficients VI or so. But that is also an advantage, since you don't need to use time in every iteration recalculating them.

 

 

Message 2 of 2
(3,868 Views)