no slide title · part 2: 2d signal processing • grayscale image can be seen as a discrete 2d...
Post on 16-Mar-2020
10 Views
Preview:
TRANSCRIPT
Lab 5
School of Architecture, Civil and
Environmental Engineering
EPFL, SS 2012-2013
http://disal.epfl.ch/teaching/signals_instruments_systems/
1
Lab 5 Outline
• Concepts:
– Fast Fourier transforms
– Signal sampling and reconstruction
– Filtering
• Tools:
– Matlab
2
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
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
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
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
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
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
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
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
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
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
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
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
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
Signal
generationFiltering Sampling Reconstruction
• Filter type
• Order
• Cut-off frequency
• 𝑓 𝑥 = 𝑖𝐴𝑖sin(2𝜋𝑓𝑖𝑡)• sin frequencies
• sin amplitudes
16
Signal
generationFiltering Sampling Reconstruction
• Sampling
frequency
• Linear
interpolation
• Whittaker-
Shannon
17
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
Similarity with 1D
• Recall the 1D FFT of a square wave
19
top related