I am trying to find the full width at half max value and plot the waveform with markers
5 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
BP
el 27 de Ag. de 2021
Comentada: Star Strider
el 1 de Sept. de 2021
I have a voltage waveforn captured using an osciloscope and saved in a csv file. I am trying to find the full width at half max value and plot the waveform with markers. Column 4 is the time (x axis) and column 5 is the voltage data (y axis) in the csv file. Can someone please help me?
Thanks
0 comentarios
Respuesta aceptada
Star Strider
el 27 de Ag. de 2021
.
6 comentarios
Star Strider
el 1 de Sept. de 2021
Sure!
The first is just a findpeaks call. I refer you to that documentationo to understand what it does. It returns the maximum peak and the associated index into that vector for reference later.
The ‘hafmax’ variable is just that — it is the value at half the maximum (although it can be value defined on the dependent variable range, depending on what you want to do).
The loop is a bit mor complicated. To use the interp1 function correctly, the independent variable (first argument to the function) has to be monotonically increasing or decreasing. Since the objective is to find the values for both the ascending and descending limbs of the curve, the code requires a separate interp1 call for each limb as the result. That explains the two ‘idxrng’ calls, one for each section of the curve, and a separate interp1 call for each section of the curve, producing two values of ‘xm’ correspondingly. The easiest way to understand how it works is to add a plot statement to the loop to display the different sections being interpolated.
.
Más respuestas (0)
Ver también
Categorías
Más información sobre Spectral Estimation en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!