How to find x range value and calculate average of corresponding peaks in a graph signal?
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
Flavia Lerra
el 29 de Dic. de 2019
Respondida: Image Analyst
el 29 de Dic. de 2019
Hi everybody,
I need help for this task: I have a graphs with irregular peaks derived from matrices data and I would like to automatically calculate for each set of data the x range where peaks occur and the mean value of each peak.
I hope I will be more clear showing an example. Every peak in the bigger graph corresponds to a series of irregular peaks (an example is shown in the little graph, which represents the first peak).
Thanks for attention!
0 comentarios
Respuesta aceptada
darova
el 29 de Dic. de 2019
Try this;
index = find(y>100); % find peaks
ind = find( diff(x(index)) > 0.01 ); % find start and end of peak searies
index = [index(1) index(ind+1); % first row - start of series
index(ind) index(end)]; % second row - end series
0 comentarios
Más respuestas (1)
Image Analyst
el 29 de Dic. de 2019
Try this:
threshold = 1000; % Whatever....
index1 = find(y > threshold, 1, 'first');
index2 = find(y > threshold, 1, 'last');
newY = y(index1 : index2); % Final result extracted from original y
0 comentarios
Ver también
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!