Aliasing Aliases are low frequencies in a rendered image that are - - PDF document

aliasing
SMART_READER_LITE
LIVE PREVIEW

Aliasing Aliases are low frequencies in a rendered image that are - - PDF document

CS-184: Computer Graphics Lecture 9: Sampling and Aliasing Robert Carroll University of California, Berkeley Aliasing Aliases are low frequencies in a rendered image that are due to higher frequencies in the original image. aliasing effects


slide-1
SLIDE 1

CS-184: Computer Graphics

Lecture 9: Sampling and Aliasing

Robert Carroll University of California, Berkeley

Aliasing

Aliases are low frequencies in a rendered image that are due to higher frequencies in the original image.

2

aliasing effects anti-aliased

Jaggies

Are jaggies due to aliasing? How? Original: Rendered:

3

slide-2
SLIDE 2

Aliasing (temporal)

4

http://www.michaelbach.de/ot/mot_wagonWheel/main.swf

Sampling

5

How to represent a continuous signal digitally?

image from Wikipedia

Undersampling

6

Both frequencies could explain the samples

slide-3
SLIDE 3

Aliasing

Aliases are low frequencies in a rendered image that are due to higher frequencies in the

  • riginal image.

7

What is a (point) sample?

An evaluation

! At an infinitesimal point (2-D) ! Or along a ray (3-D) ! At a particular time (animation/audio)

What is evaluated

! Inclusion (2-D) or intersection (3-D) ! Attributes such as distance and color ! Air pressure (audio)

8

Questions for this lecture

How can we model/analyze the sampling process? How can we reconstruct a signal from samples? When can we do a good job (i.e. avoid aliasing)?

9

slide-4
SLIDE 4

Reference sources

Kurt Akeley’s slides Brian Curless’ slides Marc Levoy’s notes Ronald N. Bracewell, The Fourier Transform and its Applications, Second Edition, McGraw-Hill, Inc., 1978.

10

Ground rules

You don’t have to be an engineer to get this

! We’re looking to develop instinct / understanding ! Not to be able to do the mathematics

We’ll make minimal use of equations

! No integral equations ! No complex numbers

Plots will be consistent

! Tick marks at unit distances ! Signal on left, Fourier transform on the right

11

Dimensions

1-D

! Audio signal (time) ! Generic examples (x)

2-D

! Image (x and y)

3-D

! Animation (x, y, and time)

Most examples in this presentation are 1-D

12

slide-5
SLIDE 5

Sampling and Reconstruction

13

Continuous Signal Discrete Samples

Remove high frequencies before sampling Don’t introduce spurious high frequencies during reconstruction

Displays are discrete, so why do we need to reconstruct anyway?

  • Resampling: Scaling up/down, texture mapping, supersampling

Filtering

Filtering is used for both sampling and reconstruction Sampling: filter high frequencies from continuous signal

  • Diffusing filter for cameras or analog audio filter
  • Average multiple samples at a higher frequency (Oversampling)

Reconstruction: filter samples to interpolate continuous signal

  • Reconstruction filters can introduce higher frequencies

14

One of the most common methods for filtering Function f and filter g (f * g)(x) = shift g by x and take product Commutative, associative, distributive Extends to higher dimensions and discrete functions

Convolution

15

slide-6
SLIDE 6

Convolution example

* =

16

Convolution example (2D)

17

* =

Sampling and Reconstruction

18

x

= = *

Sampling (pre-filtered signal) Reconstruction (w/ box filter)

comb(x)

slide-7
SLIDE 7

Fourier analysis

19

The Fourier transform lets us analyze functions in frequency domain

  • Natural in conjunction with convolution

Fourier series

Any periodic function can be exactly represented by a (typically infinite) sum of harmonic sine and cosine functions. Harmonics are integer multiples of the fundamental frequency

20

Fourier series example: sawtooth wave

… …

1 1

  • 1

21

slide-8
SLIDE 8

Sawtooth wave summation

Harmonics Harmonic sums 1 2 3 n

22

Sawtooth wave summation (continued)

Harmonics Harmonic sums 5 10 50 n

23

Fourier integral

Any function (that matters in graphics) can be exactly represented by an integration of sine and cosine functions. Continuous, not harmonic

24

slide-9
SLIDE 9

Basic Fourier transform pairs

f(x) F(s)

25

Basic Fourier transform pairs

f(x) F(s)

26

comb(x) comb(s)

Reciprocal property

Swapped left/right from previous slide

f(x) F(s)

27

slide-10
SLIDE 10

Basic Fourier transform pairs (2D)

28

f(x) F(s)

29

f(x) F(s)

Basic Fourier transform pairs (2D) Scaling theorem

f(x) F(s)

30

slide-11
SLIDE 11

Band-limited transform pairs

F(s) f(x)

31

Finite / infinite extent

If one member of the transform pair is finite, the other is infinite

! Band-limited ! infinite spatial extent ! Finite spatial extent ! infinite spectral extent

32

Convolution theorem

Something difficult to do in one domain (e.g., convolution) may be easy to do in the other (e.g., multiplication) Let f and g be the transforms of f and g. Then:

33

slide-12
SLIDE 12

Sampling theory

x

= * =

F(s) f(x)

Spectrum is replicated an infinite number of times

34

Reconstruction theory

x

= * =

F(s) f(x)

35

Sampling at the Nyquist rate

x

= * =

F(s) f(x)

36

slide-13
SLIDE 13

Reconstruction at the Nyquist rate

x

= * =

F(s) f(x)

37

Sampling below the Nyquist rate

x

= * =

F(s) f(x)

38

Reconstruction below the Nyquist rate

x

= * =

F(s) f(x)

39

slide-14
SLIDE 14

Reconstruction error

Original Signal Undersampled Reconstruction

40

Reconstruction with a triangle function

x

= * =

F(s) f(x)

41

Reconstruction error

Original Signal Triangle Reconstruction

42

slide-15
SLIDE 15

Reconstruction with a rectangle function

x

= * =

F(s) f(x)

43

Reconstruction error

Original Signal Rectangle Reconstruction

44

Sampling a rectangle

x

= * =

F(s) f(x)

45

slide-16
SLIDE 16

Reconstructing a rectangle (jaggies)

x

= * =

F(s) f(x)

46

Sampling and reconstruction

Aliasing is caused by

! Sampling below the Nyquist rate, ! Improper reconstruction, or ! Both

We can distinguish between

! Aliasing of fundamentals (demo) ! Aliasing of harmonics (jaggies)

47

End

48