Choosing single cycle from Sinewave plot

2 views (last 30 days)
Jonathan
Jonathan on 24 Jan 2014
Commented: dpb on 24 Jan 2014
Hi fellas,
I'm not sure how to do this and hope you can enlighten me. I have a CSV file with 2500r x 3c worth of data and when plotted a sinewave is obtained.
My question is, how do I choose a cycle from this dataset? Note that the data points don't actually cross y=0. The uncertainty I'm having is how exactly do I make MATLAB find the near-zero points of a single cycle's start and end point? Also, taking in mind that there will be another near-zero point at the half-cycle point.
I could do this visually but I have 300 datasets and need to make a script for this.
Thanks guys!
  1 Comment
dpb
dpb on 24 Jan 2014
Is the process stationary? If so, simply remove mean and look for
diff(y)==+/-1
The two Positive or two Negative neighors are the extent of a cycle.
If it isn't stationary, detrend as well. If signal is noisy, some additional testing is likely required.

Sign in to comment.

Answers (0)

Categories

Find more on View and Analyze Simulation Results 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!