0
votes

Introduction: There are two signals in time domain.First one is a vibration signal in time domain and another is a phase signal in the same time domain.

enter image description here

enter image description here

Problem:

Now the goal is to mark points on the vibration signal at exactly the point where we have peaks in phase signal as show in figure. I don't want the graphs intersection point!!!! All I wanted to find is point on the vibration signal when I have a peak in reference phase signal.

enter image description here

The above is the vibration signal(red) along with the reference signal(blue) plotted in same time domain.

[pk,lc] = findpeaks(reference_signal,'MinPeakDistance',0.001,'MinPeakHeight',0.05);

The used the find peaks function to find the locations of peak (of phase signal) in Time , which means for the entire range of signal I would get only 13 unique points (lc) in time axis as

lc = [ 0.0015, 0.0030, 0.0045, 0.0060, 0.0075, 0.0090, 0.0105, 0.0120, 0.0135, 0.0150, 0.0165, 0.0180, 0.0195]

whereas the time domain for the actual vibration signal would look like something like this.

Time_Vibration_signal = [0.00047, 0.00049, 0.00051, 0.00053, 0.00055, 0.00057, 0.00059, 0.00061, 0.00063 and so on]

Now I want to exactly mark the points lc on the vibration signal. i,e when the vibration signal crosses the first point (peak) say 0.0015 seconds I want a marker on the vibration signal and for the second point and so on.

I'm stuck after this point. Could someone help me this? Any hints or suggestions would be helpful. Thanks in advance.

1
Could you post an minimal but complete example with your data etc so that others can run it and verify that they have actually found what you are looking for. Also, your graph isn't great. Make the lines thicker e.g. 'LineWitdth',5kkuilla
@kkuilla, Thanks for your suggestion. I updated my question.Agni

1 Answers

0
votes

You can use polyxpoly to find the intersection between two lines.

Suppose you have to sinusoidal curves and would like to find all the intersection points, you could try this:

x1      = 0:10*pi/99:10*pi;
y1      = sin(x1);
x2      = 0:10*pi/49:10*pi;
y2      = 0.2*cos(x2);
[ix,iy] = polyxpoly(x1,y1,x2,y2);     % intersection points
plot(x1,y1,'r',x2,y2,'k');
hold on
plot(ix,iy,'r.','markersize',30)

And you will have something like this:

enter image description here