How to find fwhm for each peak?

조회 수: 62 (최근 30일)
fitri zabudin
fitri zabudin 2021년 2월 10일
댓글: Star Strider 2021년 9월 19일
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?
  댓글 수: 5
Image Analyst
Image Analyst 2021년 2월 10일
What's your definition of "peak"? How many do you say are there? Do you want to attach "A" so we can try things with your actual data?
save('answers.mat', 'A');
Then attach 'answers.mat' with the paper clip icon.
fitri zabudin
fitri zabudin 2021년 2월 12일
편집: fitri zabudin 2021년 2월 12일
@Image Analystthis is my actual data for "A" and the picture is the peak that I mean

댓글을 달려면 로그인하십시오.

채택된 답변

Star Strider
Star Strider 2021년 2월 10일
The Signal Processing Toolbox findpeaks function can return the FWHM of every peak. See the documentation sections on Determine Peak Widths and w for the necessary details. To return only the results from the largest or most prominent peaks, other name-value pair arguments will allow selections based on these (and other) criteria.
  댓글 수: 5
Braulio Rodriguez
Braulio Rodriguez 2021년 9월 19일
편집: Braulio Rodriguez 2021년 9월 19일
I'm interested on the broad peak. The peaks between roughly 0-5 pixels mess up my FWHM calculation. I cannot exclude these peaks on the basis of sole intensity, as the intensity varies from picture to picture, but the location of the first 'artificial' peaks are always approx. on the same range.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Descriptive Statistics에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by