EE 7730: Lecture 1

EE 4780
2D Fourier Transform
Fourier Transform

What is ahead?




1D Fourier Transform of continuous signals
2D Fourier Transform of continuous signals
2D Fourier Transform of discrete signals
2D Discrete Fourier Transform (DFT)
Bahadir K. Gunturk
2
Fourier Transform: Concept
■ A signal can be
represented as a weighted
sum of sinusoids.
■ Fourier Transform is a
change of basis, where the
basis functions consist of
sines and cosines
(complex exponentials).
Bahadir K. Gunturk
3
Fourier Transform


Cosine/sine signals are easy to define and interpret.
However, it turns out that the analysis and manipulation of
sinusoidal signals is greatly simplified by dealing with related
signals called complex exponential signals.

A complex number has real and imaginary parts: z = x + j*y

A complex exponential signal: r*exp(j*a) =r*cos(a) + j*r*sin(a)
Bahadir K. Gunturk
4
Fourier Transform: 1D Cont. Signals
■ Fourier Transform of a 1D continuous signal

F (u ) 

f ( x)e j 2 ux dx

“Euler’s formula”
e j 2 ux  cos  2 ux   j sin  2 ux 
■ Inverse Fourier Transform

f ( x) 

F (u )e j 2 ux du

Bahadir K. Gunturk
5
Fourier Transform: 2D Cont. Signals
■ Fourier Transform of a 2D continuous signal
 
F (u, v) 

f ( x, y )e j 2 (ux vy ) dxdy
 
■ Inverse Fourier Transform
 
f ( x, y ) 

F (u, v)e j 2 (ux vy ) dudv
 
■ F and f are two different representations of the same signal.
f F
Bahadir K. Gunturk
6
Fourier Transform: Properties
■ Remember the impulse function (Dirac delta function)
definition

  ( x  x ) f ( x)dx  f ( x )
0
0

■ Fourier Transform of the impulse function
F   ( x, y )  
 

 j 2 ( ux  vy )

(
x
,
y
)
e
dxdy  1

 
F  ( x  x0 , y  y0 )  
 
   ( x  x , y  y )e
0
0
 j 2 ( ux  vy )
dxdy  e  j 2 (ux0 vy0 )
 
Bahadir K. Gunturk
7
Fourier Transform: Properties
■ Fourier Transform of 1
F 1 
 

 j 2 ( ux  vy )
e
dxdy   (u, v)

 
Take the inverse Fourier Transform of the impulse function
F 1  (u, v)  
 

j 2 ( ux  vy )
j 2 (0 x  v 0)

(
u
,
v
)
e
dudv

e
1

 
Bahadir K. Gunturk
8
Fourier Transform: Properties
■ Fourier Transform of cosine
F  cos(2 fx)  
 
  cos(2 fx)e
 
 j 2 ( ux  vy )
 
 e j 2 ( fx )  e j 2 ( fx )   j 2 (ux vy )
dxdy    
dxdy
e
2

  
 
1
1
   e j 2 (u  f ) x  e j 2 (u  f ) x  dxdy    (u  f )     (u  f )  
2  
2
Bahadir K. Gunturk
9
Examples
Magnitudes are shown
Bahadir K. Gunturk
10
Examples
Bahadir K. Gunturk
11
Fourier Transform: Properties
■ Linearity
■ Shifting
af ( x, y )  bg ( x, y )  aF (u , v)  bG (u , v)
f ( x  x0 , y  x0 )  e
 j 2 ( ux0  vy0 )
F (u , v)
■ Modulation
e j 2 (u0 x v0 y ) f ( x, y )  F (u  u0 , v  v0 )
■ Convolution
f ( x, y ) * g ( x, y )  F (u, v)G (u, v)
■ Multiplication
f ( x, y ) g ( x, y )  F (u, v) * G (u, v)
■ Separable functions f ( x, y )  f ( x) f ( y )  F (u , v)  F (u ) F (v)
Bahadir K. Gunturk
12
Fourier Transform: Properties
■ Separability
 
F (u, v) 

f ( x, y )e j 2 (ux vy ) dxdy
 

  j 2 vy
 j 2 ux
    f ( x, y)e
dx  e
dy
  





F (u, y )e j 2 vy dy

2D Fourier Transform can be implemented as a
sequence of 1D Fourier Transform operations.
Bahadir K. Gunturk
13
Fourier Transform: Properties
■ Energy conservation
 

 
Bahadir K. Gunturk
 
f ( x, y ) dxdy 
2

2
F (u, v) dudv
 
14
Fourier Transform: 2D Discrete Signals
■ Fourier Transform of a 2D discrete signal is defined as
F (u, v) 



f [m, n]e  j 2 (um  vn )
m  n 
where
1
1
 u, v 
2
2
■ Inverse Fourier Transform
1/ 2 1/ 2
f [m, n] 
 
F (u, v)e j 2 (um  vn ) dudv
1/ 2 1/ 2
Bahadir K. Gunturk
15
Fourier Transform: Properties
■ Periodicity: Fourier Transform of a discrete signal is periodic
with period 1.

F (u  k , v  l ) 


f [m, n]e
 j 2  ( u  k ) m  ( v  l ) n 
m  n 

Arbitrary
integers

1


f [m, n]e
1
 j 2  um  vn   j 2 km  j 2 ln
e
e
m  n 




f [m, n]e  j 2 (um  vn )
m  n 
 F (u, v)
Bahadir K. Gunturk
16
Fourier Transform: Properties
■ Linearity, shifting, modulation, convolution, multiplication,
separability, energy conservation properties also exist for the
2D Fourier Transform of discrete signals.
Bahadir K. Gunturk
17
Fourier Transform: Properties
■ Linearity
af [m, n]  bg[m, n]  aF (u, v)  bG (u, v)
■ Shifting
f [m  m0 , n  n0 ]  e  j 2 (um0  vn0 ) F (u, v)
■ Modulation
e
j 2 ( u0 m  v0 n )
f [m, n]  F (u  u0 , v  v0 )
■ Convolution
f [m, n]* g[m, n]  F (u, v)G(u, v)
■ Multiplication
f [m, n]g[m, n]  F (u, v)* G (u, v)
■ Separable functions
f [m, n]  f [m] f [n]  F (u, v)  F (u ) F (v)

■ Energy conservation
Bahadir K. Gunturk


m  n 
 
f [m, n] 
2

2
F (u, v) dudv
 
18
Fourier Transform: Properties
■ Define Kronecker delta function
1, for m  0 and n  0 
 [m, n]  

0, otherwise

■ Fourier Transform of the Kronecker delta function
F (u, v) 
Bahadir K. Gunturk


 j 2  um  vn 
 j 2  u 0  v 0 



[
m
,
n
]
e

e
1




m  n 
19
Fourier Transform: Properties
■ Fourier Transform of 1
f (m, n)  1  F (u, v) 


  1e
m  n 
 j 2  um  vn 


     (u  k , v  l )
 k  l 
To prove: Take the inverse Fourier Transform of the Dirac
delta function and use the fact that the Fourier Transform has
to be periodic with period 1.
Bahadir K. Gunturk
20
Impulse Train
■ Define a comb function (impulse train) as follows
combM , N [m, n] 


   [m  kM , n  lN ]
k  l 
where M and N are integers
1
comb2 [n]
n
Bahadir K. Gunturk
21
Impulse Train

combM , N [m, n]
   [m  kM , n  lN ]
k  l 

combM , N ( x, y )



    x  kM , y  lN 
k  l 
Fourier Transform of an impulse train is also an impulse train:


1
  m  kM , n  lN  


MN
k  l 
combM , N [m, n]
Bahadir K. Gunturk


k
l 

 u  ,v  


M
N
k  l  
comb 1
1
,
M N
(u, v)
22
Impulse Train
1
comb1 (u )
2
2
comb2 [n]
1
1
2
n
u
1
2
Bahadir K. Gunturk
23
Impulse Train

combM , N ( x, y )


    x  kM , y  lN 
k  l 
In the case of continuous signals:


1

x

kM
,
y

lN





MN
k  l 
combM , N ( x, y )
Bahadir K. Gunturk





  u 
k  l 
comb 1
k
l 
,v  
M
N
1
,
M N
(u, v)
24
Impulse Train
1
comb1 (u )
2
2
comb2 ( x)
1
1
2
x
2
Bahadir K. Gunturk
u
1
2
25
Sampling
F (u )
f ( x)
x
combM ( x)
u
comb 1 (u )
M
x
u
1
M
M
F (u )* comb 1 (u )
f ( x)combM ( x)
M
u
x
Bahadir K. Gunturk
26
Sampling
F (u )
f ( x)
x
W
F (u )* comb 1 (u )
f ( x)combM ( x)
M
x
M
1
 2W
No aliasing if
M
Bahadir K. Gunturk
W
u
u
W
1
M
27
Sampling
F (u )* comb 1 (u )
f ( x)combM ( x)
M
x
u
W
M
1
M
1
2M
If there is no aliasing, the original signal
can be recovered from its samples by
low-pass filtering.
Bahadir K. Gunturk
28
Sampling
F (u )
f ( x)
x
u
W
W
F (u )* comb 1 (u )
M
f ( x)combM ( x)
u
W
Aliased
Bahadir K. Gunturk
1
M
29
Sampling
F (u )
f ( x)
Anti-aliasing
filter
x
u
W
W
1
2M
f ( x ) * h( x )
u
W
W
 f ( x)* h( x) combM ( x)
u
1
Bahadir K. Gunturk
M
30
Sampling
■ Without anti-aliasing filter:
f ( x)combM ( x)
u
W
■ With anti-aliasing filter:
1
M
 f ( x)* h( x) combM ( x)
u
1
M
Bahadir K. Gunturk
31
Anti-Aliasing
a=imread(‘barbara.tif’);
Bahadir K. Gunturk
32
Anti-Aliasing
a=imread(‘barbara.tif’);
b=imresize(a,0.25);
c=imresize(b,4);
Bahadir K. Gunturk
33
Anti-Aliasing
a=imread(‘barbara.tif’);
b=imresize(a,0.25);
c=imresize(b,4);
H=zeros(512,512);
H(256-64:256+64, 256-64:256+64)=1;
Da=fft2(a);
Da=fftshift(Da);
Dd=Da.*H;
Dd=fftshift(Dd);
d=real(ifft2(Dd));
Bahadir K. Gunturk
34
Sampling
y
v
F (u, v)
f ( x, y )
Wv
x
y
combM , N ( x, y )
Wu
u
comb 1
1
M N
v
x
u
N
,
(u, v)
1
N
M
1
M
Bahadir K. Gunturk
35
Sampling
v
Wv
f ( x, y )combM , N ( x, y )
u
1
M
1
N
Wu
1
1
 2Wu and
 2Wv
No aliasing if
M
N
Bahadir K. Gunturk
36
Interpolation
v
1
2N
u
1
N
1
2M
1
M
Ideal reconstruction
filter:
1
1

MN
,
for
u

and
v


H (u , v)  

Bahadir K. Gunturk
2M
0, otherwise
2N
37
Ideal Reconstruction Filter
 
h ( x, y ) 

H (u, v)e j 2 (ux  vy ) dudv 


Me j 2 ux du
1
2M
1
2N

Ne j 2 vy dv
1
2N
1
 j 2 x
1  j 2 x 21M
2M
M
e
e
j 2 x 

sin 
M


M
Bahadir K. Gunturk
 
MNe j 2 (ux  vy ) dudv
1 1
2N 2M
 
1
2M
1 1
2 N 2M
x


x  sin 

N

N

y

1
1
 j 2 y


1  j 2 y 2 N
2N
N
e

e



j
2

y



sin( x) 
1 jx  jx
e  e 
2j
y
38