LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Does LabVIEW have 1st order lag filter VI?

My coworker wants to apply 1st order lag filter to a 1D array.

Is there a built-in VI or a third-party library for that?

0 Kudos
Message 1 of 3
(2,413 Views)

I was not familiar with the term "lag filter" although I have used many kinds of filters for many years. When I Googled it I found that it is a simple weighted running average.

 

"

The formula for a first order lag filter is fairly simple:

   new_filtered_value = k * raw_sensor_value + (1 - k) * old_filtered_value

 "

 

I do not know of any built in VI to do that but it would be very easy to implement in a while loop with a shift register.

 

Lynn

0 Kudos
Message 2 of 3
(2,390 Views)

The Control Design and Simulation Module has the functions you are looking for:

 

http://zone.ni.com/reference/en-XX/help/371894G-01/lvctrldsgn/construct_special_model/

 

This VI will design a 'transfer function' that is first-order model and you can implement using the function:

 

http://zone.ni.com/reference/en-XX/help/371894G-01/lvsim/sim_transferfunction/

 

or using the discretized version:

http://zone.ni.com/reference/en-XX/help/371894G-01/lvctrldsgn/cd_disctransfunc/

 

Now, if you are just looking for this specific function, you can probably just use the equation above using pure LabVIEW code. However, if your coworker wants more functions in the future, I would advice to look into more into this module.

Barp - Control, Simulation, RTT and HIL - National Instruments
0 Kudos
Message 3 of 3
(2,377 Views)