using matlab to compute diffraction patterns of complex apertures n.
Download
Skip this Video
Loading SlideShow in 5 Seconds..
Using MATLAB to Compute Diffraction Patterns of Complex Apertures PowerPoint Presentation
Download Presentation
Using MATLAB to Compute Diffraction Patterns of Complex Apertures

Loading in 2 Seconds...

play fullscreen
1 / 26

Using MATLAB to Compute Diffraction Patterns of Complex Apertures - PowerPoint PPT Presentation


  • 905 Views
  • Uploaded on

Using MATLAB to Compute Diffraction Patterns of Complex Apertures. Stephen Schultz Department of Electrical and Computer Engineering Brigham Young University. Lens Focus. Fresnel becomes Fraunhofer at focal plane 2D Fourier transform Take 2D transform of complex structures Slits

loader
I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
capcha
Download Presentation

PowerPoint Slideshow about 'Using MATLAB to Compute Diffraction Patterns of Complex Apertures' - Lucy


An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript
using matlab to compute diffraction patterns of complex apertures

Using MATLAB to Compute Diffraction Patterns of Complex Apertures

Stephen SchultzDepartment of Electrical and Computer EngineeringBrigham Young University

lens focus
Lens Focus
  • Fresnel becomes Fraunhofer at focal plane
  • 2D Fourier transform
  • Take 2D transform of complex structures
    • Slits
    • Multiple slits
    • Letters
    • Pictures
    • Fingerprints
fourier transform with matlab
Fourier Transform with MATLAB
  • Built-in Fast Fourier Transform (FFT)
    • Y = fft2(X)
    • Performs a Discrete Fourier Transform (DFT)
    • Uses the Cooley-Tukey algorithm
    • Fastest with sizes 2n
  • Process
    • Discretize the aperture
    • Compute DFT
    • Relate integer parameter to spatial coordinates
matlab fourier transform 1 aperture discretization
MATLAB Fourier Transform1. Aperture discretization
  • Create gray scale image in graphics program
    • Black is blocking
    • White is transmitting
    • Gray scale would be variable amplitude
  • Save as a gif file (In illustrator)
    • Save for Web and Devices
    • Set the image size (faster with 2n pixels)
    • No transparency, not interlaced
  • Read file into MATLAB
    • A=imread(‘slit’, ‘gif’)
matlab fourier transform 2 computing dft
MATLAB Fourier Transform2. Computing DFT
  • Computing DFT
    • Use the two-dimensional FFT command

E=fft2(A)

    • Puts center of the beam in the corners
    • Use the fftshift command to put it into the center

E=fftshift(fft2(A))

A=imread(‘slit’, ‘gif’)

fft2( A )

  • fftshift( fft2( A ) )
convert fft to continuous fourier transform ft 3 spatial coordinates
Convert FFT to Continuous Fourier Transform (FT)3. Spatial Coordinates
  • FFT is a Discrete Fourier Transform (DFT)

We need to relate the DFT to the FT

  • We will do this with a 1D analysis and then extend it to 2D by just replacing the FFT command with FFT2
  • Start with a sampled version of the g(x)
convert fft to continuous fourier transform ft 3 spatial coordinates1
Convert FFT to Continuous Fourier Transform (FT)3. Spatial Coordinates
  • Use an FFT, which is a discrete Fourier Transform (DFT)
  • MATLAB assumes that it starts at zero rather than –x so you need to shift it using the fftshift command
convert fft to continuous fourier transform ft 3 spatial coordinates2
Convert FFT to Continuous Fourier Transform (FT)3. Spatial Coordinates
  • Convert the DFT to a discrete time Fourier transform (DTFT)
    • The index is scaled by the number in the array
    • f=p/N
convert fft to continuous fourier transform ft 3 spatial coordinates3
Convert FFT to Continuous Fourier Transform (FT)3. Spatial Coordinates
  • Convert the DTFT into a continuous Fourier transform (FT)
    • Use the sampling period scaling factor x=Dx n
    • fx=f/Dx
  • Compare this to the analytic triangle function
convert fft to continuous fourier transform ft 3 spatial coordinates4
Convert FFT to Continuous Fourier Transform (FT)3. Spatial Coordinates
  • Summary of spatial coordinates
    • Relate to discrete frequency
    • Relate to spatial frequency
    • Fraunhofer diffraction relationship
    • Spatial coordinates
matlab fourier transform 3 spatial coordinates
MATLAB Fourier Transform3. Spatial Coordinates
  • For the FFT the number of frequency points equals the initial spatial points
  • The spatial extent of the diffraction pattern
  • More pixels causes the analysis plane to be bigger

M=64

M=256

spatial resolution 3 spatial coordinates
Spatial Resolution3. Spatial Coordinates
  • Spatial resolution, Dx, independent of number of pixels
  • Need larger image, W, without increasing slit size
    • Accomplished with zero padding
summary of matlab code 2 fraunhofer diffraction
Summary of MATLAB Code(2. Fraunhofer Diffraction)
  • Fairly simple MATLAB coding (9 lines of code)

A = imread('slit','gif');

[M,N] = size(A);

lambda = 600e-9;

f = 16.5e-3;

W = 4e-3;

I = (fftshift(fft2(A))).^2;

x = linspace(-lambda*f*N/(2*W), lambda*f*N/(2*W), N);

y = linspace(-lambda*f*M/(2*W), lambda*f*M/(2*W), M);

pcolor(x, y, I)

  • Most work done using graphics program
aperture diffraction
Aperture Diffraction
  • Rectangular aperture
    • Slit size
  • Cassegrain telescope
    • Obscuration size
    • Struts
optical image processing 2 fraunhofer diffraction
Optical Image Processing (2. Fraunhofer Diffraction)
  • Perform Fourier transform on an image
  • Filter the image (low pass or high pass filter)
  • Perform another Fourier transform
experimental implementation 3 experimental
Experimental Implementation(3. Experimental)
  • Helps solidify what is happening
  • Complimentary to simulations
    • No approximations but few aperture variations
    • Easy to look at transition between regimes
  • Students learn sensitivities of optical image processing
    • Alignment
    • Opaqueness
experimental implementation 3 experimental1
Experimental Implementation(3. Experimental)
  • Requirement to make the implementation practical
    • Long focal length lenses
      • Easier focusing
      • Larger features (fx=x/lf)
    • Opaque masks
      • Transparencies transferred to chrome mask
      • Put various patterns on same mask
    • Spatial filtered red laser
    • Object is a simple transparency
fourier plane mask 3 experimental
Fourier Plane Mask(3. Experimental)
  • Chrome on glass
  • Multiple patterns on the same mask
  • Sizes from 10-370 mm
  • Patterns
    • Rectangular slits
    • Rectangular blocks
    • Circular holes
    • Circular blocks
grid filtering 3 experimental
Grid Filtering(3. Experimental)
  • Grid transparency
  • Slit image plane mask
  • Switch filter pattern by small shifts in mask

2.7 mm Grid with 110mm Filter Slit

2.7 mm Grid with 30mm Filter Slit

blurring of an image 3 experimental
Blurring of an Image(3. Experimental)

Original Image

Blurred Image

transition 3 experimental
Transition(3. Experimental)
  • Transition from image to spatial frequency

Image off-focus

Image at focus