diffraction from circular disk in matlab

To compute the diffraction pattern from a circular disk in MATLAB, we can make use of the Fourier transform of the disk. The steps to achieve this are as follows:

  1. Generate a binary image of a circular disk using the fspecial function in MATLAB. The fspecial function can be used to create special types of matrices that are useful for image processing. We can create a disk shaped matrix using the 'disk' option, and specify the radius of the disk using the second argument. The resulting matrix is then thresholded to create a binary image.
main.m
% Define the radius of the disk
radius = 50;

% Create disk filter and threshold to create binary image
disk = fspecial('disk', radius);
binary_image = disk > max(disk(:))/2;
175 chars
7 lines
  1. Compute the Fourier transform of the binary image using the fft2 function.
main.m
% Compute the Fourier transform of the binary image
ft = fftshift(fft2(binary_image));
87 chars
3 lines

Note that we have used the fftshift function to shift the low-frequency components to the center of the image.

  1. Compute the intensity of the diffraction pattern by taking the absolute value of the Fourier transform and squaring it.
main.m
% Compute the intensity of the diffraction pattern
intensity = abs(ft).^2;
75 chars
3 lines

The resulting intensity matrix can be visualized using the imshow function.

main.m
% Display the diffraction pattern
imshow(intensity, [])
56 chars
3 lines

The resulting image should show a bright central region (corresponding to the zero-order diffraction peak) and a series of concentric rings (corresponding to higher-order diffraction peaks). The size of the rings and the intensity distribution will depend on the size of the disk and the wavelength of light used.

gistlibby LogSnag