HOW TO FIND THE FULL WIDTH AT HALF MAXIMUM
Show older comments
Hi,
I have a problem in the following code:
clear all;
clc;
close all;
lamda=531e-9;
k=2*pi/lamda;
[x,y]=meshgrid(-1*lamda:(2*lamda/127):1*lamda);
r=sqrt(x.^2+y.^2);
w=10^-3;
z=10^-3;
z1=sqrt(w.^2+z.^2);
N.A=w/z1;
v=((k*r));
I=(2*bessel(1,v)./(v)).^2;
I0=max(max(I));
I2=I/I0;
I3=0;
figure(1)
plot(I2(64,:))
%figure(2)
%imagesc(I2),colormap gray
%For full width of airy pattern
% a=19;
% v1=k*w/z;
% d1=a/v1 % d1=1.605*10^-6m;
% For full width at half maximum
b=46;
v2=k*w/z;
d2=b/v2 %d2=6.760*10^-7m;
%%%%%%%%%%%
when you run the above code, you will find figure(1) and I am in need to find the half width full maximum(FWHM) of the said fig. using matlab. It will be a great help for me if anyone help me out in this regard...
Thanking You!
2 Comments
Eric
on 29 Aug 2012
You might do better by explaining what it is you're trying to do. It looks like you're trying to find the FWHM of the PSF of an optical system. It's not clear to me what the parameters of the optical system are. Perhaps the numerical aperture (N.A?) is 1/sqrt(2)? It's confusing because the variables w, z, z1, and N.A have no impact whatsoever on the plotted data. I don't think that's what you intended.
You might look at my answer at http://www.mathworks.com/matlabcentral/answers/36064-spherical-aberration-and-chromatic-aberration for a guide on how to calculate an optical PSF.
Also, bessel(1,v) should be besselj(1,v) unless you have written your own function called bessel().
-Eric
Eric
on 29 Aug 2012
One more thing: I'm assuming you've been tasked to do this numerically as part of a homework assignment. If you really just want the FWHM, you can solve for that in a more straightforward fashion by using the analytic form of the PSF. I did a quick calculation and get 1.03*lambda*f_number as the FWHM.
Accepted Answer
More Answers (0)
Categories
Find more on Logical in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!