I am trying to find the full width at half max value and plot the waveform with markers
7 views (last 30 days)
Show older comments
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 Comments
Accepted Answer
Star Strider
on 27 Aug 2021
.
6 Comments
Star Strider
on 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.
.
More Answers (0)
See Also
Categories
Find more on Spectral Estimation in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!