Class Sampling
Class Sampling
Fourier decomposition
Fourier series reminder
Example
= +
1
f (x) = sin x + sin 3x + . . .
3
Fourier series for a square wave
X 1
= f (x) = sin nx
n=1,3,5,... n
Fourier series: just a change of basis
M f(x) = F()
. =
.
.
.
Inverse FT: Just a change of basis
M-1 F() = f(x)
. =
.
.
.
1D Fourier Transform
Example
x u
2D Fourier transforms
2D Fourier transform
Definition
Sinusoidal Waves
To get some sense of what
basis elements look like, we
plot a basis element --- or
rather, its real part ---
as a function of x,y for some
fixed u, v. We get a function
that is constant when (ux+vy)
is constant. The magnitude of
the vector (u, v) gives a
frequency, and its direction
gives an orientation. The
function is a sinusoid with this
frequency along the direction,
and constant perpendicular to
the direction.
v
slide: B. Freeman
Here u and v are larger than
in the previous slide.
u
And larger still...
u
Some important Fourier Transform Pairs
FT pair example 1
v
f(x,y) |F(u,v)|
separability
|F(u,v)|
FT pair example 2
f(x,y)
F(u,v)
• FT of a Gaussian is a Gaussian
• Note inverse scale relation
FT pair example 3
F(u,v)
• rotational symmetry
• a ‘2D’ version of a sinc
FT pairs example 4
f(x,y) F(u,v)
Summary
f(x,y)
+ +
= +…
Transformations
• Linearity
• Similarity
• Shift
In 2D can also rotate, shear etc
Under an affine transformation:
Example
How does F(u,v) transform if f(x,y) is rotated by 45 degrees?
f(x,y) |F(u,v)|
The convolution theorem
Filtering vs convolution in 1D
convolution
g(x,y) =
h
convolution
filtering with with
h h h
f
slide: K. Grauman
Filtering vs convolution in 2D in Matlab
2D filtering f=image
• g=filter2(h,f); h=filter
g[m, n] h[k , l ] f [m k , n l ]
k ,l
2D convolution
• g=conv2(h,f);
g[m, n] h[k , l ] f [m k , n l ]
k ,l
Convolution theorem
Proof: exercise
Gaussian
scale=20 pixels
*
1. Compute FT of image and FT of Gaussian
2. Multiply FT’s
3. Compute inverse FT of the result.
f(x,y) g(x,y)
Gaussian
scale=3 pixels
*
Inverse Fourier
Fourier transform transform
|F(u,v)| |G(u,v)|
f(x,y) Gaussian scale=3 pixels g(x,y)
*
Inverse Fourier
Fourier transform transform
|F(u,v)| |G(u,v)|
There are two equivalent ways of carrying out linear spatial
filtering operations:
1. Spatial domain: convolution with a spatial operator
2. Frequency domain: multiply FT of signal and filter, and compute
inverse FT of product
f(x)
x
x
X x
Fourier transform pairs
Sampling Theorem in 1D
spatial domain frequency domain
x
*
F(u) u
1/X u
f(x) F(u)
The original continuous function f(x) is completely recovered from the samples
provided the sampling frequency (1/X) exceeds twice the greatest frequency of the
band-limited signal. (Nyquist sampling limit)
The Sampling Theorem and Aliasing
if sampling frequency is reduced …
spatial domain frequency domain
x u
* =
1/Y
1/X
F(u,v)
* =
The sampling theorem in 2D
• Rect function:
1 1
1, for x and y
rect ( x, y ) 2 2
0, otherwise
x y
f ( x, y ) rect ( , )
wX wY
NPRE 435, Principles of Imaging with Ionizing Radiation, Fall 2019 Signals and Systems
Sinc Function
sin(x)
sinc( x)
x
-
sinc( x)dx 1
NPRE 435, Principles of Imaging with Ionizing Radiation, Fall 2019 Signals and Systems
Triangular Signals and Gaussian Signals
• Triangular function:
x x
Tri ( ) 1 for x L
2L L
0 for x L
NPRE 435, Principles of Imaging with Ionizing Radiation, Fall 2019 Signals and Systems
Separable Signals and Periodic Signals
• A signal is periodic if
f ( x, y ) f ( x X , y ) f ( x, y Y )
where X and Y are the signal periods
NPRE 435, Principles of Imaging with Ionizing Radiation, Fall 2019 Signals and Systems
Two Dimensional Sampling
f s ( x, y ) f ( x, y ) s ( x, y, x, y )
n -m -
f ( x,y ) δ( x - n x , y - m y )
n -m -
f ( n x , m y ) δ( x - n x , y - m y )
NPRE 435, Principles of Imaging with Ionizing Radiation, Fall 2019 Fourier Transform
Restoration of the Original 2-D Function
Given that the Nyquist sampling condition is met, the original function
could be recovered exactly as
f ( x, y) f s ( x, y) h( x, y)
1 x 1 y
f s ( x, y) sinc( ) sinc( )
x x y y
1 x 1 y
f (nx, my) δ( x n x, y m y) sinc( ) sinc( )
n m x x y y
1 x n x y m y
f (nx, my) sinc( ) sinc( )
n m xy x y
sin(x)
sinc( x)
x
NPRE 435, Principles of Imaging with Ionizing Radiation, Fall 2019 Fourier Transform
General Concept of a System
g ( x, y ) S [ f ( x, y )]
NPRE 435, Principles of Imaging with Ionizing Radiation, Fall 2019 Signals and Systems
Linear Systems
I
I
S f ( x, y ) wi f i ( x, y ) wi S f i ( x, y )
i 1 i 1
where
f ( x, y ) is the input signal,
S
is an operator that represents the system,
f ( x, y ) is the total input signal and
wi s are weighting factors.
Covered in
lecture
NPRE 435, Principles of Imaging with Ionizing Radiation, Fall 2019 Signals and Systems
Linear Systems – An Example
For example, consider an amplifier with gain A:
f1
+ L so
f2
S w1 f1 w2 f 2 A( w1 f1 w2 f 2 )
=
I
f ( x, y ) S f ( x, y ) wi f i ( x, y ) g ( x, y )
i 1
• Many imaging systems used in medical and other applications can be
described as linear systems.
Covered in
lecture
NPRE 435, Principles of Imaging with Ionizing Radiation, Fall 2019 Signals and Systems
Linear Systems – Why Important?
• Linear systems satisfy the Superposition Principle.
I I
g(x, y) S f (x, y) S w i f i (x, y) w i S f i (x, y)
i1 i1
• If one can derive the response of the system to this basis function,
NPRE 435, Principles of Imaging with Ionizing Radiation, Fall 2019 Signals and Systems
Continuous Fourier Transform
www.revisemri.com
Covered in
lecture
NPRE 435, Principles of Imaging with Ionizing Radiation, Fall 2019 Fourier Transform
Comb and Sampling Function
Covered in
lecture
NPRE 435, Principles of Imaging with Ionizing Radiation, Fall 2019 Signals and Systems
Linear Systems – Why Important?
Covered in
lecture
NPRE 435, Principles of Imaging with Ionizing Radiation, Fall 2019 Signals and Systems
Linear Systems – Why Important?
• The Superposition Principle.
I I
g(x, y) S f (x, y) S w i f i (x, y) w i S f i (x, y)
i1 i1
• Given a discrete input signal
Covered in
lecture
NPRE 435, Principles of Imaging with Ionizing Radiation, Fall 2019 Signals and Systems
Impulse Response Function
One of the most common shape for impulse responses used in
imaging application
x x
Covered in
lecture
NPRE 435, Principles of Imaging with Ionizing Radiation, Fall 2019 Signals and Systems
Impulse Response Function
For a linear system, knowing the IRF, one could compute the output from any
arbitrary input function as
f ( x , y ) ( x , y )dxdy f ( , )
or
f ( , ) ( x , y )dxdy f ( x , y )
g ( x, y ) S [ f ( x, y )]
S f ( , ) ( x , y )dd
f ( , ) ( x , y )dxdy f ( x , y )
Using the sampling property of
S f ( , ) ( x , y )dd
delta function
f ( , )S ( x , y )dd
The linearity condition is
used here
Covered in
lecture
NPRE 435, Principles of Imaging with Ionizing Radiation, Fall 2019 Signals and Systems
Impulse Response Function
For a linear system, knowing the IRF enables one to compute the output
from any arbitrary input function.
g ( x, y ) S [ f ( x, y )]
S f ( , ) ( x , y )dd
S f ( , ) ( x , y )dd
f ( , )S ( x , y )dd
h( x , y , , ) S ( x , y )
Covered in
lecture
NPRE 435, Principles of Imaging with Ionizing Radiation, Fall 2019 Signals and Systems
Impulse Response Function
For a linear system, knowing the IRF enables one to compute the output from any
arbitrary input function:
g ( x, y ) S [ f ( x, y )]
S f ( , ) ( x , y )dd
S f ( , ) ( x , y )dd
f ( , )S ( x , y )dd
Or written explicitly as
g( x , y ) f ( , )h( x , y , , )dd
Covered in
lecture
NPRE 435, Principles of Imaging with Ionizing Radiation, Fall 2019 Signals and Systems
Impulse Response Function
• For a 2-D problem, the impulse response is a 4-D function.
g ( x, y ) f ( , )h( x, y, , )dd
Covered in
lecture
NPRE 435, Principles of Imaging with Ionizing Radiation, Fall 2019 Signals and Systems
Shift Invariant Systems
To PC display
Covered in
lecture
NPRE 435, Principles of Imaging with Ionizing Radiation, Fall 2019 Signals and Systems
Shift Invariant Systems
Covered in
lecture
NPRE 435, Principles of Imaging with Ionizing Radiation, Fall 2019 Signals and Systems
Shift Invariant Systems (II)
g ( x x, y y ) S f ( x x, y y )
h( x, y, , ) S[ , ( x, y )] h( x , y )
4-D 2-D
Covered in
lecture
NPRE 435, Principles of Imaging with Ionizing Radiation, Fall 2019 Signals and Systems
Shift Invariant Systems (III)
g ( x, y ) f ( , )h( x, y, , )dd
f ( , )h( x , y )dd
f ( x, y ) h ( x, y )
• The output of a linear and shift-invariant system is the input
convolved with the impulse response function.
Covered in
lecture
NPRE 435, Principles of Imaging with Ionizing Radiation, Fall 2019 Signals and Systems
Linear Systems – Why Important?
NPRE 435, Principles of Imaging with Ionizing Radiation, Fall 2019 Signals and Systems
Impulse Response Function
h( x , y , , ) S [ ( x , y )]
Covered in
lecture
NPRE 435, Principles of Imaging with Ionizing Radiation, Fall 2019 Signals and Systems
Convolution Operation in 1-D – Examples
f (x) g(x)
f ()g(x )d
Covered in
lecture
NPRE 435, Principles of Imaging with Ionizing Radiation, Fall 2019 Signals and Systems
Properties of Convolution Operation
f ( x, y ) h ( x, y ) f ( , )h( x , y )dd
• Commutativity
h1 ( x, y ) h2 ( x, y ) h2 ( x, y ) h1 ( x, y )
• Distributivity
h1 ( x, y ) h2 ( x, y) f ( x, y ) h1 ( x, y ) f ( x, y ) h2 ( x, y ) f ( x, y )
NPRE 435, Principles of Imaging with Ionizing Radiation, Fall 2019 Signals and Systems
Convolution Operation – Examples
g ( x, y ) f ( x, y ) gaussian( x, y )
where
x2 y2
1
gaussian( x, y ) e 2 2
2 2
Covered in
lecture
NPRE 435, Principles of Imaging with Ionizing Radiation, Fall 2019 Signals and Systems
Connection of LSI Systems
Covered in
lecture
NPRE 435, Principles of Imaging with Ionizing Radiation, Fall 2019 Signals and Systems
Separable Systems
A system is called separable if
h( x, y ) h1 ( x)h2 ( y )
in which case, the convolution between the input and the impulse
response function is
Covered in
lecture
NPRE 435, Principles of Imaging with Ionizing Radiation, Fall 2019 Signals and Systems
Separable Systems
For a separable system, the 2-D convolution operation can be re-write as
two 1-D convolution operations.
g ( x, y ) h( x, y ) * f ( x, y ) h1 ( x) * h2 ( y ) * f ( x, y )
An example
x2 y2 1 1
2 2
x y
1 2 2
gaussian( x, y )
2
2
e e 2 e 2
2 2 2 2 2 2
Covered in
lecture
NPRE 435, Principles of Imaging with Ionizing Radiation, Fall 2019 Signals and Systems
Separable Systems – An Example
g ( x, y ) f ( x, y ) gaussian( x, y )
x2 y 2
1
f ( x, y ) e 2 2
2 2
2
2 2
x y
1 1 2
f ( x, y ) e 2
e 2
2 2
Covered in
lecture
NPRE 435, Principles of Imaging with Ionizing Radiation, Fall 2019 Signals and Systems
1. Parseval’s Theorem and Inner Product Preservation
Another important property of FT is that the inner product of
two functions is equal
Z Z to the inner product of their FT’s.
1
x(v, u)y ⇤(u, v)dudv
1
1Z Z
1
= 2 X(!1, !2)Y ⇤(!1, !2)d!1d!2
4⇡ 1
where ⇤ stands for complex conjugate operation. When x = y
we obtain the well-known Parseval energy conservation formula
i.e.Z Z 1 Z Z 1
1
|x(u, v)| dudv = 2
2
|X(!1, !2)|2d!1d!2
1 4⇡ 1
i.e. the total energy in the function is the same as in its FT.
2. Frequency Response and Eigenfunctions of 2-D LSI Systems
An eigen-function of a system is defined as an input function
!vs/2
!vs
R1
!vs-!20
!us-!10
!20
"!us !us !1
"!10 !10
"!20
R
R2 !us/2
"!vs
h(u, v) = Sinc(u!us)sinc(v!vs)
sinc(!vs(v n v))
1
Xs(!1, !2) = [X(!1, !2) + E(!1, !2)]
u v
To advance click enter or page down to go back use page up 14
where
1
E(!1, !2) = X(!1 k!us, !2 l!vs)
k, l = 1
(k, l) 6= (0, 0)
which is bandlimited since X(!1, !2) = 0 for |!1| > 3,|!2| > 4
Thus !10 = 3 and !20 = 4. Also !us = 2⇡u = 5 and !vs = 2⇡v = 5
which are less than the Nyquist frequencies 2!10 = 6 and 2!20 = 8.
Thus aliasing is inevitable. The spectrum of the sampled image is
1
1 2⇡ 2⇡
Xs(!1, !2) = X(!1 k, !2 l)
u v u v
k,l= 1
⇢
(0 · 4⇡)2 |!1| 2.5, |!2| 2.5
H(!1, !2) =
0 otherwise
Remarks
1. Any frequency component in the original image which is above
[ !2us , !2vs ] by ( !u, !v ) is reproduced (or aliased) as a lower
frequency component at [ !2us !u, !2vs !v ]. In the previous
example, the frequency components 3,4 are above !2us = 2.5 and
2 = 2.5 by !u = 0.5 and !v = 1.5, respectively. Thus,
!vs
these frequencies will be aliased at 2.5 0.5 and 2.5 1.5, which
give x̃(u, v) = 2 cos (2u + v).
2. Images corrupted by additive wideband noise have spectra with
long tails. Thus, sampling based upon the bandlimits of the
To advance click enter or page down to go back use page up 19
original image will result in aliasing e↵ects as the tail of the
spectrum will fold-over into the bandlimits of the image. This
obviously causes additional noise in the reconstructed image.
To prevent this problem the image must be prefiltered prior to
sampling.
Nyquist Theorem:
In order to restore the original function, the sampling rate must be greater
than twice the highest frequency component of the function.
1
x
2uc