LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Filter Express VI - Bumpless transfer?

Hi,

 

We use the Filter Express VI on many of our applications and we like it.

 

However, if we call a loop that uses the Filter Express VI the result will start at zero and eventually settle on the desired filtered result. We notice this on the first call of the filter after starting the main VI. Unsure of behaviour if the loop has been called before and the loop is not scanned.

 

Is there a way to have the Filter Express VI output a value close to the input value on first scan and then trend back to the desired filtered output? Something like a "bumpless transfer".

 

Dave

0 Kudos
Message 1 of 7
(2,782 Views)

Anyone?

0 Kudos
Message 2 of 7
(2,731 Views)

Short answer, not easy to do it without a bit of a bodge. However, following the advice in the last para of this page

 

 pre-load-filter-bd.png

 

pre-load-filter-fp.png

 

 

 

 

 

0 Kudos
Message 3 of 7
(2,716 Views)

This may be another case where the Express VI is not the right choice. Many of the standard filter VIs have an init/cont? input. In the initialize mode the internal state of the filter is reset and the transient response will occur. In the continue mode the next set of data is expected to be a continuation of the previous set (as it should be in your loop) and no new transient will occur.  You wire a Not Equal to Zero? comparison to the "i" terminal of the loop and the output to the init/cont? input of the filter VI. It initializes on the first iteration and not after that.  Of course if you change filter parameters or interrupt the data acquisition, you also need to run another init cycle.

 

Lynn

0 Kudos
Message 4 of 7
(2,688 Views)

True that the Express vii may not be the best choice, but using the init/cont terminal of a standard filter vi will not solve the OP's problem.

 

As I understand it, he is specifically trying to eliminate the rise from zero at the start of the first data set (though says he is unsure of the behaviour on subsequent data sets too). With no prior data, a filter vi will ramp up from zero regardless of the setting of the init/cont input.

 

There are two ways of handling this problem. The first simple yet inelegant way is to supply some prior data to the filter to get the output up to level before your real data starts. The second is to use an advanced FIR or IIR filter and supply initial conditions to the coefficients array (see FIR Filter with I.C. VI ) - however this is supplying the values of the coefficients (not the data) and working them out is depressingly complex (rubbing sand in one's eyes is probably less painful).

 

However, for subsequent data sets (running the loop again after it has been run once, as the op puts it), the init/cont input is the exact right solution 🙂

0 Kudos
Message 5 of 7
(2,683 Views)

The key point is that all filters have a transient response which is unavoidable. If you have enough prior information about your signal you may be able to preset the filter internal states to minimize the effect.  If you have that much information, do you really need the filter?

 

Lynn

0 Kudos
Message 6 of 7
(2,678 Views)

Wow,

 

Really great answers. Quite insightful into the inner workings too.

 

It will give me a lot to think about. I agree they may not be the most appropriate method. We really just use them to smooth an analogue input so a running average with a first scan check may be more appropriate.

 

I will have a look at Averaged DC-RMS VI and the other similar options in more detail. Not sure of the behaviour yet but keen to learn.

 

Thanks heaps for the quality response.

 

Dave

 

 

0 Kudos
Message 7 of 7
(2,661 Views)