12-31-2018 12:15 PM
I have 9 accelerometers connected to NI 9237 modules. I collect the data and then after data collection I apply a butterworth filter and then do some calculations to get acceleration, etc. and then plot the results in Labview. The raw data does not have any "spike" or initial peak but something is happening between data collection and the butterworth filter I am applying. I know it is between those two processes because I export the data after the daq is done running and that data does not have any initial spike. Then I exported one of the channels after the butterworth filter and the spike is there. Is this spike indicative of an error in the filter? If so, what's happening and how do I fix? I don't want to just remove the first bit of data if the error is showing that there is a bigger problem. Note that the spike is there even if I just run the daq and don't move/impact the accelerometers.
Also, I am attaching a screenshot of where the filter is applied. filter type is lowpass; cutoff freq is 1000 hz and sampling freq is 20k. Not sure if this matters but I am utilizing a state machine setup.
Thanks in advance
Solved! Go to Solution.
12-31-2018 12:50 PM
That's because the initial state of the filter is zero, then it takes time for the actual samples in the waveform to "filter" in and elevate the output to match. There are some techniques to work around this. One would be to take the first few seconds of the waveform and append it to the front of your waveform, filter it, than cut off the first few seconds of the results.
12-31-2018 01:24 PM - edited 12-31-2018 01:25 PM
I usually do this in all my programs to make sure that doesn't happen. Removes the offset that produces the spike and then adds it back afterwards. If you are doing something other than a lowpass filter, don't add it back in.