How to find the average of peaks in a noisy signal?

10 views (last 30 days)
I want to find the average values of peaks on my signal. Only using the function "findpeaks()" won't work because its a very noisy signal.
  4 Comments
Delfim Joao
Delfim Joao on 30 Jul 2018
thank you so much for responding. Jonas, I tried that but it will just flatten the peaks and the values won't be that much accurate.
Adam, I want the average value of the points inside a single red circle.
Image Analyst
Image Analyst on 30 Jul 2018
Did you try my solution below? Did you even scroll down and see it? I believe it should work. If you attach your data in a .mat file, and explain exactly what the ambiguous "average of peaks" means, I can try it.

Sign in to comment.

Answers (1)

Image Analyst
Image Analyst on 30 Jul 2018
To find the average value of all the peaks, why not simply mask and use mean()?
mask = signal < -0.3;
meanValue = mean(signal(mask))
If you need the mean value of each peak individually, use regionprops():
props = regionprops(mask, signal, 'MeanIntensity');
meanValues = [props.MeanIntensity];
  1 Comment
Delfim Joao
Delfim Joao on 31 Jul 2018
Hey analyst, I saw this and I was looking into it because I've never used this command before. So Basically what I'm trying to do is to plot automatically a graph of force vs the number of pass in the workpiece by taking the average value of the peak each time the tool passes the workpiece on the Force vs time graph. I'm trying to plot something like this:
THANK YOU SO MUCH for your help!!!

Sign in to comment.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!