I have a system that regularly collect a time domain signal and I have to count the number peaks. The difficult part is that for some reason some noise may come up as spikes that make conventional counting algorithm such as local maxima or turning point do not work perfectly. Expert here please suggest method for counting the number of peak. I am attaching a sample diagram showing 32 peaks that is typical. Million thanks!
Have you tried running a smoothing algorithm over the data before your conventional counting?
If the spikes are single point, then a simple 3-point median smooth is quite effective. Sometimes a combination of median then binomial or S-G smoothing may help. You need to try with your data to see what works.
Thank you for your recommendation. I tried some sort of low pass filter but it is not that effective if the spike is really strong. I will try your approach. Thanks!
Are your peaks always above a certain height relative to the baseline and your spikes always lower than a certain value relative to the baseline? If so, you might combine a peak detection (slope change or derivative method) with a height restriction criteria. IOW, detect all the peaks, then eliminate everything below a certain threshold in height (or select only those above a certain threshold in height).
The underlying frequency of your peaks and spikes seems comparable, so I suspect that low pass filters or smoothing might still not clear all issues consistently, though it could also offer a cleaner starting point for further processing.
--
J. J. Weimer
Chemistry / Chemical & Materials Engineering, UAHuntsville
Are your peaks always above a certain height relative to the baseline and your spikes always lower than a certain value relative to the baseline? If so, you might combine a peak detection (slope change or derivative method) with a height restriction criteria. IOW, detect all the peaks, then eliminate everything below a certain threshold in height (or select only those above a certain threshold in height).
The underlying frequency of your peaks and spikes seems comparable, so I suspect that low pass filters or smoothing might still not clear all issues consistently, though it could also offer a cleaner starting point for further processing.
--
J. J. Weimer
Chemistry / Chemical & Materials Engineering, UAHuntsville
The peaks do have a minimum value but the spikes do not. Long time ago we use the threshold method but it is not that accurate just because of that. Here is a close snapshot of the data from the peak 4th peak and you can see those noise more closely between the 6th and 7th peak. You can see there are four groups of resonant peaks between the 6th and 7th peaks.
Here is the one with a lot of noise between the 6th and 7th peak from the left.
If this is electrophysiology recordings, the noise looks like the system pickup signal of a mobile phone to me. What I find is that if somebody carries a mobile around your rig and the place doesn't have robust signal strength, this often occurs, especially somebody is texting. I find that in a hard way
Here is the one with a lot of noise between the 6th and 7th peak from the left.
If this is electrophysiology recordings, the noise looks like the system pickup signal of a mobile phone to me. What I find is that if somebody carries a mobile around your rig and the place doesn't have robust signal strength, this often occurs, especially somebody is texting. I find that in a hard way
No. It is a kind of strain measurement result of a moving wheel. It is mechanical system actually.
Is your expected signal to be in a given frequency range? Have you tried doing a band pass filter (hardware) of the signal before it is collected?
It is because we are also interested to see the high frequency band of the signal and therefore we can just stop the high frequency band by adding a filter. In fact this is a mechanical system and we can't add a filter to it.
If the spikes are single point, then a simple 3-point median smooth is quite effective. Sometimes a combination of median then binomial or S-G smoothing may help. You need to try with your data to see what works.
Hope this helps,
Kurt
August 11, 2014 at 02:49 am - Permalink
August 11, 2014 at 03:57 am - Permalink
Does the example shown in your original post include problematic noise spikes? If not, it would be helpful to see the problem.
August 11, 2014 at 05:24 am - Permalink
Those peaks essentially no need to exist as pairs but most of the time they do.
The sample plot doesn't show those spikes. I will try to upload some noise data in addition. Thanks.
August 12, 2014 at 03:16 am - Permalink
August 12, 2014 at 02:29 am - Permalink
I think that a wide binomial or S-G smooth should deal with this - try with a width of 21 (say) or even ~double that.
Good luck,
Kurt
August 12, 2014 at 04:24 am - Permalink
The underlying frequency of your peaks and spikes seems comparable, so I suspect that low pass filters or smoothing might still not clear all issues consistently, though it could also offer a cleaner starting point for further processing.
--
J. J. Weimer
Chemistry / Chemical & Materials Engineering, UAHuntsville
August 12, 2014 at 04:25 am - Permalink
The peaks do have a minimum value but the spikes do not. Long time ago we use the threshold method but it is not that accurate just because of that. Here is a close snapshot of the data from the peak 4th peak and you can see those noise more closely between the 6th and 7th peak. You can see there are four groups of resonant peaks between the 6th and 7th peaks.
August 12, 2014 at 08:13 pm - Permalink
FindPeak
operation?August 13, 2014 at 03:11 am - Permalink
If this is electrophysiology recordings, the noise looks like the system pickup signal of a mobile phone to me. What I find is that if somebody carries a mobile around your rig and the place doesn't have robust signal strength, this often occurs, especially somebody is texting. I find that in a hard way
August 13, 2014 at 08:03 am - Permalink
August 13, 2014 at 08:30 am - Permalink
No. It is a kind of strain measurement result of a moving wheel. It is mechanical system actually.
August 20, 2014 at 12:59 am - Permalink
It is because we are also interested to see the high frequency band of the signal and therefore we can just stop the high frequency band by adding a filter. In fact this is a mechanical system and we can't add a filter to it.
August 20, 2014 at 01:01 am - Permalink