# Find the second signal points (x, y location) exactly the same place of the first signal peak (x, y) matlab

2 vues (au cours des 30 derniers jours)
Ganesh Naik le 27 Avr 2021
Commenté : Mathieu NOE le 27 Avr 2021
Hi all, I have two signals where I find the negative peak of one signal and need to find the corresponding x,y points for the other signal. I was thinking of drawing a "vertical line" where the first signal peak is detected and then take the intersection point of the second signal. I think there are better straight forward methods to achieve this. In my example (please refer to the figure) x,y values are 413 and -6.18. I need to find the "y" value for the other signal (red signal) in the same location.
For your reference, I have attached the sample plot and the signal.
Kind regards
##### 0 commentairesAfficher -2 commentaires plus anciensMasquer -2 commentaires plus anciens

Connectez-vous pour commenter.

### Réponse acceptée

Mathieu NOE le 27 Avr 2021
hello
hope this helps you see function attached
x = Value(:,1);
y = Value(:,2);
t = 1:length(x);
threshold = min(y); %
[t0_pos,s0_pos,t0_neg,s0_neg]= crossing_V7(x,t,threshold,'linear'); % positive (pos) and negative (neg) slope crossing points
% ind => time index (samples)
% t0 => corresponding time (x) values
% s0 => corresponding function (y) values , obviously they must be equal to "threshold"
figure(1)
plot(t,x,t,y,t0_pos,s0_pos,'+r',t0_neg,s0_neg,'+g','linewidth',2,'markersize',12);grid on
legend('signal x','signal y','positive slope crossing points','negative slope crossing points');
% the point we are looking for is the last 'positive slope crossing points'
xx = t0_pos(end)
yy = threshold
##### 9 commentairesAfficher 7 commentaires plus anciensMasquer 7 commentaires plus anciens
Ganesh Naik le 27 Avr 2021
Hi Mathieu, thank you so much for your help with finding the corresponding values and displaying them on the plot. I appreciate your help with filtering signals, I will go through it in detail. Thanks again and kind regards!!!
Mathieu NOE le 27 Avr 2021
you're welcome
glad I could be of some help !

Connectez-vous pour commenter.

### Catégories

En savoir plus sur Frequency Transformations dans Help Center et File Exchange

### Community Treasure Hunt

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

Start Hunting!

Translated by