no slide title · part 2: 2d signal processing • grayscale image can be seen as a discrete 2d...
TRANSCRIPT
![Page 1: No Slide Title · Part 2: 2D signal processing • Grayscale image can be seen as a discrete 2D signal • Each pixel with coordinates (x, y) has a value between 0 (black) and 255](https://reader034.vdocuments.site/reader034/viewer/2022042017/5e7575f54df72e52db1be1a1/html5/thumbnails/1.jpg)
Lab 5
School of Architecture, Civil and
Environmental Engineering
EPFL, SS 2012-2013
http://disal.epfl.ch/teaching/signals_instruments_systems/
1
![Page 2: No Slide Title · Part 2: 2D signal processing • Grayscale image can be seen as a discrete 2D signal • Each pixel with coordinates (x, y) has a value between 0 (black) and 255](https://reader034.vdocuments.site/reader034/viewer/2022042017/5e7575f54df72e52db1be1a1/html5/thumbnails/2.jpg)
Lab 5 Outline
• Concepts:
– Fast Fourier transforms
– Signal sampling and reconstruction
– Filtering
• Tools:
– Matlab
2
![Page 3: No Slide Title · Part 2: 2D signal processing • Grayscale image can be seen as a discrete 2D signal • Each pixel with coordinates (x, y) has a value between 0 (black) and 255](https://reader034.vdocuments.site/reader034/viewer/2022042017/5e7575f54df72e52db1be1a1/html5/thumbnails/3.jpg)
Part 1: 1D signal processing
Signal
generationFiltering Sampling Reconstruction
• Filter type
• Order
• Cut-off frequency
• 𝑓 𝑡 = 𝑖 𝐴𝑖sin(2𝜋𝑓𝑖𝑡)
• sin frequencies
• sin amplitudes
• Sampling
frequency
• Linear
interpolation
• Whittaker-
Shannon
3
![Page 4: No Slide Title · Part 2: 2D signal processing • Grayscale image can be seen as a discrete 2D signal • Each pixel with coordinates (x, y) has a value between 0 (black) and 255](https://reader034.vdocuments.site/reader034/viewer/2022042017/5e7575f54df72e52db1be1a1/html5/thumbnails/4.jpg)
Signal generation – 1 Hz sine
0 0.5 1 1.5 2 2.5 3 3.5 4 4.5 5-1
-0.8
-0.6
-0.4
-0.2
0
0.2
0.4
0.6
0.8
1
Time [s]
Am
plit
ude
Sine @ 1 Hz
4
![Page 5: No Slide Title · Part 2: 2D signal processing • Grayscale image can be seen as a discrete 2D signal • Each pixel with coordinates (x, y) has a value between 0 (black) and 255](https://reader034.vdocuments.site/reader034/viewer/2022042017/5e7575f54df72e52db1be1a1/html5/thumbnails/5.jpg)
Signal generation – 3 Hz sine
0 0.5 1 1.5 2 2.5 3 3.5 4 4.5 5-1
-0.8
-0.6
-0.4
-0.2
0
0.2
0.4
0.6
0.8
1
Time [s]
Am
plit
ude
Sine @ 3 Hz
5
![Page 6: No Slide Title · Part 2: 2D signal processing • Grayscale image can be seen as a discrete 2D signal • Each pixel with coordinates (x, y) has a value between 0 (black) and 255](https://reader034.vdocuments.site/reader034/viewer/2022042017/5e7575f54df72e52db1be1a1/html5/thumbnails/6.jpg)
Signal generation – summation
0 0.5 1 1.5 2 2.5 3 3.5 4 4.5 5-2
-1.5
-1
-0.5
0
0.5
1
1.5
2
Time [s]
Am
plit
ude
Size @ 1 Hz + Sine @ 3 Hz
6
![Page 7: No Slide Title · Part 2: 2D signal processing • Grayscale image can be seen as a discrete 2D signal • Each pixel with coordinates (x, y) has a value between 0 (black) and 255](https://reader034.vdocuments.site/reader034/viewer/2022042017/5e7575f54df72e52db1be1a1/html5/thumbnails/7.jpg)
FFT
-10 -8 -6 -4 -2 0 2 4 6 8 100
0.1
0.2
0.3
0.4
0.5
0.6
Frequency [Hz]
FFT
7
![Page 8: No Slide Title · Part 2: 2D signal processing • Grayscale image can be seen as a discrete 2D signal • Each pixel with coordinates (x, y) has a value between 0 (black) and 255](https://reader034.vdocuments.site/reader034/viewer/2022042017/5e7575f54df72e52db1be1a1/html5/thumbnails/8.jpg)
Sampling
0 0.5 1 1.5 2 2.5 3 3.5 4 4.5 5-1.5
-1
-0.5
0
0.5
1x 10
-14
Time [s]
Am
plit
ude
Signal sampled @ 2 Hz
8
![Page 9: No Slide Title · Part 2: 2D signal processing • Grayscale image can be seen as a discrete 2D signal • Each pixel with coordinates (x, y) has a value between 0 (black) and 255](https://reader034.vdocuments.site/reader034/viewer/2022042017/5e7575f54df72e52db1be1a1/html5/thumbnails/9.jpg)
Sampling
0 0.5 1 1.5 2 2.5 3 3.5 4 4.5 5-1.5
-1
-0.5
0
0.5
1x 10
-14
Time [s]
Am
plit
ude
Signal sampled @ 2 Hz
8
![Page 10: No Slide Title · Part 2: 2D signal processing • Grayscale image can be seen as a discrete 2D signal • Each pixel with coordinates (x, y) has a value between 0 (black) and 255](https://reader034.vdocuments.site/reader034/viewer/2022042017/5e7575f54df72e52db1be1a1/html5/thumbnails/10.jpg)
Sampling
0 0.5 1 1.5 2 2.5 3 3.5 4 4.5 5-1.5
-1
-0.5
0
0.5
1x 10
-14
Time [s]
Am
plit
ude
Signal sampled @ 2 Hz
8
![Page 11: No Slide Title · Part 2: 2D signal processing • Grayscale image can be seen as a discrete 2D signal • Each pixel with coordinates (x, y) has a value between 0 (black) and 255](https://reader034.vdocuments.site/reader034/viewer/2022042017/5e7575f54df72e52db1be1a1/html5/thumbnails/11.jpg)
Sampling
0 0.5 1 1.5 2 2.5 3 3.5 4 4.5 5-1.5
-1
-0.5
0
0.5
1x 10
-14
Time [s]
Am
plit
ude
Signal sampled @ 2 Hz
0 0.5 1 1.5 2 2.5 3 3.5 4 4.5 5-2
-1.5
-1
-0.5
0
0.5
1
1.5
2
Time [s]
Am
plit
ude
Size @ 1 Hz + Sine @ 3 Hz
8
![Page 12: No Slide Title · Part 2: 2D signal processing • Grayscale image can be seen as a discrete 2D signal • Each pixel with coordinates (x, y) has a value between 0 (black) and 255](https://reader034.vdocuments.site/reader034/viewer/2022042017/5e7575f54df72e52db1be1a1/html5/thumbnails/12.jpg)
Filter
Butterworth
filter
– Low pass
– 3rd order
– Cuttoff
frequency:
2 Hz
0 1 2 3 4 5 6 7 8 9 10
-200
-100
0
Frequency (Hz)
Phase (
degre
es)
1 2 3 4 5 6
-80
-60
-40
-20
0
20
Frequency (Hz)
Magnitude (
dB
)
12
![Page 13: No Slide Title · Part 2: 2D signal processing • Grayscale image can be seen as a discrete 2D signal • Each pixel with coordinates (x, y) has a value between 0 (black) and 255](https://reader034.vdocuments.site/reader034/viewer/2022042017/5e7575f54df72e52db1be1a1/html5/thumbnails/13.jpg)
Filtering
0 0.5 1 1.5 2 2.5 3 3.5 4 4.5 5-0.8
-0.6
-0.4
-0.2
0
0.2
0.4
0.6
0.8
Time [s]
Am
plit
ude
Filtered signal
-15 -10 -5 0 5 10 150
0.05
0.1
0.15
0.2
0.25
0.3
0.35
Frequency [Hz]
FFT
13
![Page 14: No Slide Title · Part 2: 2D signal processing • Grayscale image can be seen as a discrete 2D signal • Each pixel with coordinates (x, y) has a value between 0 (black) and 255](https://reader034.vdocuments.site/reader034/viewer/2022042017/5e7575f54df72e52db1be1a1/html5/thumbnails/14.jpg)
Sampling after filtering
0 0.5 1 1.5 2 2.5 3 3.5 4 4.5 5-0.6
-0.4
-0.2
0
0.2
0.4
0.6
0.8
Time [s]
Am
plit
ude
Signal sampled @ 2 Hz
14
![Page 15: No Slide Title · Part 2: 2D signal processing • Grayscale image can be seen as a discrete 2D signal • Each pixel with coordinates (x, y) has a value between 0 (black) and 255](https://reader034.vdocuments.site/reader034/viewer/2022042017/5e7575f54df72e52db1be1a1/html5/thumbnails/15.jpg)
Reconstruction
(Linear vs. Wittaker-Shannon)
0 0.5 1 1.5 2 2.5 3 3.5 4 4.5 5-0.6
-0.4
-0.2
0
0.2
0.4
0.6
0.8
1
Am
plit
ude
Time [s]
Reconstructed signal
0 0.5 1 1.5 2 2.5 3 3.5 4 4.5 5-0.6
-0.4
-0.2
0
0.2
0.4
0.6
0.8
Time [s]
Am
plit
ude
Reconstructed signal
15
![Page 16: No Slide Title · Part 2: 2D signal processing • Grayscale image can be seen as a discrete 2D signal • Each pixel with coordinates (x, y) has a value between 0 (black) and 255](https://reader034.vdocuments.site/reader034/viewer/2022042017/5e7575f54df72e52db1be1a1/html5/thumbnails/16.jpg)
Signal
generationFiltering Sampling Reconstruction
• Filter type
• Order
• Cut-off frequency
• 𝑓 𝑥 = 𝑖𝐴𝑖sin(2𝜋𝑓𝑖𝑡)• sin frequencies
• sin amplitudes
16
![Page 17: No Slide Title · Part 2: 2D signal processing • Grayscale image can be seen as a discrete 2D signal • Each pixel with coordinates (x, y) has a value between 0 (black) and 255](https://reader034.vdocuments.site/reader034/viewer/2022042017/5e7575f54df72e52db1be1a1/html5/thumbnails/17.jpg)
Signal
generationFiltering Sampling Reconstruction
• Sampling
frequency
• Linear
interpolation
• Whittaker-
Shannon
17
![Page 18: No Slide Title · Part 2: 2D signal processing • Grayscale image can be seen as a discrete 2D signal • Each pixel with coordinates (x, y) has a value between 0 (black) and 255](https://reader034.vdocuments.site/reader034/viewer/2022042017/5e7575f54df72e52db1be1a1/html5/thumbnails/18.jpg)
Part 2: 2D signal processing• Grayscale image can be seen as a discrete 2D signal
• Each pixel with coordinates (x, y) has a value between 0
(black) and 255 (white)
• 2D FFT represents frequency components along x and y
dimensions of original signal
• Like the 1D FFT, it also shows symmetry around originAmplitude
0
50
100
150
200
250
FFT
18
![Page 19: No Slide Title · Part 2: 2D signal processing • Grayscale image can be seen as a discrete 2D signal • Each pixel with coordinates (x, y) has a value between 0 (black) and 255](https://reader034.vdocuments.site/reader034/viewer/2022042017/5e7575f54df72e52db1be1a1/html5/thumbnails/19.jpg)
Similarity with 1D
• Recall the 1D FFT of a square wave
19