How to analyze part of a signal?
조회 수: 2 (최근 30일)
이전 댓글 표시
Hello, I have created a sinusoidal signal, but I only want to find a peak value between 'x' to 'y' seconds of the signal. How would I set a limit so that only the data of the sinusoidal signal is analyzed in MATLAB between 'x' to 'y' seconds?
I have tried to use the function "xlim", but I think that is only for setting limits on a graph.
I hope this is not to broad of a question, but any help would be greatly appreciated.
댓글 수: 0
답변 (2개)
dpb
2017년 3월 22일
Index into the result vector based on values of time; if you have a fixed timestep then it's simply T/dt intervals past T0 or the delta is (Tend-Tstart)/dt points.
Then, "Use the colon, Luke!"
ymax=max(y(idxStart:idxEnd));
where you've just computed the two indices above.
Alternatively, there is (beginning R2015a, anyway) a timeseries class that has the ability to retrieve data by time and methods to manipulate data that potentially could be simpler coding. I've not 'spearminted with it to date so no real firsthand data with to really recommend for/against the implementation; just know it exists.
댓글 수: 5
dpb
2017년 3월 23일
I'm not sure who x is here; the abscissa or ordinate for the time series? Where does m1 come from in the above; why are you searching for a specific value?
You may want to study
doc findpeaks % it has many options for peak-finding with conditions
AJ Woodson
2020년 11월 3일
If I have signal X for say the if want to take a portion of that signal you could do something like b = X(beginPoint:DesiredEnd)
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Get Started with Signal Processing Toolbox에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!