Top Banner
Sampling and Aliasing Gilad Lerman Math 5467 (stealing slides from Gonzalez & Woods, and Efros)
31

Sampling and Aliasing

Jan 05, 2016

Download

Documents

Norman Geno

Sampling and Aliasing. Gilad Lerman Math 5467 (stealing slides from Gonzalez & Woods, and Efros). The Sampling Theorem. Theorem: If f is in L 1 (  ) & supported on [- B 0 , B 0 ], then Recall Proof: We view as (2 B 0 )-periodic function with coefficients: - PowerPoint PPT Presentation
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Sampling and Aliasing

Sampling and Aliasing

Gilad LermanMath 5467

(stealing slides from Gonzalez & Woods, and Efros)

Page 2: Sampling and Aliasing

The Sampling Theorem

Theorem: If f is in L1() & supported on [-B0, B0], then

Recall Proof:

We view as (2B0)-periodic function with coefficients:

At last, find f using IFT and using FS of

00 0

( ) sinc 22 2k

k kf x f B x

B BÎ

æ öæ ö æ ö÷ç÷ ÷ç ç ÷÷ ÷= × -çç ç ÷÷ ÷çç ç ÷÷ ÷ç ç ÷çè ø è øè øå

¢

0 0[ , ]ˆ ˆ( ) ( ) ( )B Bf fx x c x-= ×

0 0

1ˆ( )2 2k

kc f f

B B

æ ö÷ç ÷= × ç ÷ç ÷çè ø

Page 3: Sampling and Aliasing

More on the Sampling Theorem

Frequency band: Time:

Note: Theorem holds for B>B0.

Indeed, then

If B<B0, the above equation is not true for all

02BW=0

1

2T

B=

[ , ]ˆ ˆ( ) ( ) ( )B Bf fx x c x-= ×

Page 4: Sampling and Aliasing

Sampling Theorem (meaning)

• Interpretation: If a function f(t) contains no frequencies higher than W cps, it is completely determined by giving its ordinates at a series of points spaced 1/(2W) seconds apart

• Remark: For L1 function a freq. = W is fine

but for more general functions we need > W…

Page 5: Sampling and Aliasing

Simple Example (not L1)

Assume a cosine

(it is not L1() but will be instrumental)

Freq: a (“& -a”), Freq Band: =[-a,a], Time: 1/(2a)

Here one needs B>B0 (B=B0 doesn’t work)

2 2

( ) cos(2 ) .2

iax iaxe ef x ax

p p

p-+

= =

Example: for all 3 functions freq: 0.5, time: 1

The sampled function has different aliases…

Page 6: Sampling and Aliasing

Aliasing•If the sampling condition is not satisfied, frequencies will overlap (high freq → low freq)•The reconstructed signal is said to be an alias of the original signal

Page 7: Sampling and Aliasing

Example: Increased Frequency

Picket fence recedingInto the distance willproduce aliasing…

Input signal: Related Image:

x = 0:.05:5; imagesc(sin((2.^x).*x))

Matlab output:

Page 8: Sampling and Aliasing

One more example at the Fourier domain

Page 9: Sampling and Aliasing
Page 10: Sampling and Aliasing
Page 11: Sampling and Aliasing
Page 12: Sampling and Aliasing

Aliasing in Images (Fourier domain)

Page 13: Sampling and Aliasing

Good and Bad Sampling

Good sampling:•Sample often or,•Sample wisely

Bad sampling:•see aliasing in action!

Page 14: Sampling and Aliasing
Page 15: Sampling and Aliasing

Texture makes its worse(high frequencies)

Page 16: Sampling and Aliasing

Even worse for synthetic images

Slide by Steve Seitz

Page 17: Sampling and Aliasing
Page 18: Sampling and Aliasing

Really bad in video

Slide by Paul Heckbert

Page 19: Sampling and Aliasing

Wheels of Wagons in Westerns

Page 20: Sampling and Aliasing

• Definition: Interference pattern created, e.g., when two grids are overlaid at an angle, or when they have slightly different mesh sizes.• In images produced e.g., when scanning a halftone picture or due to undersampling a fine regular pattern.

Moiré pattern

Page 21: Sampling and Aliasing
Page 22: Sampling and Aliasing
Page 23: Sampling and Aliasing

Moiré pattern due to undersampling

Original image downsampled image

Page 24: Sampling and Aliasing

Antialiasing• What can be done?

Sampling rate ≥ 2 * max frequency in the image

1. Raise sampling rate by oversampling– Sample at k times the resolution– continuous signal: easy– discrete signal: need to interpolate

• 2. Lower the max frequency by prefiltering– Smooth the signal enough– Works on discrete signals

• 3. Improve sampling quality with better sampling– Nyquist is best case!– Stratified sampling – Importance sampling – Relies on domain knowledge

Page 25: Sampling and Aliasing

Gaussian pre-filtering

G 1/4

G 1/8

Gaussian 1/2

• Solution: filter the image, then subsample– Filter size should double for each ½ size reduction.

Page 26: Sampling and Aliasing

Subsampling with Gaussian pre-filtering

G 1/4 G 1/8Gaussian 1/2

Page 27: Sampling and Aliasing

Compare with...

1/4 (2x zoom) 1/8 (4x zoom)1/2

Page 28: Sampling and Aliasing

Correcting some Moiré patterns

Page 29: Sampling and Aliasing
Page 30: Sampling and Aliasing
Page 31: Sampling and Aliasing

Rethinking of the Cooley-Tukey FFT

• Step 1(top to bottom): Create two subsampled signals (even and odd coordinates)

• Note that the two subsampled signals are associated with half bands in the frequency domain (Shannon)

• Step 2 (bottom-up): Combine the two signals by the formulas:

• Interpretation: combining the two half bands in the right way (in frequency domain) to exactly recover the signal

2even odd 2

2

2even odd 2

2

ˆ ˆ ˆ( ) ( ) ( ) , 0,..., 1,

ˆ ˆ ˆ( ) ( ) ( ) , 0,..., 1.

L L

L L

πin

LL

πin

LL

x n x n x n e n L

x n L x n x n e n L

-

-

= + × = -

+ = - × = -