Skip to content

Commit f65d1b8

Browse files
committed
Relocated images, equation environment, copyright
1 parent f92f394 commit f65d1b8

File tree

9 files changed

+457
-443
lines changed

9 files changed

+457
-443
lines changed

images/systems-1.png

0 Bytes
Loading
2.54 KB
Loading

nonrecursive_filters/fast_convolution.ipynb

Lines changed: 384 additions & 382 deletions
Large diffs are not rendered by default.

nonrecursive_filters/introduction.ipynb

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"source": [
77
"# Realization of Non-Recursive Filters\n",
88
"\n",
9-
"*This jupyter/Python notebook is part of a [collection of notebooks](../index.ipynb) in the masters module [Digital Signal Processing](http://www.int.uni-rostock.de/Digitale-Signalverarbeitung.48.0.html), Comunications Engineering, Universität Rostock. Please direct questions and suggestions to <mailto:[email protected]>.*"
9+
"*This jupyter notebook is part of a [collection of notebooks](../index.ipynb) on various topics of Digital Signal Processing. Please direct questions and suggestions to [[email protected]](mailto:[email protected]).*"
1010
]
1111
},
1212
{
@@ -31,11 +31,13 @@
3131
"\n",
3232
"An LTI system can be characterized completely by its impulse response $h[k]$ \n",
3333
"\n",
34-
"![Linear time-invariant system](../images/systems-2.png)\n",
34+
"![Linear time-invariant system](LTI_system_td.png)\n",
3535
"\n",
3636
"The output signal $y[k]$ is given by (linear) convolution of the input signal $x[k]$ with the impulse response $h[k]$\n",
3737
"\n",
38-
"$$ y[k] = x[k] * h[k] = \\sum_{\\kappa = -\\infty}^{\\infty} x[\\kappa] \\; h[k-\\kappa] $$\n",
38+
"\\begin{equation}\n",
39+
"y[k] = x[k] * h[k] = \\sum_{\\kappa = -\\infty}^{\\infty} x[\\kappa] \\; h[k-\\kappa]\n",
40+
"\\end{equation}\n",
3941
"\n",
4042
"Two aspects of this representation become evident when inspecting above equation:\n",
4143
"\n",
@@ -45,11 +47,15 @@
4547
"\n",
4648
"The second aspect prohibits a practical realization. In order to be able to realize a non-recursive filter by convolution, the output at time-instant $k$ should only depend on the input signal $x[k]$ up to time-index $k$\n",
4749
"\n",
48-
"$$ y[k] = \\sum_{\\kappa = -\\infty}^{k} x[\\kappa] \\; h[k-\\kappa] $$\n",
50+
"\\begin{equation}\n",
51+
"y[k] = \\sum_{\\kappa = -\\infty}^{k} x[\\kappa] \\; h[k-\\kappa]\n",
52+
"\\end{equation}\n",
4953
"\n",
5054
"This is the case when the impulse response is causal, hence when $h[k] = 0$ for $k<0$. However, this still requires knowledge of the input signal for all past time-instants. If we further assume that the input signal is causal, $x[k] = 0$ for $k<0$, we get\n",
5155
"\n",
52-
"$$ y[k] = \\sum_{\\kappa = 0}^{k} x[\\kappa] \\; h[k-\\kappa] $$"
56+
"\\begin{equation}\n",
57+
"y[k] = \\sum_{\\kappa = 0}^{k} x[\\kappa] \\; h[k-\\kappa]\n",
58+
"\\end{equation}"
5359
]
5460
},
5561
{
@@ -60,11 +66,15 @@
6066
"\n",
6167
"Many practical systems have an impulse response of finite length $N$ or can be approximated by an impulse response of finite length\n",
6268
"\n",
63-
"$$ h_N[k] = \\begin{cases} h[k] & \\text{ for } 0 \\leq k < N \\\\ 0 & \\text{ otherwise} \\end{cases} $$\n",
69+
"\\begin{equation}\n",
70+
"h_N[k] = \\begin{cases} h[k] & \\text{ for } 0 \\leq k < N \\\\ 0 & \\text{ otherwise} \\end{cases}\n",
71+
"\\end{equation}\n",
6472
"\n",
6573
"Such an impulse response is denoted as [*finite impulse response*](https://en.wikipedia.org/wiki/Finite_impulse_response) (FIR). Introducing $h_N[k]$ into above sum and rearranging terms yields\n",
6674
"\n",
67-
"$$ y[k] = \\sum_{\\kappa = 0}^{k} x[\\kappa] \\; h_N[k-\\kappa] = \\sum_{\\kappa = 0}^{N-1} h_N[\\kappa] \\; x[k-\\kappa]$$\n",
75+
"\\begin{equation}\n",
76+
"y[k] = \\sum_{\\kappa = 0}^{k} x[\\kappa] \\; h_N[k-\\kappa] = \\sum_{\\kappa = 0}^{N-1} h_N[\\kappa] \\; x[k-\\kappa]\n",
77+
"\\end{equation}\n",
6878
"\n",
6979
"Hence for a causal input signal $x[k]$ and a FIR the output of the system can be computed by a finite number of operations. \n",
7080
"\n",
@@ -77,17 +87,7 @@
7787
"source": [
7888
"**Copyright**\n",
7989
"\n",
80-
"<p xmlns:dct=\"http://purl.org/dc/terms/\">\n",
81-
" <a rel=\"license\"\n",
82-
" href=\"http://creativecommons.org/publicdomain/zero/1.0/\">\n",
83-
" <img src=\"http://i.creativecommons.org/p/zero/1.0/88x31.png\" style=\"border-style: none;\" alt=\"CC0\" />\n",
84-
" </a>\n",
85-
" <br />\n",
86-
" To the extent possible under law,\n",
87-
" <span rel=\"dct:publisher\" resource=\"[_:publisher]\">the person who associated CC0</span>\n",
88-
" with this work has waived all copyright and related or neighboring\n",
89-
" rights to this work.\n",
90-
"</p>"
90+
"This notebook is provided as [Open Educational Resource](https://en.wikipedia.org/wiki/Open_educational_resources). Feel free to use the notebook for your own purposes. The text is licensed under [Creative Commons Attribution 4.0](https://creativecommons.org/licenses/by/4.0/), the code of the IPython examples under the [MIT license](https://opensource.org/licenses/MIT). Please attribute the work as follows: *Sascha Spors, Digital Signal Processing - Lecture notes featuring computational examples, 2016*."
9191
]
9292
}
9393
],

nonrecursive_filters/quantization_effects.ipynb

Lines changed: 35 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"source": [
77
"# Realization of Non-Recursive Filters\n",
88
"\n",
9-
"*This jupyter/Python notebook is part of a [collection of notebooks](../index.ipynb) in the masters module [Digital Signal Processing](http://www.int.uni-rostock.de/Digitale-Signalverarbeitung.48.0.html), Comunications Engineering, Universität Rostock. Please direct questions and suggestions to <mailto:[email protected]>.*"
9+
"*This jupyter notebook is part of a [collection of notebooks](../index.ipynb) on various topics of Digital Signal Processing. Please direct questions and suggestions to [[email protected]](mailto:[email protected]).*"
1010
]
1111
},
1212
{
@@ -28,19 +28,27 @@
2828
"\n",
2929
"The output signal $y[k]$ of a non-recursive filter with a finite impulse response (FIR) $h[k]$ of length $N$ is given as\n",
3030
"\n",
31-
"$$ y[k] = h[k] * x[k] = \\sum_{\\kappa = 0}^{N-1} h[\\kappa] \\; x[k - \\kappa] $$\n",
31+
"\\begin{equation}\n",
32+
"y[k] = h[k] * x[k] = \\sum_{\\kappa = 0}^{N-1} h[\\kappa] \\; x[k - \\kappa]\n",
33+
"\\end{equation}\n",
3234
"\n",
3335
"where $x[k]$ denotes the input signal. The quantized impulse response $h_Q[k]$ (quantized filter coefficients) is yielded by quantizing the impulse response $h[k]$\n",
3436
"\n",
35-
"$$ h_Q[k] = \\mathcal{Q} \\{ h[k] \\} = h[k] + e[k] $$\n",
37+
"\\begin{equation}\n",
38+
"h_Q[k] = \\mathcal{Q} \\{ h[k] \\} = h[k] + e[k]\n",
39+
"\\end{equation}\n",
3640
"\n",
3741
"where $e[k] = h_Q[k] - h[k]$ denotes the [quantization error](../quantization/introduction.ipynb#Model-of-the-Quantization-Process). Introducing $h_Q[k]$ into above equation and rearranging results in\n",
3842
"\n",
39-
"$$ y_Q[k] = \\sum_{\\kappa = 0}^{N-1} h[k] \\; x[k - \\kappa] + \\sum_{\\kappa = 0}^{N-1} e[k] \\; x[k - \\kappa] $$\n",
43+
"\\begin{equation}\n",
44+
"y_Q[k] = \\sum_{\\kappa = 0}^{N-1} h[k] \\; x[k - \\kappa] + \\sum_{\\kappa = 0}^{N-1} e[k] \\; x[k - \\kappa]\n",
45+
"\\end{equation}\n",
4046
"\n",
4147
"The input signal $x[k]$ is filtered by the quantization noise $e[k]$ and superimposed to the desired output of the filter. The overall transfer function $H_Q(e^{j \\Omega})$ of the filter with quantized filter coefficients is given as\n",
4248
"\n",
43-
"$$ H_Q(e^{j \\Omega}) = \\sum_{k=0}^{N-1} h[k] \\; e^{-j \\Omega k} + \\sum_{k=0}^{N-1} e[k] \\; e^{-j \\Omega k} = H(e^{j \\Omega}) + E(e^{j \\Omega}) $$\n",
49+
"\\begin{equation}\n",
50+
"H_Q(e^{j \\Omega}) = \\sum_{k=0}^{N-1} h[k] \\; e^{-j \\Omega k} + \\sum_{k=0}^{N-1} e[k] \\; e^{-j \\Omega k} = H(e^{j \\Omega}) + E(e^{j \\Omega})\n",
51+
"\\end{equation}\n",
4452
"\n",
4553
"Hence, the quantization of filter coefficients results in a linear distortion of the desired frequency response. To some extend this distortion can be incorporated into the design of the filter. However, the magnitude of the quantization error $| E(e^{j \\Omega}) |$ cannot get arbitrarily small for a finite quantization step $Q$. This limits the achievable attenuation of a digital filter with quantized coefficients. It is therefore important to normalize the filter coefficients $h[k]$ before quantization in order to keep the relative power of the quantization noise small."
4654
]
@@ -145,11 +153,15 @@
145153
"\n",
146154
"As outlined above, multipliers require a requantization of the result in order to keep the wordlength constant. The multiplication of a quantized signal $x_Q[k]$ with a quantized factor $a_Q$ can be written as\n",
147155
"\n",
148-
"$$ y_Q[k] = \\mathcal{Q} \\{ a_Q \\cdot x_Q[k] \\} = a_Q \\cdot x_Q[k] + e[k]$$\n",
156+
"\\begin{equation}\n",
157+
"y_Q[k] = \\mathcal{Q} \\{ a_Q \\cdot x_Q[k] \\} = a_Q \\cdot x_Q[k] + e[k]\n",
158+
"\\end{equation}\n",
149159
"\n",
150160
"where the round-off error $e[k]$ is defined as\n",
151161
"\n",
152-
"$$ e[k] = y_Q[k] - a_Q \\cdot x_Q[k] $$\n",
162+
"\\begin{equation}\n",
163+
"e[k] = y_Q[k] - a_Q \\cdot x_Q[k]\n",
164+
"\\end{equation}\n",
153165
"\n",
154166
"This leads to the following model of a multiplier including round-off effects\n",
155167
"\n",
@@ -169,7 +181,9 @@
169181
"\n",
170182
"The variance (power) of the round-off error is [derived from its PDF](../random_signals/important_distributions.ipynb#Uniform-Distribution) as\n",
171183
"\n",
172-
"$$ \\sigma_e^2 = \\frac{Q^2}{12} $$"
184+
"\\begin{equation}\n",
185+
"\\sigma_e^2 = \\frac{Q^2}{12}\n",
186+
"\\end{equation}"
173187
]
174188
},
175189
{
@@ -180,19 +194,27 @@
180194
"\n",
181195
"Using above model of a multiplier and discarding clipping, a straightforward realization of the convolution with quantized signals would be to requantize after every multiplication \n",
182196
"\n",
183-
"$$ y_Q[k] = \\sum_{\\kappa = 0}^{N-1} \\mathcal{Q} \\{ h_Q[\\kappa] \\; x_Q[k - \\kappa] \\} = \\sum_{\\kappa = 0}^{N-1} h_Q[\\kappa] \\; x_Q[k - \\kappa] + e[\\kappa]$$\n",
197+
"\\begin{equation}\n",
198+
"y_Q[k] = \\sum_{\\kappa = 0}^{N-1} \\mathcal{Q} \\{ h_Q[\\kappa] \\; x_Q[k - \\kappa] \\} = \\sum_{\\kappa = 0}^{N-1} h_Q[\\kappa] \\; x_Q[k - \\kappa] + e[\\kappa]\n",
199+
"\\end{equation}\n",
184200
"\n",
185201
"The round-off errors for each multiplication are uncorrelated to each other. The overall power of the round-off error is then given as\n",
186202
"\n",
187-
"$$ \\sigma_e^2 = N \\cdot \\frac{Q^2}{12}$$\n",
203+
"\\begin{equation}\n",
204+
"\\sigma_e^2 = N \\cdot \\frac{Q^2}{12}\n",
205+
"\\end{equation}\n",
188206
"\n",
189207
"Many digital signal processors allow to perform the multiplications and additions in an internal register with double wordlength. In this case only the result has to be requantized \n",
190208
"\n",
191-
"$$ y_Q[k] = \\mathcal{Q} \\left\\{ \\sum_{\\kappa = 0}^{N-1} h_Q[\\kappa] \\; x_Q[k - \\kappa] \\right\\}$$\n",
209+
"\\begin{equation}\n",
210+
"y_Q[k] = \\mathcal{Q} \\left\\{ \\sum_{\\kappa = 0}^{N-1} h_Q[\\kappa] \\; x_Q[k - \\kappa] \\right\\}\n",
211+
"\\end{equation}\n",
192212
"\n",
193213
"and the power of the round-off noise in this case is\n",
194214
"\n",
195-
"$$ \\sigma_e^2 = \\frac{Q^2}{12} $$\n",
215+
"\\begin{equation}\n",
216+
"\\sigma_e^2 = \\frac{Q^2}{12}\n",
217+
"\\end{equation}\n",
196218
"\n",
197219
"It is evident that this realization is favorable due to the lower round-off noise, especially for filters with a large number $N$ of coefficients."
198220
]
@@ -306,17 +328,7 @@
306328
"source": [
307329
"**Copyright**\n",
308330
"\n",
309-
"<p xmlns:dct=\"http://purl.org/dc/terms/\">\n",
310-
" <a rel=\"license\"\n",
311-
" href=\"http://creativecommons.org/publicdomain/zero/1.0/\">\n",
312-
" <img src=\"http://i.creativecommons.org/p/zero/1.0/88x31.png\" style=\"border-style: none;\" alt=\"CC0\" />\n",
313-
" </a>\n",
314-
" <br />\n",
315-
" To the extent possible under law,\n",
316-
" <span rel=\"dct:publisher\" resource=\"[_:publisher]\">the person who associated CC0</span>\n",
317-
" with this work has waived all copyright and related or neighboring\n",
318-
" rights to this work.\n",
319-
"</p>"
331+
"This notebook is provided as [Open Educational Resource](https://en.wikipedia.org/wiki/Open_educational_resources). Feel free to use the notebook for your own purposes. The text is licensed under [Creative Commons Attribution 4.0](https://creativecommons.org/licenses/by/4.0/), the code of the IPython examples under the [MIT license](https://opensource.org/licenses/MIT). Please attribute the work as follows: *Sascha Spors, Digital Signal Processing - Lecture notes featuring computational examples, 2016*."
320332
]
321333
}
322334
],

nonrecursive_filters/segmented_convolution.ipynb

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"source": [
77
"# Realization of Non-Recursive Filters\n",
88
"\n",
9-
"*This jupyter/Python notebook is part of a [collection of notebooks](../index.ipynb) in the masters module [Digital Signal Processing](http://www.int.uni-rostock.de/Digitale-Signalverarbeitung.48.0.html), Comunications Engineering, Universität Rostock. Please direct questions and suggestions to <mailto:[email protected]>.*"
9+
"*This jupyter notebook is part of a [collection of notebooks](../index.ipynb) on various topics of Digital Signal Processing. Please direct questions and suggestions to [[email protected]](mailto:[email protected]).*"
1010
]
1111
},
1212
{
@@ -28,11 +28,15 @@
2828
"\n",
2929
"The [overlap-add algorithm](https://en.wikipedia.org/wiki/Overlap%E2%80%93add_method) is based on splitting the signal $x_L[k]$ into non-overlapping segments $x_p[k]$ of length $P$\n",
3030
"\n",
31-
"$$ x_L[k] = \\sum_{p = 0}^{L/P - 1} x_p[k - p \\cdot P] $$\n",
31+
"\\begin{equation}\n",
32+
"x_L[k] = \\sum_{p = 0}^{L/P - 1} x_p[k - p \\cdot P]\n",
33+
"\\end{equation}\n",
3234
"\n",
3335
"where the segments $x_p[k]$ are defined as\n",
3436
"\n",
35-
"$$ x_p[k] = \\begin{cases} x_L[k + p \\cdot P] & \\text{ for } k=0,1,\\dots,P-1 \\\\ 0 & \\text{ otherwise} \\end{cases} $$\n",
37+
"\\begin{equation}\n",
38+
"x_p[k] = \\begin{cases} x_L[k + p \\cdot P] & \\text{ for } k=0,1,\\dots,P-1 \\\\ 0 & \\text{ otherwise} \\end{cases}\n",
39+
"\\end{equation}\n",
3640
"\n",
3741
"Note that $x_L[k]$ might have to be zero-padded so that its total length is a multiple of the segment length $P$. Introducing the segmentation of $x_L[k]$ into the convolution yields\n",
3842
"\n",
@@ -215,21 +219,27 @@
215219
"\n",
216220
"This motivates to split the input signal $x_L[k]$ into overlapping segments of length $P$ where the $p$-th segment overlaps its preceding $(p-1)$-th segment by $N-1$ samples\n",
217221
"\n",
218-
"$$ x_p[k] = \\begin{cases}\n",
222+
"\\begin{equation}\n",
223+
"x_p[k] = \\begin{cases}\n",
219224
"x_L[k + p \\cdot (P-N+1) - (N-1)] & \\text{ for } k=0,1, \\dots, P-1 \\\\\n",
220225
"0 & \\text{ otherwise}\n",
221-
"\\end{cases} $$\n",
226+
"\\end{cases}\n",
227+
"\\end{equation}\n",
222228
"\n",
223229
"The part of the circular convolution $x_p[k] \\circledast h_N[k]$ of one segment $x_p[k]$ with the impulse response $h_N[k]$ that is equal to the linear convolution of both is given as\n",
224230
"\n",
225-
"$$ y_p[k] = \\begin{cases}\n",
231+
"\\begin{equation}\n",
232+
"y_p[k] = \\begin{cases}\n",
226233
"x_p[k] \\circledast h_N[k] & \\text{ for } k=N-1, N, \\dots, P-1 \\\\\n",
227234
"0 & \\text{ otherwise}\n",
228-
"\\end{cases} $$\n",
235+
"\\end{cases}\n",
236+
"\\end{equation}\n",
229237
"\n",
230238
"The output $y[k]$ is simply the concatenation of the $y_p[k]$\n",
231239
"\n",
232-
"$$ y[k] = \\sum_{p=0}^{L/P - 1} y_p[k - p \\cdot (P-N+1) + (N-1)] $$\n",
240+
"\\begin{equation}\n",
241+
"y[k] = \\sum_{p=0}^{L/P - 1} y_p[k - p \\cdot (P-N+1) + (N-1)]\n",
242+
"\\end{equation}\n",
233243
"\n",
234244
"The overlap-save algorithm is illustrated in the following diagram\n",
235245
"\n",
@@ -419,17 +429,7 @@
419429
"source": [
420430
"**Copyright**\n",
421431
"\n",
422-
"<p xmlns:dct=\"http://purl.org/dc/terms/\">\n",
423-
" <a rel=\"license\"\n",
424-
" href=\"http://creativecommons.org/publicdomain/zero/1.0/\">\n",
425-
" <img src=\"http://i.creativecommons.org/p/zero/1.0/88x31.png\" style=\"border-style: none;\" alt=\"CC0\" />\n",
426-
" </a>\n",
427-
" <br />\n",
428-
" To the extent possible under law,\n",
429-
" <span rel=\"dct:publisher\" resource=\"[_:publisher]\">the person who associated CC0</span>\n",
430-
" with this work has waived all copyright and related or neighboring\n",
431-
" rights to this work.\n",
432-
"</p>"
432+
"This notebook is provided as [Open Educational Resource](https://en.wikipedia.org/wiki/Open_educational_resources). Feel free to use the notebook for your own purposes. The text is licensed under [Creative Commons Attribution 4.0](https://creativecommons.org/licenses/by/4.0/), the code of the IPython examples under the [MIT license](https://opensource.org/licenses/MIT). Please attribute the work as follows: *Sascha Spors, Digital Signal Processing - Lecture notes featuring computational examples, 2016*."
433433
]
434434
}
435435
],
@@ -449,7 +449,7 @@
449449
"name": "python",
450450
"nbconvert_exporter": "python",
451451
"pygments_lexer": "ipython3",
452-
"version": "3.5.0"
452+
"version": "3.5.1"
453453
}
454454
},
455455
"nbformat": 4,
0 Bytes
Loading
0 Bytes
Loading
0 Bytes
Loading

0 commit comments

Comments
 (0)