Filtering out sets of data
Show older comments
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
Jan
on 22 Feb 2018
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?
matlab123
on 22 Feb 2018
Jan
on 22 Feb 2018
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.
Answers (0)
Categories
Find more on Multirate Signal Processing in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!