05-20-2010 06:54 PM
Hi everybody,
I'm trying to filter noisy analog inputs from 10 channels (DC). I'm sampling 100 samples/channel @ 1000 Hz. My idea is to filter the data with a lowpass filter (low cut-off freq @ 10 Hz, 3rd order butterworth) and then calculate the mean of every package of 100 samples. Eventually I'd like to receive values at a rate of 10 Hz, that can be displayed smoothly on the front panel and be written to a measurement file.
My problem is the following:
The Filter Express VI does not filter continuously after the VI started. It seems to reinitialize every time, the loop executes. The array of 100 samples before (white) and after (red) the filter are displayed in the 'filterResponse' image. If I take the mean of this array, it is of course lower than without the filter due to the transient values between 0 and 0.025s. I have built a simplified version of my VI with only one channel using the 'Simulate signal' VI and my concept seems to work well i.e. continuously (see 'filterMeanExample.vi'). I get the idea that this might have to do with the dynamic data type that is supported by many express VI's. But since I'm using the KEITHLEY VI, I don't use the dynamic data type. In fact, I had to convert its output into a waveform data type to get a suitable time vector for the measurement file.
I wonder how to keep the filter VI from reinitializing every time the loop executes.
My VI is rather bulky and contains the KEITHLEY 'Acquire Waveforms' VI which most people do not have in their libraries so I decided to post only pictures.
Thanks for your help!
Phil
System: WinXP, LabVIEW 8.2.1 Professional
Solved! Go to Solution.
05-20-2010 10:44 PM
05-21-2010 04:29 PM
Thanks for the advice, I got it fixed!
I used the butterworth filter VI from the Filter toolbox on the Signal Processing panel which accepts the array data type. I set the 'init/cont' variable to TRUE to prevent the filter from resetting its initial states to 0. I guess, that was my actual problem before. The Filter Express VI does not have this option so I was not aware of this feature.
However, a picture of the current setting is in attachment.
Thanks again,
Phil
09-20-2010 04:05 PM
Hi, I am working on a simular problem. I need a low pass filter which cut all signal above 400Hz. When I wire the filter with the input it is OK. But when I run the test, error shows that the f_low<f_high<f_s/2. I know I can set f_low and f_high, but where is f_s? Do you know that?
09-21-2010 01:40 PM
f_s is the sampling rate at which you are getting the values. This needs to be at least twice the highest frequency according to Nyquist theorem.
09-23-2010 01:32 PM
The VI that represents your DAQ input device should have an output with its sampling rate f_s. At least that's where I got it from and I just wired it to the filter icon.
Phil