How to analyze part of a signal?
2 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
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 comentarios
Respuestas (2)
dpb
el 22 de Mzo. de 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 comentarios
dpb
el 23 de Mzo. de 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
el 3 de Nov. de 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 comentarios
Ver también
Categorías
Más información sobre Get Started with Signal Processing Toolbox en Help Center y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!