Filtering out sets of data

I have two columns of data and want to filter certain values as there are two peaks when plotting due to a sensor going out of phase. The data below is just an example, the cycle will have a peak at X=3 then another will have a peak at X=4, but the peak should always be at X=3. Is there a way to filter this? I've attached a picture of the actual plot, thanks.
Cycle 1
X Y
1 | 0.5
2 | 3
3 | 8
4 | 3
5 | 1
Cycle 2
X Y
1 | 0.5
2 | 3
3 | 4
4 | 8
5 | 1

3 Comments

The question is not clear yet. What does the diagram show? Where is X=3 and X=4? Aren't this neighboring points on the left side of the diagram? What does "filter" mean here?
The diagram shows crank angle vs pressure, the idea is that it should all be within one peak but the data shifts due to drift of a sensor, displaying two peaks along with its attached curve. The example X was just that, to show the idea. Filter, I want to either delete the data out of the 360 degree peak range or shift the wrong data (10 degree peak) so its back to the 360 mark. Does this make sense, sorry for the confusion.
You can use xcorr to find the horizontal shift value. Or you can use findpeaks to determine the position of the peaks and move them accordingly.

Sign in to comment.

Answers (0)

Tags

Asked:

on 22 Feb 2018

Commented:

Jan
on 22 Feb 2018

Community Treasure Hunt

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

Start Hunting!