Would this possible to do ? *Figures attached*

1 view (last 30 days)
Michael  Paris
Michael Paris on 15 Nov 2021
Edited: Tina on 15 Nov 2021
Hello, I am wondering if this would be possible to do, there is no way to explain it clearly through text I think so I hope these figures will work better. What I am trying to do is basically add in peaks manually like shown below where the inital peak at that point was not registered therefore I would be able to manually regsiter a peak at that point, there is another post of this however I do not quite fully understand what is being asked nor answered so I wanted to make my own post. Would these be possible, it is part of what I am trying to accomplish but assuring this is possible would make things easier, thank you very much!

Answers (1)

Tina
Tina on 15 Nov 2021
from what i see,your data is showing peaks with length higher than 0.6 you can change the min height of peaks and try to locate the peak you need.The peak you specificaly mentioned has a height of 0.6 .you can use the following code.s being the variable whose peak you are trying to locate
fs = 1e2;
t = 0:1/fs:1-1/fs;
s = sin(2*pi*5*t).*sin(2*pi*3*t)
s = 1×100
0 0.0579 0.2164 0.4335 0.6510 0.8090 0.8605 0.7836 0.5866 0.3066 0.0000 -0.2708 -0.4529 -0.5157 -0.4582 -0.3090 -0.1192 0.0508 0.1462 0.1316 0.0000 -0.2253 -0.4963 -0.7522 -0.9342 -1.0000 -0.9342 -0.7522 -0.4963 -0.2253
plot(t,s)
findpeaks(s,'MinPeakHeight',0.4)
See i am getting peaks of length higher than 0.4 .If i need to get peak at zero i can the min height to zero .
findpeaks(s,'MinPeakHeight',0)
And in your particular case you can change it to 0.5 or whatever length you desire
  2 Comments
Michael  Paris
Michael Paris on 15 Nov 2021
Edited: Michael Paris on 15 Nov 2021
Ahh okay this makes sense, and what if I wanted to keep the prominence at a fixed value like 0.4 and then do this insertion of peaks for a peak below this cut off of 0.4 ? Would that even be possible?
Tina
Tina on 15 Nov 2021
Edited: Tina on 15 Nov 2021
I dont think so .But if you have requirement for peak like a thershold or distance between peaks you can use
'MinPeakDistance' and 'Thershold'.But if you dont have any particular requirement and only want that certain peak then i don't think that would be possible .
Hope this help

Sign in to comment.

Tags

Products


Release

R2020a

Community Treasure Hunt

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

Start Hunting!