Professional Documents
Culture Documents
Mosè Giordano
26 November 2014
The purpose of Wiener filtering
Degradation Filtering
Mosè Giordano (UniSalento and INFN Lecce) Introduction to Wiener Filtering 26 November 2014 2 / 19
The theory
Suppose you have a signal S(t) in the time domain (whatever “time” is: actual
time, point in space, pixel of an image, etc), degraded by known blurring
shift-invariant function B(t) and additive noise N(t)
The Fourier transform in the frequency domain of this degraded signal X(t) is
Mosè Giordano (UniSalento and INFN Lecce) Introduction to Wiener Filtering 26 November 2014 3 / 19
The theory (cont.)
We want to find an appropriate filter W(f ) such that the function W(f )X̂(f ) is
as much close as possible to the Fourier transform of the original signal
Ŝ(f ) = F (S)(f ), i.e. we want to minimize the quantity
D E D E
W(f )X̂(f ) − Ŝ(f ) = W(f )(B̂(f )Ŝ(f ) + N̂(f )) − Ŝ(f )
B̂ ∗ (f )
W(f ) =
|B̂(f )|2 + |N̂(f )|2 /|Ŝ(f )|2
This is the Wiener filter function and F −1 (W X̂)(t) is the filtered signal. This
function gives more importance to frequencies with higher signal to noise
ratio. In absence of blurring
|Ŝ(f )|2
W(f ) =
|Ŝ(f )|2 + |N̂(f )|2
Mosè Giordano (UniSalento and INFN Lecce) Introduction to Wiener Filtering 26 November 2014 4 / 19
The theory (cont.)
Mosè Giordano (UniSalento and INFN Lecce) Introduction to Wiener Filtering 26 November 2014 5 / 19
Wiener filter applied to a temporal signal
IDL/GDL code:
; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;; Temporal Signal ;;;;;;;;;
; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
ntime = 1001
ff = 100
;; Define the times array.
time = findgen(ntime)/ff
;; The orignal signal.
sign = sin(time) - 0.7 * cos (0.7 * time) + 0.5 * sin (0.5 * time)^2
;; The noise.
noise = 0.3 * randomu(null , ntime) * cos (10 * randomu(null , ntime) * time)
;; Signal + noise.
sign_noise = sign + noise
;; Its Fourier transform.
ft = fft(sign_noise)
Mosè Giordano (UniSalento and INFN Lecce) Introduction to Wiener Filtering 26 November 2014 6 / 19
Wiener filter applied to a temporal signal (cont.)
1.5
Original signal
0.5
−0.5
−1
0 2 4 6 8 10
Time
Mosè Giordano (UniSalento and INFN Lecce) Introduction to Wiener Filtering 26 November 2014 7 / 19
Wiener filter applied to a temporal signal (cont.)
1.5
Original signal
Noisy signal
1
0.5
−0.5
−1
0 2 4 6 8 10
Time
Mosè Giordano (UniSalento and INFN Lecce) Introduction to Wiener Filtering 26 November 2014 8 / 19
Wiener filter applied to a temporal signal (cont.)
0.1 |Ŝ|2
|N̂|2
0.01
0.001
0.0001
1 × 10−5
1 × 10−6
1 × 10−7
1 × 10−8
−300 −200 −100 0 100 200 300
Frequency
Mosè Giordano (UniSalento and INFN Lecce) Introduction to Wiener Filtering 26 November 2014 9 / 19
Wiener filter applied to a temporal signal (cont.)
1
Wiener filter
0.1
0.01
0.001
0.0001
1 × 10−5
−300 −200 −100 0 100 200 300
Frequency
Mosè Giordano (UniSalento and INFN Lecce) Introduction to Wiener Filtering 26 November 2014 10 / 19
Wiener filter applied to a temporal signal (cont.)
1.5
Original signal
Filtered noisy signal
1
0.5
−0.5
−1
0 2 4 6 8 10
Time
Mosè Giordano (UniSalento and INFN Lecce) Introduction to Wiener Filtering 26 November 2014 11 / 19
Wiener filter applied to an image
IDL/GDL code:
; ;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;; Image ;;;;;;;;;
; ;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Read the Lena image.
read_jpeg , "lena.jpg", lena , /grayscale
;; Add a large noise to Lena.
img_noise = 1.8d * mean(lena) * randomu(systime (/ seconds), 512, 512)
degraded_img = lena + img_noise
;; Fourier transform of the degraded image.
ftimg = fft(degraded_img)
Mosè Giordano (UniSalento and INFN Lecce) Introduction to Wiener Filtering 26 November 2014 12 / 19
Wiener filter applied to an image (cont.)
We can use a different picture to filter the degraded image because they
have similar power spectra
500 100000 500 100000
’lena.dat’ matrix ’elaine.dat’ matrix
10000 10000
400 400
1000 1000
10 10
200 200
1 1
100 100
0.1 0.1
0 0.01 0 0.01
0 100 200 300 400 500 0 100 200 300 400 500
Left: power spectrum of lena.jpg file; right: power spectrum of elaine.jpg file
Mosè Giordano (UniSalento and INFN Lecce) Introduction to Wiener Filtering 26 November 2014 16 / 19
Wiener filter applied to an image (cont.)
1
0.1
0.01
0.001
Mosè Giordano (UniSalento and INFN Lecce) Introduction to Wiener Filtering 26 November 2014 17 / 19
Wiener filter applied to an image (cont.)
Mosè Giordano (UniSalento and INFN Lecce) Introduction to Wiener Filtering 26 November 2014 19 / 19