12-22-2009 03:34 AM
12-22-2009 03:53 AM
You could use a running average of the signal, just put a logical filter in front that says that the signal value is only to be fed to the averaging buffer if it's not part of a spike.
Delay the evaluation of each value a certain time and check if there are peaks on each side of the value that are similar in amplitude. If there is (you could also include an amplitude range criteria here; that it should not be close to the major peaks e.g.) - then the value is part of the baseline and should be included in the running average.
12-22-2009 04:16 AM
Thanks for the reply. I understand what you are saying. However, I might have to modify my method for measuring the peaks if I choose to implement your idea. I have taken a screenshot of my "peak finder" code and attached it.
Bascially, the reset terminal is wired to a timer which outputs a pulse every few seconds. This resets the vi (a standard NI one I think) and sets the peak magnitude back to zero. This way, I am windowing the signal and measuring the maximum peak in every window. This is what I need to do.
So I could use a logical filter to feed data to the running average only if;
the amplitude of the signal is less than a certain threshold
and if the current value has similar low peaks either side of it
How would you construct the code to delay the evaluation so that the values in front and behind of the current data point can be analysed?
thanks again