08-17-2012 07:01 AM
Im trying to implement a low pass filter to filter data Im acquiring from gyroscope and accelerometer real-time, 100 samples/minute (cut into 25 packages containing 4 measurement points)
Ive tried looking in help, but didnt find anything that would filter signal real-time, just filtering previously acquired data with lets say Bw_LPF - yet it requires array of already sampled data.
What should I use for real time filtering? Operation isnt time-critical, but filtering it with FIR filter of lets say 50th or 100th order would cause the signal (which Im using later to generate a 3d preview of the sensor board) to 'lag' by entire second, thats why I thought using IIR would be better...
11-07-2012 12:09 PM
How did you acquire the data? 100 samples/min should be very easy to achieve with any NI USB DAQ device. The sample project "ContAcq-IntClk.prj" shipped with your LabWindows/CVI can provide you with very "real-time" performance for your timing requirement. The sampled data is then transferred into an array that you can process with any filtering functions easily.
Are you saying the filtering function that you used takes too much time to process the data array? Or do you simply have a slow DAQ problem? What DAQ device did you use? What filter function did you use? Can you post your code so that people can help you solve your problem?
11-08-2012 04:04 AM
If I understand correctly, you want to receive filtered output with every new package, but the filter requires at least 50 or 100 inputs. If this is the case, all you have to do is to use a shift register that is big enough (say a 100 samples). Then, if new data arrives (4 samples in your case) you shift them into the register (thereby throwing away the 4 oldest values) and then filtering can be done with this new dataset. Of course, this will cause a delay in the filtering at the start (until the register fills up), but then you'll get the filtered output with every new package.
I hope this answers your question, pease get back to me if anything is left unclear.