Modifying the findpeaks function using figure
2 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Hi all,
Hopefully there is an answer to my request, but I have little hope. I am turning to you (the very intelligent MATLAB community) to help me out.
Here's a little info about my data. Below is a figure of the changes in angle of a bird's beak. I am using the lateral motions of a birds beak to answer some questions for my thesis. At time=0, the beak is on a slight angle of 3.25 degrees. As I show the stimulus to the bird, the bird moves its head in the direction of the stimulus. At time=40, the bird has translated its head from 3.25 degrees to 5.25 degrees. These are very small motions, so I must be very careful with what I am measuring.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/164312/image.png)
I am using the 'findpeaks' function to find the peaks and troughs for my data. Peaks are depicted as red triangles, and the troughs as blue triangles. The regions in green are the periods where the bird is following a stimulus and I am finding these time periods by finding the region between a TROUGH to PEAK. The regions in white are the potions of data where the bird is resetting its head to initiate another head cycle and these are periods where the bird goes from a PEAK to TROUGH.
My method for finding these periods are good, but they're are not good enough. As you can see, the regions in blue and red are unwanted. The region in blue are highlighted regions of data that are found between PEAK and PEAK. Conversely, the regions in red are tracked periods from TROUGH to TROUGH.
Now for my question. I've tried a multitude of available settings in the 'findpeak' function, but I still can't get a perfect recording. Is there a way that I can manually add, remove, or modify tracked peaks and troughs using the figure itself? I want to convert all the unwanted blue and red regions into green regions, is this even possible? Could I run the script first, then modify the graph to update the variables of the peaks and troughs.
Does this make sense? If it doesn't I can clarify! Please help me, I appreciate all the help I can get.
All the best! T
1 comentario
dpb
el 15 de Jun. de 2014
Editada: dpb
el 15 de Jun. de 2014
I'd guess the only hope anybody would have would be to look at a particular dataset as well, and I'd also then guess that whatever other tweaks you add to fix up one dataset may not work on another.
But, I'd suggest looking at the difference between why (I guess?) two peaks weren't found at the blue region around 4 sec as compared to why they were (apparently desired?) in the very similar-looking section just following.
If you can determine the "why" of what in the current findpeaks setting is discriminating between those two, it may give you some ideas of how else to decide what is/isn't a peak/trough.
Is the end goal the automated method or the final result? IOW, does it really matter that much if you do manually fixup a few points that are judged to be in error by the code? Or, in yet another way are you focusing to much on the method and not the objective? (Just points to ponder...)
Respuestas (1)
Star Strider
el 15 de Jun. de 2014
In your original post, you also had ‘beak angular velocity’ depicted. (I wish you’d kept that one up as well.) I thought about this (since I didn’t see an obvious pattern when I looked at it last night), and suggest that perhaps calculating the angular acceleration (from the angular velocity) might provide useful data for discriminating the behaviour of interest. Your data don’t appear noisy, so calculating acceleration is a viable option.
Name the function you use to discriminate successfully the various aspects of your data ‘findbeaks’. (I couldn’t resist!)
0 comentarios
Ver también
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!