ivan bazarov cornell physics department / classe
TRANSCRIPT
Fourier Optics P3330 Exp Optics FA’20161
Fourier Optics
Ivan BazarovCornell Physics Department / CLASSE
Outline• 2D Fourier Transform• 4-f System• Examples of spatial frequency filters• Phase contrast imaging• Matlab FFT
Fourier Optics P3330 Exp Optics FA’20162
Properties of 2D Fourier Transforms
f(x, y) =
ZZF (f
x
, f
y
)ei2⇡(xfx+yf
y
)df
x
df
y
F (fx
, f
y
) =
ZZf(x, y)e�i2⇡(xf
x
+yf
y
)dxdy
Definitions:
Linearity:
Scaling:
Shift:
↵f(x, y) + �g(x, y) ! ↵F (fx
, f
y
) + �G(fx
, f
y
)
f
⇣x
a
,
y
b
⌘ ! |ab|F (af
x
, bf
y
)
f(x� x0, y � y0) ! F (fx
, f
y
)e�i2⇡(x0fx+y0fy)
Fourier Optics P3330 Exp Optics FA’20163
Properties of 2D Fourier Transforms (contd.)
Rotation:
Convolution:
Parseval’s theorem:
Slice theorem:
R
✓
{f(x, y)} ! R
✓
{F (fx
, f
y
)}
ZZf(x, y)g(x� x, y � y)dxdy ! F (f
x
, f
y
)G(fx
, f
y
)
ZZ|f(x, y)|2dxdy =
ZZ|F (f
x
, f
y
)|2dfx
df
y
Zf(x, y)dy ! F (f
x
, 0)
Fourier Optics P3330 Exp Optics FA’20164
4-f System
FFT FFT FFT FFT
Collimate Mask FT Filter IFT Out
“4-f system”Prepare input 1Input mask
f(x, y)
Take FT F
✓x
0
�FFT,
y
0
�FFT
◆ Filter mask F
✓x
0
�FFT,
y
0
�FFT
◆G
✓x
0
�FFT,
y
0
�FFT
◆
Inverse FTZZ
f(x, y)g(x� x, y � y)dxdy
2D object f(x,y) has been filtered with 2D filter with impulse response g(x,y)
Fourier Optics P3330 Exp Optics FA’20165
Coordinate system after the lens: spatial frequency converter
Thus, the spatial frequency fx is related to coordinate x’ by scaling factor Fl
Fourier Optics P3330 Exp Optics FA’20166
Simple Fourier Transform
ECE 4606 Undergraduate Optics Lab
Robert R. McLeod, University of Colorado
Simple optical Fourier transforms
49
Focal length F = 100 mm
Laser wavelength λ0 = 632 nm
µm 200=xλµm 316
200
632.0000,100
=
×=′x
µm8.282
µm 2002
=
×=
= yx λλµm 223
8.282
632.0000,100
=
×=
′=′ yx
•Lecture 4–Fourier optics
Amplitude cosine, aka diffraction grating
Rotate object by 45o
Fourier Optics P3330 Exp Optics FA’20167
Low pass filter (sharp cutoff)ECE 4606 Undergraduate Optics Lab
Robert R. McLeod, University of Colorado
Low pass, sharp cutoff
50
Multiplied by
=
REAL SPACE FOURIER SPACE
Filter cutoff frequency = 1/500 µm-1
Filter cutoff position = 126.4 µmFocal length = 100 mmLaser wavelength = 632 nm
All plots show amplitude of E
•Lecture 4–Example
252.8 µm pinhole
Smoothed, but Gibbs ringing due to sharp filter edges
ECE 4606 Undergraduate Optics Lab
Robert R. McLeod, University of Colorado
Low pass, sharp cutoff
50
Multiplied by
=
REAL SPACE FOURIER SPACE
Filter cutoff frequency = 1/500 µm-1
Filter cutoff position = 126.4 µmFocal length = 100 mmLaser wavelength = 632 nm
All plots show amplitude of E
•Lecture 4–Example
252.8 µm pinhole
Smoothed, but Gibbs ringing due to sharp filter edges
Fourier Optics P3330 Exp Optics FA’20168
Low pass filter (smooth cutoff)ECE 4606 Undergraduate Optics Lab
Robert R. McLeod, University of Colorado
Low pass, smooth cutoff
51
Multiplied by
=
REAL SPACE FOURIER SPACE
Filter cutoff frequency = 1/500 µm-1
Filter cutoff position = 126.4 µmEdge smoothing = 132 µmFocal length = 100 mmLaser wavelength = 632 nm
•Lecture 4–Example
Now just nicely smoothed
ECE 4606 Undergraduate Optics Lab
Robert R. McLeod, University of Colorado
Low pass, smooth cutoff
51
Multiplied by
=
REAL SPACE FOURIER SPACE
Filter cutoff frequency = 1/500 µm-1
Filter cutoff position = 126.4 µmEdge smoothing = 132 µmFocal length = 100 mmLaser wavelength = 632 nm
•Lecture 4–Example
Now just nicely smoothed
Fourier Optics P3330 Exp Optics FA’20169
High pass (narrow band)ECE 4606 Undergraduate Optics Lab
Robert R. McLeod, University of Colorado
High pass, narrowband
52
Multiplied by
=
REAL SPACE FOURIER SPACE
Filter cutoff frequency = 1/1200 µm-1
Filter cutoff position = 52.6 µmEdge smoothing = 58.2 µmFocal length = 100 mmLaser wavelength = 632 nm
•Lecture 4–Example
Sharp filter used for clarity
Note sharp edges, darkening of large, uniform areas (~DC)
105.2 µm “dot”
ECE 4606 Undergraduate Optics Lab
Robert R. McLeod, University of Colorado
High pass, narrowband
52
Multiplied by
=
REAL SPACE FOURIER SPACE
Filter cutoff frequency = 1/1200 µm-1
Filter cutoff position = 52.6 µmEdge smoothing = 58.2 µmFocal length = 100 mmLaser wavelength = 632 nm
•Lecture 4–Example
Sharp filter used for clarity
Note sharp edges, darkening of large, uniform areas (~DC)
105.2 µm “dot”
Fourier Optics P3330 Exp Optics FA’201610
High pass (high band)ECE 4606 Undergraduate Optics Lab
Robert R. McLeod, University of Colorado
High pass, wideband
53
Multiplied by
=
REAL SPACE FOURIER SPACE
Filter cutoff frequency = 1/300 µm-1
Filter cutoff position = 210.6 µmEdge smoothing = 46.6 µmFocal length = 100 mmLaser wavelength = 632 nm
•Lecture 4–Example
Only edges remain. Almost a “line drawing”
ECE 4606 Undergraduate Optics Lab
Robert R. McLeod, University of Colorado
High pass, wideband
53
Multiplied by
=
REAL SPACE FOURIER SPACE
Filter cutoff frequency = 1/300 µm-1
Filter cutoff position = 210.6 µmEdge smoothing = 46.6 µmFocal length = 100 mmLaser wavelength = 632 nm
•Lecture 4–Example
Only edges remain. Almost a “line drawing”
Fourier Optics P3330 Exp Optics FA’201611
Vertical low pass (“smeers” vertically)ECE 4606 Undergraduate Optics Lab
Robert R. McLeod, University of Colorado
Vertical low pass
54
Multiplied by
=
REAL SPACE FOURIER SPACE
Filter cutoff frequency = 1/200 µm-1
Filter cutoff position = 316 µmEdge smoothing = 93.6 µmFocal length = 100 mmLaser wavelength = 632 nm
Horizontal lines at edges of eyes goneVertical lines above nose remain.
•Lecture 4–Example
632 µm horiz. slit
Fourier Optics P3330 Exp Optics FA’201612
Horizontal low pass (“smeers” horizontally)ECE 4606 Undergraduate Optics Lab
Robert R. McLeod, University of Colorado
Horizontal low pass
55
Multiplied by
=
REAL SPACE FOURIER SPACE
Filter cutoff frequency = 1/200 µm-1
Filter cutoff position = 316 µmEdge smoothing = 93.6 µmFocal length = 100 mmLaser wavelength = 632 nm
Horizontal lines at edges of eyes remain.Vertical lines above nose gone.
•Lecture 4–Example
632
µm vert. slit
Fourier Optics P3330 Exp Optics FA’201613
Simpler objects
ECE 4606 Undergraduate Optics Lab
Robert R. McLeod, University of Colorado
Simpler object
56
Original
Low-pass
High-pass
Low-pass, different cutoff in x&y
•Lecture 4–Example
A side note: this is how bandpass filters look like in the frequency (focus) domain.
Fourier Optics P3330 Exp Optics FA’201614
Phase contrast imagingECE 4606 Undergraduate Optics Lab
Robert R. McLeod, University of Colorado
Phase contrast
57
Multiplied by
=
REAL SPACE FOURIER SPACE
Filter cutoff frequency = 1/5000 µm-1
Filter cutoff position = 12.6 µmFocal length = 100 mmLaser wavelength = 632 nm
Phase has become amplitude.Zernike won the 1953 Nobel in Physics for this.
•Lecture 4–Phase contrast
( )Ansel
Anselj
e maxπ−
Knife edge
Fourier Optics P3330 Exp Optics FA’201615
Some MATLAB tips: 2D functions
• Create a matrix that evaluates 2D Gaussian: exp(-p/2(x2+y2)/s2)– >>ind = [-32:1:31] / 32;– >>[x,y] = meshgrid(ind,-1*ind);– >>z = exp(-pi/2*(x.^2+y.^2)/(.25.^2));– >>imshow(z)– >>colorbar
x’
y’
x
y
64x64 matrix
-1
0
31/32-1
Fourier Optics P3330 Exp Optics FA’201616
FFT “splits” low frequencies
1D Fourier Transform– >>l = z(33,:);– >>L = fft(l);
sample #
10 20 30 40 50 600
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8
0.9
1
l
10 20 30 40 50 600
2
46
8
10
12
10 20 30 40 50 60-4
-2
0
2
4
sample #
phas
e (L
)ab
s (L
)
1 33 64
u0 fNfN/2
1 33 64
x [Matlab]0 xmax
low frequencies (aka shift theorem)
Fourier Optics P3330 Exp Optics FA’201617
Use FFTSHIFT prior to/after FFT or FFT2
Use fftshift for 2D functions– >>smiley2 = fftshift(smiley);
Fourier Optics P3330 Exp Optics FA’201618
If your FFT looks jagged…
f = zeros(30,30);f(5:24,13:17) = 1;imshow(f,'InitialMagnification','fit')
F = fft2(f);F2 = log(abs(F));imshow(F2,[-1 5],'InitialMagnification','fit');colormap(jet); colorbar
Discrete Fourier Transform Computed Without Padding
Fourier Optics P3330 Exp Optics FA’201619
Apply zero-padding!
F = fft2(f,256,256);imshow(log(abs(F)),[-1 5]); colormap(jet); colorbar
Discrete Fourier Transform With Padding
“wrong” low frequency location!
% Apply FFTSHIFTF = fft2(f,256,256);F2 = fftshift(F);imshow(log(abs(F2)),[-1 5]); colormap(jet); colorbar
Normal FT look
Fourier Optics P3330 Exp Optics FA’201620
Links/references
http://ecee.colorado.edu/~mcleod/teaching/ugol/lecturenotes/Lecture%204%20Fourier%20Optics.pdf
http://www.medphysics.wisc.edu/~block/bme530lectures/matlabintro.ppt
http://www.mathworks.com/help/images/fourier-transform.html