-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcolors_of_noise.tex
330 lines (271 loc) · 12.7 KB
/
colors_of_noise.tex
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
\title{Colors of image noise}
\section{White Gaussian noise}
Everybody knows about white Gaussian noise
\includegraphics{white.png}
%SCRIPT plambda zero:512x512 randg | qauto -p 0.1 - white.png &
White Gaussian noise is famous because it has very nice properties:
\begin{enumerate}
\item It is easy to generate using pseudorandom numbers
\item Each pixel is an independent, identically distributed Normal
variable
\item The discrete Fourier, Hartley and Cosine transforms are also
white Gaussian noise (except for the obvious symmetries)
\item In particular, the power spectrum is mostly flat
\item Applying a linear filter renders the pixel values
non-independent, but they are still Normal and identically
distributed.
\end{enumerate}
Some properties of dubious convenience:
\begin{enumerate}
\item The mean is zero, thus it cannot be directly represented as
a positive-valued image
\item Worse, the pixel values are not bounded, thus it has a-priori
infinite dynamic range.
\item When you see it from far away (zooming-out), it disappears.
\end{enumerate}
Statistics of white gaussian noise and its DFT:
\begin{tabular}{cccc}
\includegraphics{w256.png} &
\includegraphics{w256_h.png} &
\includegraphics{w256_f.png} &
\includegraphics{w256_p.png} \\
$u(x)$ &
histogram of~$u$ &
$\log|\hat u(\xi)|$ &
average spectral profile
\end{tabular}
%SCRIPT plambda zero:256x256 randg -o w256.tiff
%SCRIPT qauto -p 0.1 w256.tiff w256.png &
%SCRIPT plambda w256.tiff 'x%a x%i - 300 / >1 x <1 / round <1 *' | ghisto -p | \
%SCRIPT sed 's/cairo/cairo enhanced font "Verdana,8" size 256,256/' |\
%SCRIPT gnuplot > w256_h.png &
%SCRIPT fft<w256.tiff|fftshift|plambda 'vnorm 1 + log'|qauto -p .1 - w256_f.png&
%SCRIPT (printf 'set term pngcairo size 256,256\nset format y ""\nset xlabel "±|ξ|"\nset ylabel "avg |û(ξ)|"\n'; fft <w256.tiff|fftshift|plambda 'vnorm'|cline nan|sed 's/data//g')|gnuplot > w256_p.png &
\section{Blurred white Gaussian noise}
White gaussian noise blurred by a small gaussian kernel:
\begin{tabular}{cccc}
\includegraphics{b256.png} &
\includegraphics{b256_h.png} &
\includegraphics{b256_f.png} &
\includegraphics{b256_p.png} \\
$u(x)$ &
histogram of~$u$ &
$\log|\hat u(\xi)|$ &
average spectral profile
\end{tabular}
%SCRIPT plambda zero:256x256 randg |blur g 1 - b256.tiff
%SCRIPT qauto -p 0.1 b256.tiff b256.png &
%SCRIPT plambda b256.tiff 'x%a x%i - 300 / >1 x <1 / round <1 *' | ghisto -p | \
%SCRIPT sed 's/cairo/cairo enhanced font "Verdana,8" size 256,256/' | \
%SCRIPT gnuplot > b256_h.png &
%SCRIPT fft<b256.tiff|fftshift|plambda 'vnorm 1 + log'|qauto -p .1 - b256_f.png&
%SCRIPT (printf 'set term pngcairo size 256,256\nset format y ""\nset xlabel "±|ξ|"\nset ylabel "avg |û(ξ)|"\n'; fft <b256.tiff|fftshift|plambda 'vnorm'|cline nan|sed 's/data//g')|gnuplot > b256_p.png &
White gaussian noise blurred by a larger gaussian kernel:
\begin{tabular}{cccc}
\includegraphics{B256.png} &
\includegraphics{B256_h.png} &
\includegraphics{B256_f.png} &
\includegraphics{B256_p.png} \\
$u(x)$ &
histogram of~$u$ &
$\log|\hat u(\xi)|$ &
average spectral profile
\end{tabular}
%SCRIPT plambda zero:256x256 randg |blur g 5 - B256.tiff
%SCRIPT qauto -p 0.1 B256.tiff B256.png &
%SCRIPT plambda B256.tiff 'x%a x%i - 300 / >1 x <1 / round <1 *' | ghisto -p | \
%SCRIPT sed 's/cairo/cairo enhanced font "Verdana,8" size 256,256/' | \
%SCRIPT gnuplot > B256_h.png &
%SCRIPT fft<B256.tiff|fftshift|plambda 'vnorm 1 + log'|qauto -p .1 - B256_f.png&
%SCRIPT (printf 'set term pngcairo size 256,256\nset format y ""\nset xlabel "±|ξ|"\nset ylabel "avg |û(ξ)|"\n'; fft <B256.tiff|fftshift|plambda 'vnorm'|cline nan|sed 's/data//g')|gnuplot > B256_p.png &
White gaussian noise blurred by a Cauchy kernel:
\begin{tabular}{cccc}
\includegraphics{c256.png} &
\includegraphics{c256_h.png} &
\includegraphics{c256_f.png} &
\includegraphics{c256_p.png} \\
$u(x)$ &
histogram of~$u$ &
$\log|\hat u(\xi)|$ &
average spectral profile
\end{tabular}
%SCRIPT plambda zero:256x256 randg |blur c 1 - c256.tiff
%SCRIPT qauto -p 0.1 c256.tiff c256.png &
%SCRIPT plambda c256.tiff 'x%a x%i - 300 / >1 x <1 / round <1 *' | ghisto -p | \
%SCRIPT sed 's/cairo/cairo enhanced font "Verdana,8" size 256,256/' |\
%SCRIPT gnuplot > c256_h.png &
%SCRIPT fft<c256.tiff|fftshift|plambda 'vnorm 1 + log'|qauto -p .1 - c256_f.png&
%SCRIPT (printf 'set term pngcairo size 256,256\nset format y ""\nset xlabel "±|ξ|"\nset ylabel "avg |û(ξ)|"\n'; fft <c256.tiff|fftshift|plambda 'vnorm'|cline nan|sed 's/data//g')|gnuplot > c256_p.png &
White gaussian noise blurred by a Laplace kernel:
\begin{tabular}{cccc}
\includegraphics{l256.png} &
\includegraphics{l256_h.png} &
\includegraphics{l256_f.png} &
\includegraphics{l256_p.png} \\
$u(x)$ &
histogram of~$u$ &
$\log|\hat u(\xi)|$ &
average spectral profile
\end{tabular}
%SCRIPT plambda zero:256x256 randg |blur l 1 - l256.tiff
%SCRIPT qauto -p 0.1 l256.tiff l256.png &
%SCRIPT plambda l256.tiff 'x%a x%i - 300 / >1 x <1 / round <1 *' | ghisto -p | \
%SCRIPT sed 's/cairo/cairo enhanced font "Verdana,8" size 256,256/' |\
%SCRIPT gnuplot > l256_h.png &
%SCRIPT fft<l256.tiff|fftshift|plambda 'vnorm 1 + log'|qauto -p .1 - l256_f.png&
%SCRIPT (printf 'set term pngcairo size 256,256\nset format y ""\nset xlabel "±|ξ|"\nset ylabel "avg |û(ξ)|"\n'; fft <l256.tiff|fftshift|plambda 'vnorm'|cline nan|sed 's/data//g')|gnuplot > l256_p.png &
White gaussian noise blurred by a Disk kernel:
\begin{tabular}{cccc}
\includegraphics{d256.png} &
\includegraphics{d256_h.png} &
\includegraphics{d256_f.png} &
\includegraphics{d256_p.png} \\
$u(x)$ &
histogram of~$u$ &
$\log|\hat u(\xi)|$ &
average spectral profile
\end{tabular}
%SCRIPT plambda zero:256x256 randg |blur disk 4.5 - d256.tiff
%SCRIPT qauto -p 0.1 d256.tiff d256.png &
%SCRIPT plambda d256.tiff 'x%a x%i - 300 / >1 x <1 / round <1 *' | ghisto -p | \
%SCRIPT sed 's/cairo/cairo enhanced font "Verdana,8" size 256,256/' |\
%SCRIPT gnuplot > d256_h.png &
%SCRIPT fft<d256.tiff|fftshift|plambda 'vnorm 1 + log'|qauto -p .1 - d256_f.png&
%SCRIPT (printf 'set term pngcairo size 256,256\nset format y ""\nset xlabel "±|ξ|"\nset ylabel "avg |û(ξ)|"\n'; fft <d256.tiff|fftshift|plambda 'vnorm'|cline nan|sed 's/data//g')|gnuplot > d256_p.png &
White gaussian noise blurred by a Square kernel:
\begin{tabular}{cccc}
\includegraphics{s256.png} &
\includegraphics{s256_h.png} &
\includegraphics{s256_f.png} &
\includegraphics{s256_p.png} \\
$u(x)$ &
histogram of~$u$ &
$\log|\hat u(\xi)|$ &
average spectral profile
\end{tabular}
%SCRIPT plambda zero:256x256 randg |blur square 14 - s256.tiff
%SCRIPT qauto -p 0.1 s256.tiff s256.png
%SCRIPT plambda s256.tiff 'x%a x%i - 300 / >1 x <1 / round <1 *' | ghisto -p | \
%SCRIPT sed 's/cairo/cairo enhanced font "Verdana,8" size 256,256/' |\
%SCRIPT gnuplot > s256_h.png &
%SCRIPT fft<s256.tiff|fftshift|plambda 'vnorm 1 + log'|qauto -p .1 - s256_f.png&
%SCRIPT (printf 'set term pngcairo size 256,256\nset format y ""\nset xlabel "±|ξ|"\nset ylabel "avg |û(ξ)|"\n'; fft <s256.tiff|fftshift|plambda 'vnorm'|cline nan|sed 's/data//g')|gnuplot > s256_p.png &
\section{Colored gaussian noise}
When the spectrum of noise decays as a power-law, we say that it is
``colored'' noise. The exponent~$\alpha$ of the power law determines its
color. The particular case of~$\alpha=0$ corresponds to white noise (a flat
spectrum).
\begin{tabular}{lll}
\includegraphics{purple.png} &
\includegraphics{blue.png} &
\includegraphics{white2.png} \\
$\alpha=2$ purple &
$\alpha=1$ blue &
$\alpha=0$ white \\
$\phantom{a}$ &&\\
\includegraphics{pink.png} &
\includegraphics{brown.png} &
\includegraphics{smooth.png} \\
$\alpha=-1$ pink &
$\alpha=-2$ brown &
$\alpha=-3$ smooth \\
\end{tabular}
%SCRIPT plambda zero:256x256 randg -o white.tiff
%SCRIPT cat white.tiff|qauto -p 0.1 - white2.png &
%SCRIPT cat white.tiff|fft|plambda ':R 2 ^ *'|ifft|qauto -p 0.1 - purple.png &
%SCRIPT cat white.tiff|fft|plambda ':R 1 ^ *'|ifft|qauto -p 0.1 - blue.png &
%SCRIPT cat white.tiff|fft|plambda ':R -1 ^ *'|ifft|qauto -p 0.1 - pink.png &
%SCRIPT cat white.tiff|fft|plambda ':R -2 ^ *'|ifft|qauto -p 0.1 - brown.png &
%SCRIPT cat white.tiff|fft|plambda ':R -3 ^ *'|ifft|qauto -p 0.1 - smooth.png &
Statistics of Pink noise ($\alpha=-1$):
\begin{tabular}{cccc}
\includegraphics{KK-1.png} &
\includegraphics{KK-1_h.png} &
\includegraphics{KK-1_f.png} &
\includegraphics{KK-1_p.png} \\
$u(x)$ &
histogram of~$u$ &
$\log|\hat u(\xi)|$ &
average spectral profile
\end{tabular}
%SCRIPT plambda zero:256x256 randg|fft|plambda ':R -1 ^ *'|ifft >KK-1.tiff
%SCRIPT qauto -p 0.1 KK-1.tiff KK-1.png &
%SCRIPT plambda KK-1.tiff 'x%a x%i - 300 / >1 x <1 / round <1 *' | ghisto -p | \
%SCRIPT sed 's/cairo/cairo enhanced font "Verdana,8" size 256,256/' |\
%SCRIPT gnuplot > KK-1_h.png &
%SCRIPT fft<KK-1.tiff|fftshift|plambda 'vnorm 1 + log'|qauto -p .1 - KK-1_f.png&
%SCRIPT (printf 'set term pngcairo size 256,256\nset format y ""\nset xlabel "±|ξ|"\nset ylabel "log avg |û(ξ)|"\nset logscale y\n'; fft <KK-1.tiff|fftshift|plambda 'vnorm'|cline nan|sed 's/data//g')|gnuplot > KK-1_p.png &
Statistics of Brown noise ($\alpha=-2$):
\begin{tabular}{cccc}
\includegraphics{KK-2.png} &
\includegraphics{KK-2_h.png} &
\includegraphics{KK-2_f.png} &
\includegraphics{KK-2_p.png} \\
$u(x)$ &
histogram of~$u$ &
$\log|\hat u(\xi)|$ &
average spectral profile
\end{tabular}
%SCRIPT plambda zero:256x256 randg|fft|plambda ':R -2 ^ *'|ifft >KK-2.tiff
%SCRIPT qauto -p 0.1 KK-2.tiff KK-2.png &
%SCRIPT plambda KK-2.tiff 'x%a x%i - 300 / >1 x <1 / round <1 *' | ghisto -p | \
%SCRIPT sed 's/cairo/cairo enhanced font "Verdana,8" size 256,256/' | \
%SCRIPT gnuplot > KK-2_h.png &
%SCRIPT fft<KK-2.tiff|fftshift|plambda 'vnorm 1 + log'|qauto -p .1 - KK-2_f.png&
%SCRIPT (printf 'set term pngcairo size 256,256\nset format y ""\nset xlabel "±|ξ|"\nset ylabel "avg |û(ξ)|"\nset logscale y\n'; fft <KK-2.tiff|fftshift|plambda 'vnorm'|cline nan|sed 's/data//g')|gnuplot > KK-2_p.png &
Statistics of Smooth noise ($\alpha=-3$):
\begin{tabular}{cccc}
\includegraphics{KK-3.png} &
\includegraphics{KK-3_h.png} &
\includegraphics{KK-3_f.png} &
\includegraphics{KK-3_p.png} \\
$u(x)$ &
histogram of~$u$ &
$\log|\hat u(\xi)|$ &
average spectral profile
\end{tabular}
%SCRIPT plambda zero:256x256 randg|fft|plambda ':R -3 ^ *'|ifft >KK-3.tiff
%SCRIPT qauto -p 0.1 KK-3.tiff KK-3.png &
%SCRIPT plambda KK-3.tiff 'x%a x%i - 300 / >1 x <1 / round <1 *' | ghisto -p | \
%SCRIPT sed 's/cairo/cairo enhanced font "Verdana,8" size 256,256/' | \
%SCRIPT gnuplot > KK-3_h.png &
%SCRIPT fft<KK-3.tiff|fftshift|plambda 'vnorm 1 + log'|qauto -p .1 - KK-3_f.png&
%SCRIPT (printf 'set term pngcairo size 256,256\nset format y ""\nset xlabel "±|ξ|"\nset ylabel "avg |û(ξ)|"\nset logscale y\n'; fft <KK-3.tiff|fftshift|plambda 'vnorm'|cline nan|sed 's/data//g')|gnuplot > KK-3_p.png &
Statistics of Blue noise ($\alpha=1$):
\begin{tabular}{cccc}
\includegraphics{KK+1.png} &
\includegraphics{KK+1_h.png} &
\includegraphics{KK+1_f.png} &
\includegraphics{KK+1_p.png} \\
$u(x)$ &
histogram of~$u$ &
$\log|\hat u(\xi)|$ &
average spectral profile
\end{tabular}
%SCRIPT plambda zero:256x256 randg|fft|plambda ':R 1 ^ *'|ifft >KK+1.tiff
%SCRIPT qauto -p 0.1 KK+1.tiff KK+1.png &
%SCRIPT plambda KK+1.tiff 'x%a x%i - 300 / >1 x <1 / round <1 *' | ghisto -p | \
%SCRIPT sed 's/cairo/cairo enhanced font "Verdana,8" size 256,256/' | \
%SCRIPT gnuplot > KK+1_h.png &
%SCRIPT fft<KK+1.tiff|fftshift|plambda 'vnorm 1 + log'|qauto -p .1 - KK+1_f.png&
%SCRIPT (printf 'set term pngcairo size 256,256\nset format y ""\nset xlabel "±|ξ|"\nset ylabel "avg |û(ξ)|"\nset logscale y\n'; fft <KK+1.tiff|fftshift|plambda 'vnorm'|cline nan|sed 's/data//g')|gnuplot > KK+1_p.png &
Statistics of Purple noise ($\alpha=2$):
\begin{tabular}{cccc}
\includegraphics{KK+2.png} &
\includegraphics{KK+2_h.png} &
\includegraphics{KK+2_f.png} &
\includegraphics{KK+2_p.png} \\
$u(x)$ &
histogram of~$u$ &
$\log|\hat u(\xi)|$ &
average spectral profile
\end{tabular}
%SCRIPT plambda zero:256x256 randg|fft|plambda ':R 2 ^ *'|ifft >KK+2.tiff
%SCRIPT qauto -p 0.1 KK+2.tiff KK+2.png &
%SCRIPT plambda KK+2.tiff 'x%a x%i - 300 / >1 x <1 / round <1 *' | ghisto -p | \
%SCRIPT sed 's/cairo/cairo enhanced font "Verdana,8" size 256,256/' | \
%SCRIPT gnuplot > KK+2_h.png &
%SCRIPT fft<KK+2.tiff|fftshift|plambda 'vnorm 1 + log'|qauto -p .1 - KK+2_f.png&
%SCRIPT (printf 'set term pngcairo size 256,256\nset format y ""\nset xlabel "±|ξ|"\nset ylabel "avg |û(ξ)|"\nset logscale y\n'; fft <KK+2.tiff|fftshift|plambda 'vnorm'|cline nan|sed 's/data//g')|gnuplot > KK+2_p.png &
%SCRIPT wait
% vim:set tw=77 filetype=tex spell spelllang=en: