I am trying to find the full width at half max value and plot the waveform with markers
5 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
BP
am 27 Aug. 2021
Kommentiert: Star Strider
am 1 Sep. 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 Kommentare
Akzeptierte Antwort
Star Strider
am 27 Aug. 2021
.
6 Kommentare
Star Strider
am 1 Sep. 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.
.
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Spectral Estimation 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!