31-01-13871 2d sampling goal: represent a 2d function by a finite set of points. - particularly...

35
31-01-1387 1 2D Sampling Goal: Represent a 2D function by a finite set of points. - particularly useful to analysis w/ computer operations. Points are sampled every X in x, every Y in y. How will the sampled function appear in the spatial frequency domain?

Upload: beverly-atkinson

Post on 19-Jan-2016

218 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: 31-01-13871 2D Sampling Goal: Represent a 2D function by a finite set of points. - particularly useful to analysis w/ computer operations. Points are sampled

31-01-1387 1

2D Sampling

Goal: Represent a 2D function by a finite set of points.

- particularly useful to analysis w/ computer operations.

Points are sampled every X in x, every Y in y.

How will the sampled function appear in the spatial frequency domain?

Page 2: 31-01-13871 2D Sampling Goal: Represent a 2D function by a finite set of points. - particularly useful to analysis w/ computer operations. Points are sampled

31-01-1387 2

Two Dimensional Sampling: Sampled function in freq. domain

How will the sampled function appear in the spatial frequency domain?

)G(Y)III(X)III(XY

),(g),(G

u,vvu

yxvu

F

Since

n m Y,

XδY)comb(X)comb(XY

mv

nuvu

The result: Replicated G(u,v), or “islands” every 1/X in u, and 1/Y in v.

n m Y,

XG),(G

mv

nuvu

Page 3: 31-01-13871 2D Sampling Goal: Represent a 2D function by a finite set of points. - particularly useful to analysis w/ computer operations. Points are sampled

31-01-1387 3

Example

Let g(x,y) =(x/16y/16)be a continuous function

Here we show its continuous transform G(u,v)

-n -m

)g(mY)-nX,-δ(

),(gY

IIIX

III),(g

x,yyx

yxyx

yx

Now sampling the function gives the following in the space domain

Page 4: 31-01-13871 2D Sampling Goal: Represent a 2D function by a finite set of points. - particularly useful to analysis w/ computer operations. Points are sampled

31-01-1387 4

v

u

Fourier Representation of a Sampled Image

1/X

1/Y

Sampling the image in the space domain causes replication in the frequency domain

Page 5: 31-01-13871 2D Sampling Goal: Represent a 2D function by a finite set of points. - particularly useful to analysis w/ computer operations. Points are sampled

31-01-1387 5

Two Dimensional Sampling: Restoration of original function

will filter out unwanted islands.Y)(X)(),(H vuvu

Let’s consider this in the image domain.

),(h),(g yxyx

Ysinc

Xsinc

XY

1**

)mY,nX(δ)mY,nX(gXY

),(h),(gY

IIIX

III

n m

yx

yx

yxyxyx

Page 6: 31-01-13871 2D Sampling Goal: Represent a 2D function by a finite set of points. - particularly useful to analysis w/ computer operations. Points are sampled

31-01-1387 6

Two Dimensional Sampling: Restoration of original function(2)

Each sample serves as a weighting for a 2D sinc function.

),(h),(g yxyx

n m

)mY(Y

1sinc)nX(

X

1sinc)mY,nX(g yx

Nyquist/Shannon Theory: We must sample at twice the highest frequency in x and in y to reconstruct the original signal.

(No frequency components in original signal can be X21 or Y2

1 )

Page 7: 31-01-13871 2D Sampling Goal: Represent a 2D function by a finite set of points. - particularly useful to analysis w/ computer operations. Points are sampled

31-01-1387 7

Two Dimensional Sampling: Example

80 mm Field of View (FOV)

256 pixels

Sampling interval = 80/256 = .3125 mm/pixel

Sampling rate = 1/sampling interval = 3.2 cycles/mm or pixels/mm

Unaliased for ± 1.6 cycles/mm or line pairs/mm

Page 8: 31-01-13871 2D Sampling Goal: Represent a 2D function by a finite set of points. - particularly useful to analysis w/ computer operations. Points are sampled

31-01-1387 831-01-1387 8

FT of Shah function By similarity theorem

)()()]([

nssIII

t

xIIIFT

Example in spatial and frequency domain

)()(

nxx

III In time domain

Sampling process is Multiplication of infinite train of impulses III(x/∆x) with f(x)or convolution of III(u∆x ) with F(s)→ Replication of F(s)

Page 9: 31-01-13871 2D Sampling Goal: Represent a 2D function by a finite set of points. - particularly useful to analysis w/ computer operations. Points are sampled

31-01-1387 931-01-1387 9

Example in Time or Spatial domain

Page 10: 31-01-13871 2D Sampling Goal: Represent a 2D function by a finite set of points. - particularly useful to analysis w/ computer operations. Points are sampled

31-01-1387 1031-01-1387 10

Sampling theorem

A function sampled at uniform spacing can be recovered if

s2

1

Aliasing: = overlap of replicated spectra

Page 11: 31-01-13871 2D Sampling Goal: Represent a 2D function by a finite set of points. - particularly useful to analysis w/ computer operations. Points are sampled

31-01-1387 1131-01-1387 11

1) Truncation in Time Domain:Truncation of f(x) to finite duration T =Multiplying f(x) by Rect pulse of T = Convolving the spectrum with infinite sinx/x

Properties of Sampling I

T = N Δt (Truncation window) 1/T = 1/NΔt= Δs spectrum sample spacing (in DFT)

Page 12: 31-01-13871 2D Sampling Goal: Represent a 2D function by a finite set of points. - particularly useful to analysis w/ computer operations. Points are sampled

31-01-1387 1231-01-1387 12

Spectrum of truncation function is always infinite and Truncation destroy bond limitedness & produce alias.

This causes Unavoidable Aliasing

Since Truncation is:

Multiply f(t) with window

or convolve F(s) with narrow sin(x)/x Therefore, it extends frequency range (to infinite)

)(T

t

Page 13: 31-01-13871 2D Sampling Goal: Represent a 2D function by a finite set of points. - particularly useful to analysis w/ computer operations. Points are sampled

31-01-1387 1331-01-1387 13

2) There is a Sampling Aperture over which the signal is averaged at each sample point before applying Shah function

By convolve f(t) with aperture

or multiply F(s) with

This reduces high frequency of signal

)(1

t

s

ssin

Properties of sampling II

Page 14: 31-01-13871 2D Sampling Goal: Represent a 2D function by a finite set of points. - particularly useful to analysis w/ computer operations. Points are sampled

31-01-1387 1431-01-1387 14

)()()( sFsIIIsG

3) Since Sampling is multiplication of shah function with continues function Or convolution of F(s) with

Convolution of function with an impulse = copy of that function

Replicate F(s) every

1

Properties of sampling III

Page 15: 31-01-13871 2D Sampling Goal: Represent a 2D function by a finite set of points. - particularly useful to analysis w/ computer operations. Points are sampled

31-01-1387 1531-01-1387 15

4) Interpolation or Recovering original function (D/A)

ssssFs

ssG

1)()

2()( 1

1

Or convolving sampled g(x) with interpolation sinc

xs

xssxgFsFTxf

1

11

1

2

)2sin(2*)()()(

To recover original function, we should eliminate the replicas of F(s) and keep one.

Either Truncation in Freq should be done.

Properties of sampling IV

Page 16: 31-01-13871 2D Sampling Goal: Represent a 2D function by a finite set of points. - particularly useful to analysis w/ computer operations. Points are sampled

31-01-1387 1631-01-1387 16

Page 17: 31-01-13871 2D Sampling Goal: Represent a 2D function by a finite set of points. - particularly useful to analysis w/ computer operations. Points are sampled

31-01-1387 1731-01-1387 17

Review of Digitizing Parameters Depend on digitizing equipment:

Truncation window Max F.O.V of image

Sampling aperture Sensitivity of scanning spot

Sampling spacing Spot diameter (adjustable)

Interpolation function Displaying spot

Page 18: 31-01-13871 2D Sampling Goal: Represent a 2D function by a finite set of points. - particularly useful to analysis w/ computer operations. Points are sampled

31-01-1387 1831-01-1387 18

To have good spectra resolution (small Δs) and minimum aliasing, parameters N , T and Δt defined.

Review of Sampling Parameters

Δt as small as possible small ΔsT as long as possible compressed FT

To control aliasing: - Bigger sampling aperture

- Smaller sampling spacing (over same filter) - Adjust image freq. Sm at most Sm=1/2Δt

Page 19: 31-01-13871 2D Sampling Goal: Represent a 2D function by a finite set of points. - particularly useful to analysis w/ computer operations. Points are sampled

31-01-1387 1931-01-1387 19

Anti aliasing Filter:

1) Using rectangular aperture twice spacing Energy at frequency above S0>1/2Δt is attenuated. Original image freq. F(s) from 1/Δt reduce to 1/2Δt

Page 20: 31-01-13871 2D Sampling Goal: Represent a 2D function by a finite set of points. - particularly useful to analysis w/ computer operations. Points are sampled

31-01-1387 2031-01-1387 20

Anti aliasing Filter:

2) Using triangular aperture = 4 time of spacing Dies of frequency above 1/2Δt

Page 21: 31-01-13871 2D Sampling Goal: Represent a 2D function by a finite set of points. - particularly useful to analysis w/ computer operations. Points are sampled

31-01-1387 2131-01-1387 21

Examples of whole Sampling Process on a Band limited Signal

Original signal:

Page 22: 31-01-13871 2D Sampling Goal: Represent a 2D function by a finite set of points. - particularly useful to analysis w/ computer operations. Points are sampled

31-01-1387 2231-01-1387 22

Truncating the signal:

Page 23: 31-01-13871 2D Sampling Goal: Represent a 2D function by a finite set of points. - particularly useful to analysis w/ computer operations. Points are sampled

31-01-1387 2331-01-1387 23

Convolving signal with sampling aperture:

Page 24: 31-01-13871 2D Sampling Goal: Represent a 2D function by a finite set of points. - particularly useful to analysis w/ computer operations. Points are sampled

31-01-1387 2431-01-1387 24

Sampling the signal:

Page 25: 31-01-13871 2D Sampling Goal: Represent a 2D function by a finite set of points. - particularly useful to analysis w/ computer operations. Points are sampled

31-01-1387 2531-01-1387 25

Interpolating the sample signal (to recover original)

)(1

*)1

()1

(1

*]1

)([)( t

t

ttIII

tII

TIItfth

2])sin(

[)(*)sin(

])sin(

*)([)(

st

sttstIII

sT

sT

sT

sTTsFsI

Page 26: 31-01-13871 2D Sampling Goal: Represent a 2D function by a finite set of points. - particularly useful to analysis w/ computer operations. Points are sampled

31-01-1387 26

Discrete Fourier Transform

g(x) is a function of value for x

We can only examine g(x) over a limited time frame, L0 x

Assume the spectrum of g(x) is approximately bandlimited; no frequencies > B Hz.

Note: this is an approximation; a function can not be both time-limited and bandlimited.

f(x)

x

L2B

1 L

1-B -B

F(u)

Page 27: 31-01-13871 2D Sampling Goal: Represent a 2D function by a finite set of points. - particularly useful to analysis w/ computer operations. Points are sampled

31-01-1387 27

Sampling and Frequency Resolution

We will sample at 2B samples/second to meet the Nyquist rate.

f(x)

x

L2B

1 L

1-B -B

F(u)

BL2L

NB2

1 We sample N points.

resolutionfrequency L

1

N

B2

samples of #

rangefrequency

Page 28: 31-01-13871 2D Sampling Goal: Represent a 2D function by a finite set of points. - particularly useful to analysis w/ computer operations. Points are sampled

31-01-1387 28

Transform of the Sampled Function

Another expression for comes from

)nB2(F)(F

-δf)(f

n

B2n

1-N

0nB2n

2B1

uu

xx

1N

0

2

1N

0

B2f(n))(F

B2-x

2Bf

B2

1)(F

n

i

n

nuu

nnu

e

F

)(f xF)(F u

u is still continuous.

Bn

B 221 ff(n) where

Views input as linearcombination of deltafunctions

Page 29: 31-01-13871 2D Sampling Goal: Represent a 2D function by a finite set of points. - particularly useful to analysis w/ computer operations. Points are sampled

31-01-1387 29

Transform of the Sampled Function (2)

To be computationally feasible, we can calculate at only a finite set of points.

Since f(x) is limited to interval 0<x<L , can be sampled every Hz.

1N

0

2B2f(n))(F

n

i nuu e

Bn

B 221 ff(n) where

)(F u

L 1)(F u

Page 30: 31-01-13871 2D Sampling Goal: Represent a 2D function by a finite set of points. - particularly useful to analysis w/ computer operations. Points are sampled

31-01-1387 30

Discrete Fourier Transform

Discrete Fourier Transform (DFT):

N2BL number of samples

Number of samples in x domain = number of samples in frequency domain.

BL

nmi

nLm en 2

21N

0

)(fF(m)F

N

nmi

n

BL

nmi

n

enen 21N

0

221N

0

)(f)(fF(m)

Page 31: 31-01-13871 2D Sampling Goal: Represent a 2D function by a finite set of points. - particularly useful to analysis w/ computer operations. Points are sampled

31-01-1387 31

Periodicity of the Discrete Fourier Transform

F(m) repeats periodically with period N

1) Sampling a continuous function in the frequency domain [F(u) ->f(n)]causes replication of f(n) ( example coming in homework)

2) By convention, the DFT computes values for m= 0 to N-1

DFT:

1-N to1

1 to0

0 m

2N

2N

DC component

positive frequencies

negative frequencies

N

nmi

n

BL

nmi

n

enen 21N

0

221N

0

)(f)(fF(m)

Page 32: 31-01-13871 2D Sampling Goal: Represent a 2D function by a finite set of points. - particularly useful to analysis w/ computer operations. Points are sampled

31-01-1387 32

Properties of the Discrete Fourier Transform

Nkmi

eknfD.F.T.

2

m)(F)(

1. Linearity

2. Shifting

Let f(n) F(m)

Example : if k=1 there is a 2 shift as m varies from 0 to N-1

bG(u)aF(u)bg(x)af(x)

If f(x) F(u) and g(x) G(u)

Page 33: 31-01-13871 2D Sampling Goal: Represent a 2D function by a finite set of points. - particularly useful to analysis w/ computer operations. Points are sampled

31-01-1387 33

If f(n) F(m)

Inverse Discrete Fourier Transform

)(fF(m)F(m)1N

0

2

N11 N neD.F.T.

m

i nm

Why the 1/N ? Let’s take a look at an example

f(n)= {1 0 0 0 0 0 0 0}

1

00000001

f)(F1N

0

2

n8

n

i nmem

for all values of m continued...

N = 8 = number of samples.

Page 34: 31-01-13871 2D Sampling Goal: Represent a 2D function by a finite set of points. - particularly useful to analysis w/ computer operations. Points are sampled

31-01-1387 34

Now inverse,

Inverse Discrete Fourier Transform (continued)

2N N, 0, mfor 0)(f

1

1)(f

1

11

mF)(f

18)0(f

F(m))(f

F(m))(f

N

NN

N

8

N

2

2

N1

1

0

1N

0

2

N1

81

1N

0

2

81

1N

0

2

N1

n

e

en

r

r

r

en

en

en

m

m

nm

nm

nm

i

i

NN

n

i

m

i

m

i

For n= 0,kernel is simple

For other values of n, this identitywill help

Page 35: 31-01-13871 2D Sampling Goal: Represent a 2D function by a finite set of points. - particularly useful to analysis w/ computer operations. Points are sampled

31-01-1387 3531-01-1387 35