How to analyze part of a signal?
2 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
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 Kommentare
Antworten (2)
dpb
am 22 Mär. 2017
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 Kommentare
dpb
am 23 Mär. 2017
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
am 3 Nov. 2020
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 Kommentare
Siehe auch
Kategorien
Mehr zu Get Started with Signal Processing Toolbox finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!