this is my coding in matlab. A is the result from picoscope. the result get from detecting lightning signal.
y = A(:,1);x = (-0.6:4.000000046744390e-07:1.4);plot(x,y)title("FA-31")ylabel("voltage(V)")xlabel("time(s)")vmax = max(y);vmin = min (y);%Find the half max value.
halfMax = max(y) / 2;% Find where the data first drops below half the max.
index1 = find(y >= halfMax, 1, 'first');% Find where the data last rises above half the max.
index2 = find(y >= halfMax, 1, 'last');fwhm = index2-index1 + 1; % FWHM in indexes
% if you have an x vector
fwhmx = x(index2) - x(index1);
The formula I use in matlab for find fwhm is I get from Internet. Can u help me how to get the fwhm for all peak?
Best Answer