From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

real-time pt-by-point filtering

I have a problem attempting to get pt-by-pt filtering to work the way I expect.  I have an application where i need to adjust the frequency characteristics of the filter as the data comes in (I dont want to reset the filter).  I made a simple simple demonstration of the problem - a pt-by-pt input waveform (with noise) and the filtered output - both charted.  When starting the vi, everything works as expected - the filtered output looks correct, etc.  But as I adjust the frequency of the filter, nothing happens.  Reseting the filter with the init button makes the necessary changes but also appears to lose the previous data.  It appears that the filter coefficients are made only for the first call.....unless resetting.

Is there a way to have an adjustable pt-by-pt filter control without reseting the filter?

Thanks
Brian
0 Kudos
Message 1 of 3
(3,150 Views)
Hi Brian,

The behaviour you're describing is how that VI works. As you can see from the block diagram of the VI, it only checks what the filter parameters are the first time the VI runs and then whenever the initialise control goes to true.



As the IIR Cascade VI checks what the filter parameters are for every iteration of the while loop anyway, you could just re-write the butterworth filter VI and remove the case structure so that it checks what the filter parameters are each time the loop iterates.

The reason those front panel objects are in that case structure is to prevent that PtbyPt Butterworth Filter VI from reading the front panel each time the loop iterates, making it more processor efficient. If you need to keep this efficiency, you could put a check in your code so that you reset the Butterworth filter VI each time the Filter Frequency is changed.

Message Edited by SarahB on 07-25-2006 10:59 AM

Sarah

Applications Engineer | National Instruments | UK & Ireland
0 Kudos
Message 2 of 3
(3,136 Views)
Brian,

In addition to what Sarah said, exactly what is the intended result of changing both the filter parameters and the input frequency without resetting the filter? All filters, hardware or software, have a settling time (or number of samples) to achieve a steady state output. If either the filter characteristics or the signal frequency change during that settling period, the output may not be very meaningful.

What are you actually tring to accomplish? That is, what is the intended use of the output from your filter? Maybe a filter is not the best way to accomplish what you are trying to do.

Lynn
0 Kudos
Message 3 of 3
(3,126 Views)