Find full-width-half-max of signal amongst noise floor.
6 views (last 30 days)
Show older comments
Hello there,
I am new to Matlab and struggling to find the FWHM of this signal amongst the noise floor. My plan thus far has been to find the average noise floor level on the y-axis (-72) and use that averaged level as the base before calculating the FWHM, however, I dont quite know how to continue from there and my prelimnary use of findpeaks isn't working. Any tips?
1 Comment
David Goodmanson
on 25 Jun 2024
Edited: David Goodmanson
on 27 Jun 2024
Hi Stanley, is the intensity here in a log scale of some kind, such as dB?
Answers (1)
Karl
on 24 Jun 2024
One approach would be to subtract the average noise floor level from the intensity values. You could then estimate the signal FWHM as the interval between intensity values multipled by the number of (noise-subtracted) intensity values greater than half the maximum.
% Define example intensity values (a.u.) as function of wavelength (nm).
dx = 0.2;
x = [2770:dx:2830];
y1 = (zeros(size(x))-72)+normrnd(0,3,size(x))+30*normpdf(x,2785,0.3);
% Plot example intensity values.
figure
plot(x,y1)
xlabel('Wavelength (nm)')
ylabel('Intensity (a.u.)')
ylim([-220, -20])
% Estimate noise as mean intensity value far from signal.
noise = mean(y1(y1<2780|y1>2785))
% Obtain intensity values after noise subtraction.
y2 = y1 - noise;
% Plot intensity values after noise subtraction.
figure
plot(x,y2)
xlabel('Wavelength (nm)')
ylabel('Intensity (a.u.)')
% Estimate signal half maximum.
hm = 0.5*max(y2)
% Estimate signal full with at half maximum.
fwhm = dx*numel(y2(y2>hm))
0 Comments
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!