Skip to content

Commit c751d67

Browse files
committed
LaTeX sources and shell scripts for the illustrations
1 parent 17141e8 commit c751d67

21 files changed

+852
-0
lines changed

images/README

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
The illustrations in the notebooks are drawn in LaTeX using the TikZ/PGF package. The images are exported as PNG files using the standalone package and resized by convert from ImageMagick. The PNG parameter ‚density‘ is set for an appropriate size when exporting the notebooks as PDF using nbconvert. The OS X/Linux shell scripts recreate the images in the correct subdirectories.

images/filter_design.tex

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
\input{prefix}
2+
3+
% =============================================================================
4+
% =============================================================================
5+
\begin{document}
6+
7+
8+
% Bilinear transform
9+
% =============================================================================
10+
\begin{tikzpicture}
11+
12+
\begin{scope}
13+
14+
\draw[->] (-2,0)--(2.3,0) node[right]{$\sigma$};
15+
\draw[->] (0,-2.2)--(0,2.2) node[left]{$j \omega$};
16+
\filldraw[pattern=north west lines,draw=none] (-1.8,-1.5) rectangle (0,1.5);
17+
\filldraw[pattern=horizontal lines,draw=none] (0,-1.5) rectangle (1.8,1.5);
18+
19+
\draw[blue,thick] (-1.8,1.5)--(1.8,1.5);
20+
\draw[blue,thick] (-1.8,-1.5)--(1.8,-1.5);
21+
\node[above right] at (0,1.5){$j \frac{\pi}{T}$};
22+
\node[below right] at (0,-1.5){$- j \frac{\pi}{T}$};
23+
\draw[red,thick] (0,-1.5)--(0,1.5);
24+
25+
\filldraw[cyan] (0,1.5) circle(0.07);
26+
\filldraw[cyan] (0,-1.5) circle(0.07);
27+
\filldraw[black] (0,0) circle(0.07);
28+
29+
30+
\end{scope}
31+
32+
\begin{scope}[xshift=6cm]
33+
34+
35+
\filldraw[pattern=horizontal lines,draw=none] (-1.8,-1.8) rectangle (1.8,1.8);
36+
\filldraw[nonzero rule,pattern=north west lines,draw=red,fill=white,thick] (0,0) circle(1.25);
37+
\filldraw[pattern=north west lines,draw=none] (0,0) circle(1.25);
38+
39+
\draw[->] (-2,0)--(2.2,0) node[right]{$\text{Re}\{z\}$};
40+
\draw[->] (0,-2.2)--(0,2.3) node[left]{$\text{Im}\{z\}$};
41+
42+
\filldraw[black] (1.25,0) circle(0.07);
43+
\filldraw[cyan] (-1.25,0) circle(0.07);
44+
45+
\node[below right] at (1.25,0){$1$};
46+
\node[above left] at (0,1.25){$1$};
47+
48+
\end{scope}
49+
50+
\end{tikzpicture}
51+
52+
% 2nd order lowpass
53+
% =============================================================================
54+
\begin{circuitikz}[european]
55+
\draw (-0,0) to [R, l=R,o-] (2,0);
56+
\draw (2,0) to [L,l=L,-*,i=$i(t)$] (5,0);
57+
\draw (5,0) to [C,l=C,-*] (5,-2);
58+
\draw (5,0) to [short,-o] (7,0);
59+
\draw (0,-2) to [short,o-o] (7,-2);
60+
\draw[-latex] (0,-0.2)--(0,-1.8) node[midway,left]{$x(t)$};
61+
\draw[-latex] (7,-0.2)--(7,-1.8) node[midway,right]{$y(t)$};
62+
\end{circuitikz}
63+
64+
65+
\end{document}

images/mk_filter_design.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
latex -shell-escape filter_design.tex
2+
convert -units PixelsPerInch -density 144 -resize 600 filter_design-1.png ../filter_design/sz_mapping.png
3+
convert -units PixelsPerInch -density 144 -resize 600 filter_design-2.png ../filter_design/RLC_lowpass.png
4+
5+

images/mk_nonrecursive_filters.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
latex -shell-escape non_recursive_filters.tex
2+
convert -units PixelsPerInch -density 144 -resize 600 non_recursive_filters-1.png ../nonrecursive_filters/overlap_add.png
3+
convert -units PixelsPerInch -density 144 -resize 600 non_recursive_filters-2.png ../nonrecursive_filters/overlap_save.png
4+
convert -units PixelsPerInch -density 144 -resize 400 non_recursive_filters-3.png ../nonrecursive_filters/roundoff_model.png

images/mk_quantization.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
latex -shell-escape quantization.tex
2+
convert -units PixelsPerInch -density 144 -resize 300 quantization-1.png ../quantization/model_quantization.png
3+
convert -units PixelsPerInch -density 144 -resize 400 quantization-2.png ../quantization/mid_tread_characteristic.png
4+
convert -units PixelsPerInch -density 144 -resize 400 quantization-3.png ../quantization/mid_rise_characteristic.png
5+
convert -units PixelsPerInch -density 144 -resize 400 quantization-4.png ../quantization/noise_shaping.png
6+
convert -units PixelsPerInch -density 144 -resize 400 quantization-5.png ../quantization/ideal_ADC.png
7+
convert -units PixelsPerInch -density 144 -resize 600 quantization-6.png ../quantization/oversampling.png
8+
convert -units PixelsPerInch -density 144 -resize 800 quantization-7.png ../quantization/oversampling_anti_aliasing.png

images/mk_random_signals.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
latex -shell-escape random_signals.tex
2+
convert -units PixelsPerInch -density 144 -resize 600 random_signals-1.png ../random_signals/measurement_channel.png
3+
convert -units PixelsPerInch -density 144 -resize 500 random_signals-2.png ../random_signals/communication_channel.png
4+
5+

images/mk_recursive_filters.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
latex -shell-escape recursive_filters.tex
2+
convert -units PixelsPerInch -density 144 -resize 600 recursive_filters-1.png ../recursive_filters/direct_form_i.png
3+
convert -units PixelsPerInch -density 144 -resize 600 recursive_filters-2.png ../recursive_filters/direct_form_ii.png
4+
convert -units PixelsPerInch -density 144 -resize 600 recursive_filters-3.png ../recursive_filters/direct_form_ii_t.png
5+
convert -units PixelsPerInch -density 144 -resize 500 recursive_filters-4.png ../recursive_filters/coupled_form.png

images/mk_systems.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
latex -shell-escape systems.tex
2+
convert -units PixelsPerInch -density 144 -resize 400 systems-1.png systems-1.png
3+
convert -units PixelsPerInch -density 144 -resize 400 systems-2.png ../random_signals_LTI_systems/LTI_system_td.png
4+
convert -units PixelsPerInch -density 144 -resize 400 systems-2.png ../nonrecursive_filters/LTI_system_td.png
5+
convert -units PixelsPerInch -density 144 -resize 400 systems-3.png ../spectral_estimation_random_signals/synthesis_model.png
6+
convert -units PixelsPerInch -density 144 -resize 400 systems-4.png ../spectral_estimation_random_signals/analysis_model.png
7+

images/mk_wiener_filter.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
latex -shell-escape wiener_filter.tex
2+
convert -units PixelsPerInch -density 144 -resize 600 wiener_filter-1.png ../random_signals_LTI_systems/model_wiener_filter.png

images/non_recursive_filters.tex

Lines changed: 158 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,158 @@
1+
\input{prefix}
2+
3+
% =============================================================================
4+
% =============================================================================
5+
\begin{document}
6+
7+
8+
9+
10+
% overlap-add convolution
11+
\pgfdeclarelayer{background}
12+
\pgfsetlayers{background,main}
13+
14+
\begin{tikzpicture}[auto, node distance=25mm]
15+
16+
% input segments
17+
\node[block, minimum height=1em, minimum width=25mm] (x0){$x_0[k]$};
18+
\node[block, right of=x0, minimum height=1em, minimum width=25mm] (x1){$x_1[k]$};
19+
\node[block, right of=x1, minimum height=1em, minimum width=25mm] (x2){$x_2[k]$};
20+
\node[block, right of=x2, minimum height=1em, minimum width=25mm] (x3){$x_3[k]$};
21+
\node[right of=x3, xshift=-5mm] {$\dots$};
22+
23+
\node[block, right of=x0, minimum height=1em, minimum width=15mm, xshift=10cm] (h){$h[k]$};
24+
\node[left of=h, xshift=15mm] {$*$};
25+
26+
% convolved segments
27+
\node[block, minimum height=1em, minimum width=40mm, anchor=west](y0) at ($(x0.west) - (0, 1.5)$) {$y_0[k] = x_0[k] * h[k]$};
28+
\node[block, minimum height=1em, minimum width=40mm, anchor=west](y1) at ($(x1.west) - (0, 2.75)$) {$y_1[k] = x_1[k] * h[k]$};
29+
\node[block, minimum height=1em, minimum width=40mm, anchor=west](y2) at ($(x2.west) - (0, 4)$) {$y_2[k] = x_2[k] * h[k]$};
30+
\node[block, minimum height=1em, minimum width=40mm, anchor=west](y3) at ($(x3.west) - (0, 5.25)$) {$y_3[k] = x_3[k] * h[k]$};
31+
% output
32+
\node[block, minimum height=1em, minimum width=100mm, anchor=west](y) at ($(x0.west) - (0, 7)$) {$y[k]$};
33+
\node[right of=y, xshift=35mm] {$\dots$};
34+
35+
% segment borders
36+
\begin{pgfonlayer}{background}
37+
\draw[dashed] (x1.west) -- ($(x1.west) - (0, 7)$);
38+
\draw[dashed] (x2.west) -- ($(x2.west) - (0, 7)$);
39+
\draw[dashed] (x3.west) -- ($(x3.west) - (0, 7)$);
40+
\draw[dashed] (x3.east) -- ($(x3.east) - (0, 7)$);
41+
42+
\draw[dashed] (y0.east) -- ($(y0.east) - (0, 1.25)$);
43+
\draw[dashed] (y1.east) -- ($(y1.east) - (0, 1.25)$);
44+
\draw[dashed] (y2.east) -- ($(y2.east) - (0, 1.25)$);
45+
\end{pgfonlayer}
46+
47+
% sums
48+
\node at ($(y0.east) - (7mm, 6mm)$) {\bf $+$};
49+
\node at ($(y1.east) - (7mm, 6mm)$) {\bf $+$};
50+
\node at ($(y2.east) - (7mm, 6mm)$) {\bf $+$};
51+
52+
% sizes
53+
\draw ($(x0.north west) + (0,.1) $) -- ($(x0.north west) + (0,.4) $);
54+
\draw ($(x0.north east) + (0,.1) $) -- ($(x0.north east) + (0,.4) $);
55+
\draw[<->] ($(x0.north west) + (0,.3) $) -- ($(x0.north east) + (0,.3) $) node[midway]{$P$};
56+
57+
\draw ($(h.north west) + (0,.1) $) -- ($(h.north west) + (0,.4) $);
58+
\draw ($(h.north east) + (0,.1) $) -- ($(h.north east) + (0,.4) $);
59+
\draw[<->] ($(h.north west) + (0,.3) $) -- ($(h.north east) + (0,.3) $) node[midway]{$N$};
60+
61+
\draw ($(y0.north west) + (0,.1) $) -- ($(y0.north west) + (0,.4) $);
62+
\draw ($(y0.north east) + (0,.1) $) -- ($(y0.north east) + (0,.4) $);
63+
\draw[<->] ($(y0.north west) + (0,.3) $) -- ($(y0.north east) + (0,.3) $) node[midway]{$P + N - 1$};
64+
65+
\end{tikzpicture}
66+
67+
68+
69+
% overlap-save convolution
70+
\pgfdeclarelayer{background}
71+
\pgfsetlayers{background,main}
72+
73+
\begin{tikzpicture}[auto, node distance=25mm]
74+
75+
% input
76+
\node[block, minimum height=1em, minimum width=100mm](x) {$x[k]$};
77+
\node[block, minimum height=5mm, minimum width=15mm, anchor=east](x00) at (x.west) {$0 {\color{gray!20} [}$};
78+
\node[right of=x, xshift=35mm] {$\dots$};
79+
80+
% input segments
81+
\node[block, minimum height=1em, minimum width=40mm, anchor=west](x0) at ($(x00.west) - (0, 1.5)$) {$x_0[k]$};
82+
\node[block, minimum height=1em, minimum width=40mm, anchor=west, xshift=-15mm](x1) at ($(x0.east) - (0, 1.5)$) {$x_1[k]$};
83+
\node[block, minimum height=1em, minimum width=40mm, anchor=west, xshift=-15mm](x2) at ($(x1.east) - (0, 1.5)$) {$x_2[k]$};
84+
\node[block, minimum height=1em, minimum width=40mm, anchor=west, xshift=-15mm](x3) at ($(x2.east) - (0, 1.5)$) {$x_3[k]$};
85+
86+
% convolved segments
87+
\node[block, minimum height=1em, minimum width=40mm, anchor=west](yc0) at ($(x0.west) - (0, 0.6)$) {$\qquad \qquad x_0[k] \circledast h_N[k]$};
88+
\node[block, minimum height=1em, minimum width=40mm, anchor=west](yc1) at ($(x1.west) - (0, 0.6)$) {$\qquad \qquad x_1[k] \circledast h_N[k]$};
89+
\node[block, minimum height=1em, minimum width=40mm, anchor=west](yc2) at ($(x2.west) - (0, 0.6)$) {$\qquad \qquad x_2[k] \circledast h_N[k]$};
90+
\node[block, minimum height=1em, minimum width=40mm, anchor=west](yc3) at ($(x3.west) - (0, 0.6)$) {$\qquad \qquad x_3[k] \circledast h_N[k]$};
91+
92+
\draw[draw=gray!100, opacity=0.5] (yc0.north west) -- ($(yc0.south west) + (1.5, 0)$);
93+
\draw[draw=gray!100, opacity=0.5] (yc0.south west) -- ($(yc0.north west) + (1.5, 0)$);
94+
\draw[draw=gray!100, opacity=0.5] ($(yc0.north west) + (1.5, 0)$) -- ($(yc0.south west) + (1.5, 0)$);
95+
96+
\draw[draw=gray!100, opacity=0.5] (yc1.north west) -- ($(yc1.south west) + (1.5, 0)$);
97+
\draw[draw=gray!100, opacity=0.5] (yc1.south west) -- ($(yc1.north west) + (1.5, 0)$);
98+
\draw[draw=gray!100, opacity=0.5] ($(yc1.north west) + (1.5, 0)$) -- ($(yc1.south west) + (1.5, 0)$);
99+
100+
\draw[draw=gray!100, opacity=0.5] (yc2.north west) -- ($(yc2.south west) + (1.5, 0)$);
101+
\draw[draw=gray!100, opacity=0.5] (yc2.south west) -- ($(yc2.north west) + (1.5, 0)$);
102+
\draw[draw=gray!100, opacity=0.5] ($(yc2.north west) + (1.5, 0)$) -- ($(yc2.south west) + (1.5, 0)$);
103+
104+
\draw[draw=gray!100, opacity=0.5] (yc3.north west) -- ($(yc3.south west) + (1.5, 0)$);
105+
\draw[draw=gray!100, opacity=0.5] (yc3.south west) -- ($(yc3.north west) + (1.5, 0)$);
106+
\draw[draw=gray!100, opacity=0.5] ($(yc3.north west) + (1.5, 0)$) -- ($(yc3.south west) + (1.5, 0)$);
107+
108+
109+
% output segments
110+
\node[block, minimum height=1em, minimum width=25mm, anchor=west](y0) at ($(x.west) - (0, 8)$) {$y_0[k]$};
111+
\node[block, right of=y0, minimum height=1em, minimum width=25mm] (y1){$y_1[k]$};
112+
\node[block, right of=y1, minimum height=1em, minimum width=25mm] (y2){$y_2[k]$};
113+
\node[block, right of=y2, minimum height=1em, minimum width=25mm] (y3){$y_3[k]$};
114+
\node[right of=y3, xshift=-5mm] {$\dots$};
115+
116+
% segment borders
117+
\begin{pgfonlayer}{background}
118+
\draw[dashed] (x.south west) -- (y0.north west);
119+
\draw[dashed] (x0.south east) -- (y1.north west);
120+
\draw[dashed] (x1.south east) -- (y2.north west);
121+
\draw[dashed] (x2.south east) -- (y3.north west);
122+
\draw[dashed] (x3.south east) -- (y3.north east);
123+
\end{pgfonlayer}
124+
125+
% sizes
126+
\draw ($(x0.north west) + (0,.1) $) -- ($(x0.north west) + (0,.4) $);
127+
\draw ($(x0.north east) + (0,.1) $) -- ($(x0.north east) + (0,.4) $);
128+
\draw[<->] ($(x0.north west) + (0,.3) $) -- ($(x0.north east) + (0,.3) $) node[midway]{$P$};
129+
130+
\draw ($(yc0.south west) + (0,-.1) $) -- ($(yc0.south west) + (0,-.4) $);
131+
\draw[<->] ($(yc0.south west) + (0,-.3) $) -- ($(yc0.south west) + (1.5,-.3) $) node[midway, below]{$N-1$};
132+
133+
134+
\end{tikzpicture}
135+
136+
137+
% model for round-off error
138+
\begin{tikzpicture}[auto, node distance=2cm]
139+
\node [input, name=input] {};
140+
\node [sum,right of=input, xshift=1cm] (mul){$\times$};
141+
\node [sum,right of=mul, xshift=1cm] (sum){$+$};
142+
\node [input, below of=sum,yshift=1cm] (error) {};
143+
\node [input, above of=mul,yshift=-1cm] (coeff) {};
144+
\node [output, right of=sum,xshift=0cm] (output) {};
145+
146+
\draw [-latex] (input) node[left]{$x_Q[k]$} -- (mul);
147+
\draw [-latex] (mul) -- (sum);
148+
\draw [-latex] (sum) -- (output) node[right]{$y_Q[k]$};
149+
\draw [-latex] (error) node[below]{$e[k]$} -- (sum);
150+
\draw [-latex] (coeff) node[above]{$a_Q$} -- (mul);
151+
152+
\draw [dashed] (.5,-1.6) rectangle (5.5,0.7);
153+
154+
\end{tikzpicture}
155+
156+
157+
158+
\end{document}

0 commit comments

Comments
 (0)