08-06-2024 02:00 PM
I'm using the "Filter" vi off the Waveform Conditioning Palette to smooth some data being collected from a fairly noisy sensor. I use it in a program that plots the Frequency Response of electromechanical actuator, and if I run it a second time with a new data set, the measurement gets distorted as if the filter isn't getting initialized, but if I stop the program and restart it works perfectly.
The vi doesn't offer any option to "initialize" it, and I if I try to build the function discretely, I get vastly different results.
Any suggestions on how I can initialize it without restarting the program?
Solved! Go to Solution.
08-06-2024 06:27 PM
@ScottR22 wrote:
I'm using the "Filter" vi off the Waveform Conditioning Palette to smooth some data being collected from a fairly noisy sensor. I use it in a program that plots the Frequency Response of electromechanical actuator, and if I run it a second time with a new data set, the measurement gets distorted as if the filter isn't getting initialized, but if I stop the program and restart it works perfectly.
The vi doesn't offer any option to "initialize" it, and I if I try to build the function discretely, I get vastly different results.
Any suggestions on how I can initialize it without restarting the program?
Let us see some code!
Generally, filter VIs do have a "reset? Input that is an "Optional" terminal default to False. Those Optional terminals are not normally shown in the context help window! There is a tiny icon on the lower left of the context help window that toggles the view of Optional input terminals! 😀
08-07-2024 05:50 AM - edited 08-07-2024 05:50 AM
It's an Express vi, there are no additional "Optional" terminals.
08-07-2024 05:55 AM
Hi Scott,
@ScottR22 wrote:
It's an Express vi, there are no additional "Optional" terminals.
So the simple solution is: don't use the ExpressVI, but use the filter functions in the signal processing palette…
08-07-2024 06:43 AM
Agree, but as I stated when I try to implement a moving average filter, I get very different results, and i would like to know what exactly is being done under the hood of this "canned" vi to make that the case?
08-07-2024 07:10 AM
I found my mistake, this solution works.
08-07-2024 07:39 AM - edited 08-07-2024 07:40 AM
08-07-2024 07:50 AM
That's actually the way I first tried to implement the moving filter, but I didn't have the for loop, I just sent blocks of the waveform data into the mean function as an array, the problem is it decimated the waveform so and I forgot to update my X-Axis accordingly. Using the discrete functions you suggested from the Signal Processing palette produced the exact same results as the Express vi without the Initialization issue, so theres a bug in the Express vi for sure.
Thanks for you assistance.
08-07-2024 07:54 AM
Hi Scott,
@ScottR22 wrote:
That's actually the way I first tried to implement the moving filter, but I didn't have the for loop, I just sent blocks of the waveform data into the mean function as an array, the problem is it decimated the waveform…
That's why I depicted the Pt-By-Pt_Mean function: it doesn't decimate the incoming data…
08-07-2024 08:01 AM
Appreciate it.