├── .gitignore ├── ADSP_01_Quantization.ipynb ├── ADSP_02_Quantization_SNR.ipynb ├── ADSP_03_Non-Uniform_Quantization.ipynb ├── ADSP_04_LloydMax.ipynb ├── ADSP_04r_PDF_Hist_Revision.ipynb ├── ADSP_05_VQ_LBG.ipynb ├── ADSP_06_Sampling.ipynb ├── ADSP_07a_The_z-Transform.ipynb ├── ADSP_07b_Filters.ipynb ├── ADSP_08_Nobel Identities.ipynb ├── ADSP_08_Nobel_Identities.ipynb ├── ADSP_09_AllPassFilters.ipynb ├── ADSP_10_FrequencyWarping.ipynb ├── ADSP_11_Complex_S_and_S.ipynb ├── ADSP_12_Wiener_Filter.ipynb ├── ADSP_13_Matched_Filters.ipynb ├── ADSP_14_Prediction.ipynb ├── README.md ├── audio ├── Iron Maiden - Aces High.mp3 ├── Iron Maiden - The Number Of The Beast.mp3 ├── Iron_Maiden_-_2_Minutes_To_Midnight.mp3 ├── fspeech.wav ├── led-zeppelin-rock-and-roll.mp3 └── the-dead-daisies_long-way-to-go.mp3 ├── binder ├── environment.yml └── postBuild └── images ├── Diagram2.drawio ├── Lecture11-1.PNG ├── Lecture14-1.JPG ├── Lecture14-2.JPG ├── Lecture14-3.jpg ├── Lecture14-4.JPG ├── Lecture6-10.PNG ├── Lecture6-11.PNG ├── Lecture6-12.PNG ├── Lecture6-6.PNG ├── Lecture6-7.PNG ├── Lecture6-8.PNG ├── Lecture6-9.PNG ├── Lecture7-2.PNG ├── Lecture7-3.PNG ├── Lecture7-6.PNG ├── Lecture8-1.PNG ├── Lecture8-2.PNG ├── Lecture8-3.PNG ├── Lecture8-4.PNG ├── Lecture8-5.PNG ├── Lecture8-6.PNG ├── Lecture8-7.PNG ├── Lecture8-8.PNG ├── Lecture9-2.PNG ├── Lecture9-3.PNG ├── adsp_logo.png ├── aliasing_components.PNG ├── companding_block.png ├── diagram.drawio ├── diagram.png ├── diagram2.png ├── fir_filter_diag.PNG ├── lecture10_allpass.jpg ├── lloyd_max.PNG ├── mu_law.png ├── mu_law_graph.png ├── pdf_a.png ├── rise_tread_quantizers.png ├── saw_tooth.png ├── sphere_dense_1.PNG ├── sphere_dense_2.PNG ├── triang.png └── voronoi.png /.gitignore: -------------------------------------------------------------------------------- 1 | 2 | .ipynb_checkpoints/ADSP_06_Sampling-checkpoint.ipynb 3 | -------------------------------------------------------------------------------- /ADSP_02_Quantization_SNR.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "markdown", 5 | "metadata": { 6 | "slideshow": { 7 | "slide_type": "slide" 8 | } 9 | }, 10 | "source": [ 11 | "

\n", 12 | " \n", 13 | "

\n", 14 | "\n", 15 | "### Prof. Dr. -Ing. Gerald Schuller
Jupyter Notebook: Renato Profeta\n" 16 | ] 17 | }, 18 | { 19 | "cell_type": "markdown", 20 | "metadata": { 21 | "slideshow": { 22 | "slide_type": "-" 23 | } 24 | }, 25 | "source": [ 26 | "# Quantization: Signal to Noise Ratio (SNR)" 27 | ] 28 | }, 29 | { 30 | "cell_type": "code", 31 | "execution_count": 1, 32 | "metadata": { 33 | "hide_input": true 34 | }, 35 | "outputs": [ 36 | { 37 | "data": { 38 | "text/html": [ 39 | "\n" 40 | ], 41 | "text/plain": [ 42 | "" 43 | ] 44 | }, 45 | "metadata": {}, 46 | "output_type": "display_data" 47 | } 48 | ], 49 | "source": [ 50 | "%%html\n", 51 | "" 52 | ] 53 | }, 54 | { 55 | "cell_type": "markdown", 56 | "metadata": { 57 | "slideshow": { 58 | "slide_type": "-" 59 | } 60 | }, 61 | "source": [ 62 | "Assume we have a A/D converter with a quantizer with a certain number of bits (say N bits), what is the resulting Signal to Noise Ratio (SNR) of this quantizer? \n", 63 | "\n", 64 | "**The SNR is defined as the ratio of the expectation of the signal power to the expectation of the noise power.** \n", 65 | "\n", 66 | "In our case, the expectation of the noise power is the expectation of the quantization error power. We already have the expectation of the quantization error power as $\\large \\dfrac{\\Delta^2}{12}$.
\n", 67 | "So what we still need for the SNR is the **average or expectation of the signal power**. How do we obtain this?
\n", 68 | "Basically we can take the same approach as we did for the expectation of the power of the quantization error (which is basically the second moment of the distribution of the quantization error). So what we need to know from our signal is its **probability distribution**. For the quantization error it was a uniform distribution between $-\\dfrac{\\Delta}{2}$ and $+\\dfrac{\\Delta}{2}$.
\n", 69 | "A very **simple case** would be a **uniformly distributed signal** with amplitude $\\dfrac{A}{2}$, which has values between $-\\dfrac{A}{2}$ up to $+\\dfrac{A}{2}$." 70 | ] 71 | }, 72 | { 73 | "cell_type": "markdown", 74 | "metadata": { 75 | "slideshow": { 76 | "slide_type": "-" 77 | } 78 | }, 79 | "source": [ 80 | "
\n", 81 | " \n", 82 | "
\n", 83 | "\n", 84 | "So we could again use our formula for the average power, but now for our signal x:\n", 85 | "\n", 86 | "$$\\large E(x^2)=\\int_ {-A/2} ^ {A/2} x^2 \\cdot p(x) dx$$\n", 87 | "\n", 88 | "So here we have the same type of signal, and the resulting expectation of the power (its second moment, assumed we have a zero mean signal) is obtained by using our previous formula, and replace $\\Delta$ by A. The resulting power is: $\\frac{A^2}{12}$.\n", 89 | "\n", 90 | "**Which signals have this property?** One example is uniformly distributed random values (basically like our quantization error). \n", 91 | "\n", 92 | "**Observe: Speech or music has a non-uniform pdf**, it is usually modeled by a Laplacian distribution or a gaussian mixture model, so it doesn't apply to this case!" 93 | ] 94 | }, 95 | { 96 | "cell_type": "code", 97 | "execution_count": 2, 98 | "metadata": { 99 | "hide_input": true 100 | }, 101 | "outputs": [ 102 | { 103 | "data": { 104 | "text/html": [ 105 | "\n" 106 | ], 107 | "text/plain": [ 108 | "" 109 | ] 110 | }, 111 | "metadata": {}, 112 | "output_type": "display_data" 113 | } 114 | ], 115 | "source": [ 116 | "%%html\n", 117 | "" 118 | ] 119 | }, 120 | { 121 | "cell_type": "markdown", 122 | "metadata": { 123 | "slideshow": { 124 | "slide_type": "-" 125 | } 126 | }, 127 | "source": [ 128 | "An example for a uniform pdf: **a triangular wave**: \n", 129 | "\n", 130 | "
\n", 131 | " \n", 132 | "
\n", 133 | "\n", 134 | "How do we obtain its pdf? One can imagine the vertical axis (the function value) covered by small intervals, and each interval is then passed in the same time-span. This means that the resulting pdf is also uniform!\n", 135 | "\n", 136 | "A further example: **A sawtooth wave**:\n", 137 | "\n", 138 | "
\n", 139 | " \n", 140 | "
\n", 141 | "\n", 142 | "Again we can make the same argument, each small interval of our function value is covered in the same time-span, hence we obtain a uniform distribution.\n", 143 | "\n", 144 | "We now have seen a few examples which fulfil our assumption of a uniform distribution (realistic examples), and we know: their expectation of their power is $\\dfrac{A^2}{12}$. So what does this then mean for the SNR? The **SNR** is just the ratio:\n", 145 | "\n", 146 | "$$ \\large SNR = \\frac {\\dfrac{A^2}{12}} {\\dfrac{\\Delta^2}{12}}= \\frac{A^2} { \\Delta^2} $$\n", 147 | "\n", 148 | "If we assume our signal is full range, meaning the maximum values of our A/D converter is $-\\dfrac{A}{2}$ and $+\\dfrac{A}{2}$ (the signal goes to the maximum), we can compute the step size $\\Delta$ if we know the **number of bits** of converter, and if we assume uniform quantization step sizes. Assume we have **N bits** in our converter. This means we have $2^N$ quantization intervals. We obtain $\\Delta$ by dividing the full range by this number,\n", 149 | "\n", 150 | "$$ \\large\n", 151 | "\\Delta = \\frac{A}{2^N}\n", 152 | "$$\n", 153 | "\n", 154 | "Plug this in the SNR equation, and we obtain:\n", 155 | "\n", 156 | "$$\n", 157 | "SNR= \\frac{A^2} { \\Delta^2}= \\frac{A^2} {\\left( \\dfrac {A}{2^N} \\right)^2} = {2^{2N}}\n", 158 | "$$\n", 159 | "\n", 160 | "This is now quite a simple result! But usually, the SNR is given in dB (deciBel), so lets convert it into dB:\n", 161 | "\n", 162 | "
\n", 163 | "$$SNR_{dB} = 10 \\cdot \\log_{10} (2^{2N})=10 \\cdot 2N \\cdot \\log_{10}(2) \\approx $$\n", 164 | "$$ \\approx 10 \\cdot 2N \\cdot 0.301 dB =N \\cdot 6.02 dB$$\n", 165 | "\n", 166 | "This is now our famous **rule of thumb**, that **each bit** more gives you about **6 dB more SNR**. But observe that the above formula only holds for uniformly distributed full range signals! (the signal is between -A/2 and +A/2, using all possible values of our converter)." 167 | ] 168 | }, 169 | { 170 | "cell_type": "code", 171 | "execution_count": 3, 172 | "metadata": { 173 | "hide_input": true 174 | }, 175 | "outputs": [ 176 | { 177 | "data": { 178 | "text/html": [ 179 | "\n" 180 | ], 181 | "text/plain": [ 182 | "" 183 | ] 184 | }, 185 | "metadata": {}, 186 | "output_type": "display_data" 187 | } 188 | ], 189 | "source": [ 190 | "%%html\n", 191 | "" 192 | ] 193 | }, 194 | { 195 | "cell_type": "markdown", 196 | "metadata": { 197 | "slideshow": { 198 | "slide_type": "subslide" 199 | } 200 | }, 201 | "source": [ 202 | "What happens if the signal is not full range? What is the SNR if we have a signal with reduced range? Assume our signal has an amplitude of A/c, with a factor c>1.
\n", 203 | "We can then simply plug this into our equation:\n", 204 | "\n", 205 | "$$ \\large SNR= \\frac{\\left(\\frac{A}{c}\\right)^2} {\\Delta^2}= \\frac{\\left(\\frac{A}{c}\\right)^2 }{ \\left(\\frac{A}{2^N}\\right)^2} = \\frac{2^{2N}}{c^2}$$\n", 206 | "\n", 207 | "in dB:\n", 208 | "\n", 209 | "$$ \\large SNR_{dB}=10 . \\log_{10}( \\frac {2^{2N}} {c^2})=10\\cdot2N.\\log_{10}(2)-20.\\log_{10}(c) \\approx $$\n", 210 | "\n", 211 | "$$ \\large\n", 212 | " \\approx 10 \\cdot 2N \\cdot 0.301 dB -20 \\cdot \\log_{10}(c) =\n", 213 | "$$\n", 214 | "
\n", 215 | "$$ \\large\n", 216 | " =N \\cdot 6.02 dB -20 \\cdot log_{10}(c)\n", 217 | "$$\n", 218 | "
\n", 219 | "\n", 220 | "The last term, the $20 \\cdot \\log_{10}(c) $, is the number of dB which we are below our full range. This means we **reduce our SNR** by this number of **dB** which we are **below full range**! \n", 221 | "

\n", 222 | "**Example:** We have a 16 bit quantiser, then the SNR for uniformly distributed full range signals would be:\n", 223 | "\n", 224 | "\n", 225 | "$$SNR = 6.02 \\cdot 16 dB = 96.32 dB$$\n", 226 | "\n", 227 | "Now assume we have the same signal, but 20dB below full range (meaning only 1/10th of the full range). Then the resulting SNR would be only:\n", 228 | "\n", 229 | "$$SNR = 96.32-20 = 76.32 dB$$ \n", 230 | "\n", 231 | "This is considerably less. This also shows why it is important not to make the safety margin to full range too big! So for instance our sound engineer should keep the signal as big as possible, without ever reaching full range to avoid clipping the signal. " 232 | ] 233 | }, 234 | { 235 | "cell_type": "markdown", 236 | "metadata": { 237 | "slideshow": { 238 | "slide_type": "slide" 239 | } 240 | }, 241 | "source": [ 242 | "The other assumption we made concerned the type of signal we quantize. \n", 243 | "\n", 244 | "**What if we don't have a uniformly distributed signal?** \n", 245 | "\n", 246 | "As we saw, speech and audio signals are best modelled by a Laplacian distribution or a Gaussian mixture model, and similar for audio signals. Even a simple sine wave does not fulfil this assumption of a uniform distribution. What is the pdf of a simple sine wave?\n", 247 | "\n", 248 | "**Observe:** If a sinusoid represents a full range signal, its values are from $-A/2$ to $+A/2$, as in the previous cases." 249 | ] 250 | }, 251 | { 252 | "cell_type": "code", 253 | "execution_count": 4, 254 | "metadata": { 255 | "hide_input": true 256 | }, 257 | "outputs": [ 258 | { 259 | "data": { 260 | "text/html": [ 261 | "\n" 262 | ], 263 | "text/plain": [ 264 | "" 265 | ] 266 | }, 267 | "metadata": {}, 268 | "output_type": "display_data" 269 | } 270 | ], 271 | "source": [ 272 | "%%html\n", 273 | "" 274 | ] 275 | }, 276 | { 277 | "cell_type": "markdown", 278 | "metadata": { 279 | "slideshow": { 280 | "slide_type": "-" 281 | } 282 | }, 283 | "source": [ 284 | "What is our SNR if we have a sinusoidal signal? What is its pdf? Basically it is its normalized histogram, such that its integral becomes 1, to obtain a probability distribution.\n", 285 | "\n", 286 | "If we look at the signal, and try to see how probable it is for the signal to be in a certain small interval on the y axis, we see that the signal stays longest around +1 and -1, because there the signal slowly turns around. Hence we would expect a pdf, which has peaks at +1 and -1.
\n", 287 | "If you calculate the pdf of a sine wave, x=sin(t), with t being continuous and with a range larger than 2pi, then the result is\n", 288 | "
\n", 289 | "$$\n", 290 | "p(x)=\\frac{1} {\\pi \\cdot \\sqrt{1-x^2}}\n", 291 | "$$\n", 292 | "
\n", 293 | "This results from the derivative of the inverse sine function (arcsin). This derivation can be found for instance on Wikipedia. For our pdf we need to know how fast a signal x passes through a given bin in x. This is what we obtain if we compute the inverse function $x=f^{-1}(y)$, and then its derivative $df^{-1}(x)/dy$." 294 | ] 295 | }, 296 | { 297 | "cell_type": "markdown", 298 | "metadata": { 299 | "slideshow": { 300 | "slide_type": "subslide" 301 | } 302 | }, 303 | "source": [ 304 | "### PDF of Time Series\n" 305 | ] 306 | }, 307 | { 308 | "cell_type": "markdown", 309 | "metadata": { 310 | "slideshow": { 311 | "slide_type": "-" 312 | } 313 | }, 314 | "source": [ 315 | "Given a signal a = f (t) which is sampled uniformly over a time period T , its PDF, p(a) can be calculated as follows. Because the signal is uniformly sampled we have $p(t) = \\frac{1}{T}$ . The function f(t) acts to transform this density from one over *t* to one over *a*. Hence, using the method for transforming PDFs, we get:\n", 316 | "\n", 317 | "$$\\large\n", 318 | "p(a)=\\dfrac{p(t)}{\\left|\\frac {da}{dt} \\right|} $$\n", 319 | "\n", 320 | "where | | denotes the absolute value and the derivative is evaluated at $t=f^{-1}(x).$\n", 321 | " \n", 322 | "From: https://www.fil.ion.ucl.ac.uk/~wpenny/course/appendixDE.pdf\n", 323 | "" 324 | ] 325 | }, 326 | { 327 | "cell_type": "code", 328 | "execution_count": 5, 329 | "metadata": { 330 | "slideshow": { 331 | "slide_type": "-" 332 | } 333 | }, 334 | "outputs": [ 335 | { 336 | "data": { 337 | "text/latex": [ 338 | "$\\displaystyle x = \\sin{\\left(t \\right)}$" 339 | ], 340 | "text/plain": [ 341 | "Eq(x, sin(t))" 342 | ] 343 | }, 344 | "execution_count": 5, 345 | "metadata": {}, 346 | "output_type": "execute_result" 347 | } 348 | ], 349 | "source": [ 350 | "from sympy import symbols, pi, sqrt, Integral, Function, Eq, diff, sin, solve, simplify, Abs\n", 351 | "x, t = symbols('x t', real=True)\n", 352 | "A, w = symbols('A w', real=True, positive=True)\n", 353 | "Eq_x=Eq(x, sin(t))\n", 354 | "Eq_x" 355 | ] 356 | }, 357 | { 358 | "cell_type": "code", 359 | "execution_count": 6, 360 | "metadata": { 361 | "slideshow": { 362 | "slide_type": "-" 363 | } 364 | }, 365 | "outputs": [ 366 | { 367 | "data": { 368 | "text/latex": [ 369 | "$\\displaystyle t = \\operatorname{asin}{\\left(x \\right)}$" 370 | ], 371 | "text/plain": [ 372 | "Eq(t, asin(x))" 373 | ] 374 | }, 375 | "execution_count": 6, 376 | "metadata": {}, 377 | "output_type": "execute_result" 378 | } 379 | ], 380 | "source": [ 381 | "# Find the Inverse\n", 382 | "y=solve(Eq_x,t)\n", 383 | "Eq_y=Eq(t,y[1])\n", 384 | "Eq_y" 385 | ] 386 | }, 387 | { 388 | "cell_type": "markdown", 389 | "metadata": { 390 | "slideshow": { 391 | "slide_type": "-" 392 | } 393 | }, 394 | "source": [ 395 | "The inverse sine is only defined for $-\\frac{\\pi}{2} \\leq t \\leq +\\frac{\\pi}{2}$ and p(t) is uniform within this. \n", 396 | "Hence, $ p(t) = \\frac {1}{\\pi} $." 397 | ] 398 | }, 399 | { 400 | "cell_type": "code", 401 | "execution_count": 7, 402 | "metadata": { 403 | "slideshow": { 404 | "slide_type": "-" 405 | } 406 | }, 407 | "outputs": [ 408 | { 409 | "data": { 410 | "text/latex": [ 411 | "$\\displaystyle \\sqrt{1 - x^{2}}$" 412 | ], 413 | "text/plain": [ 414 | "sqrt(1 - x**2)" 415 | ] 416 | }, 417 | "execution_count": 7, 418 | "metadata": {}, 419 | "output_type": "execute_result" 420 | } 421 | ], 422 | "source": [ 423 | "# Find dx\\dt and evaluate at t=arsin(x)\n", 424 | "\n", 425 | "dxdt = (diff(Eq_x.rhs,t))\n", 426 | "dxdt = dxdt.subs(t,Eq_y.rhs)\n", 427 | "dxdt" 428 | ] 429 | }, 430 | { 431 | "cell_type": "code", 432 | "execution_count": 8, 433 | "metadata": { 434 | "slideshow": { 435 | "slide_type": "-" 436 | } 437 | }, 438 | "outputs": [ 439 | { 440 | "data": { 441 | "text/latex": [ 442 | "$\\displaystyle p{\\left(t \\right)} = \\begin{cases} \\frac{1}{\\pi} & \\text{for}\\: t \\geq - \\frac{\\pi}{2} \\wedge t \\leq \\frac{\\pi}{2} \\\\0 & \\text{otherwise} \\end{cases}$" 443 | ], 444 | "text/plain": [ 445 | "Eq(p(t), Piecewise((1/pi, (t >= -pi/2) & (t <= pi/2)), (0, True)))" 446 | ] 447 | }, 448 | "execution_count": 8, 449 | "metadata": {}, 450 | "output_type": "execute_result" 451 | } 452 | ], 453 | "source": [ 454 | "# Calculate p(t)\n", 455 | "from sympy.stats import Uniform, density\n", 456 | "P_t = Function('p')(t)\n", 457 | "p_t = Uniform('X',-pi/2,pi/2)\n", 458 | "Eq_p_t=Eq(P_t,density(p_t)(t))\n", 459 | "Eq_p_t" 460 | ] 461 | }, 462 | { 463 | "cell_type": "code", 464 | "execution_count": 9, 465 | "metadata": { 466 | "slideshow": { 467 | "slide_type": "-" 468 | } 469 | }, 470 | "outputs": [ 471 | { 472 | "data": { 473 | "text/latex": [ 474 | "$\\displaystyle p{\\left(x \\right)} = \\frac{1}{\\pi \\sqrt{1 - x^{2}}}$" 475 | ], 476 | "text/plain": [ 477 | "Eq(p(x), 1/(pi*sqrt(1 - x**2)))" 478 | ] 479 | }, 480 | "execution_count": 9, 481 | "metadata": {}, 482 | "output_type": "execute_result" 483 | } 484 | ], 485 | "source": [ 486 | "# Calculate p(x)\n", 487 | "p_x = Function('p')(x)\n", 488 | "Eq_p_x= Eq(p_x,(1/pi)/dxdt)\n", 489 | "Eq_p_x" 490 | ] 491 | }, 492 | { 493 | "cell_type": "code", 494 | "execution_count": 10, 495 | "metadata": { 496 | "hide_input": true 497 | }, 498 | "outputs": [ 499 | { 500 | "data": { 501 | "text/html": [ 502 | "\n" 503 | ], 504 | "text/plain": [ 505 | "" 506 | ] 507 | }, 508 | "metadata": {}, 509 | "output_type": "display_data" 510 | } 511 | ], 512 | "source": [ 513 | "%%html\n", 514 | "" 515 | ] 516 | }, 517 | { 518 | "cell_type": "markdown", 519 | "metadata": { 520 | "slideshow": { 521 | "slide_type": "-" 522 | } 523 | }, 524 | "source": [ 525 | "Here we can see that p(x) indeed becomes infinite at x=+/-1! We could now use the same approach as before to obtain the expectation of the power, multiplying it with $x^2$ and integrating it. But this seems to be somewhat tedious. But since we now have a deterministic signal, we can also try an **alternative** solution, since the sine function is not a probabilistic function, but a deterministic function.\n", 526 | "\n", 527 | "We can simply directly compute the power of our sine signal over t, and then take the average over at least one period of the sine function.\n", 528 | "\n", 529 | "$$ \\large\n", 530 | "E(x^2)= \\frac{1} {2\\pi}\\int _ {t=0} ^{2\\pi} sin^2(t) dt = \\frac{1} {2\\pi}\\int _ {t=0} ^{2\\pi} {\\dfrac{\\left(1-cos(2t)\\right)}{2}}dt\n", 531 | "$$\n", 532 | "\n", 533 | "Trigonometric Identity: $cos(2x)=1-2sin^2(x)$\n", 534 | "\n", 535 | "The cosine integrated over complete periods becomes 0, hence we get:\n", 536 | "\n", 537 | "$$ n\\large\n", 538 | "=\\frac{1} {2\\pi} \\int _{t=0}^{2\\pi} {\\dfrac{1}{2}} dt =\\frac{1} {2\\pi} \\cdot \\pi=\\frac{1}{ 2}\n", 539 | "$$\n" 540 | ] 541 | }, 542 | { 543 | "cell_type": "code", 544 | "execution_count": 11, 545 | "metadata": { 546 | "slideshow": { 547 | "slide_type": "-" 548 | } 549 | }, 550 | "outputs": [ 551 | { 552 | "data": { 553 | "text/latex": [ 554 | "$\\displaystyle E{\\left(x^{2} \\right)} = \\int\\limits_{-1}^{1} \\frac{x^{2}}{\\pi \\sqrt{1 - x^{2}}}\\, dx$" 555 | ], 556 | "text/plain": [ 557 | "Eq(E(x**2), Integral(x**2/(pi*sqrt(1 - x**2)), (x, -1, 1)))" 558 | ] 559 | }, 560 | "metadata": {}, 561 | "output_type": "display_data" 562 | }, 563 | { 564 | "data": { 565 | "text/latex": [ 566 | "$\\displaystyle E{\\left(x^{2} \\right)} = \\frac{1}{2}$" 567 | ], 568 | "text/plain": [ 569 | "Eq(E(x**2), 1/2)" 570 | ] 571 | }, 572 | "metadata": {}, 573 | "output_type": "display_data" 574 | } 575 | ], 576 | "source": [ 577 | "# Calculate the Expctation of Power\n", 578 | "E = Function('E')(x**2)\n", 579 | "E_x2 = Eq(E,Integral(x**2*Eq_p_x.rhs,(x,-1,1)))\n", 580 | "display(E_x2)\n", 581 | "display(E_x2.doit())" 582 | ] 583 | }, 584 | { 585 | "cell_type": "markdown", 586 | "metadata": { 587 | "slideshow": { 588 | "slide_type": "-" 589 | } 590 | }, 591 | "source": [ 592 | "What do we get for a sinusoid with a different amplitude, say $A/2 \\cdot sin(t)$?\n", 593 | "\n", 594 | "The expected power is:\n", 595 | "\n", 596 | "$$ \\large\n", 597 | "E(x^2)=\\frac{A^2}{ 8}\n", 598 | "$$" 599 | ] 600 | }, 601 | { 602 | "cell_type": "code", 603 | "execution_count": 12, 604 | "metadata": { 605 | "slideshow": { 606 | "slide_type": "-" 607 | } 608 | }, 609 | "outputs": [ 610 | { 611 | "data": { 612 | "text/latex": [ 613 | "$\\displaystyle E{\\left(x^{2} \\right)} = \\frac{\\int\\limits_{0}^{2 \\pi} \\frac{A^{2} \\sin^{2}{\\left(t \\right)}}{4}\\, dt}{2 \\pi}$" 614 | ], 615 | "text/plain": [ 616 | "Eq(E(x**2), Integral(A**2*sin(t)**2/4, (t, 0, 2*pi))/(2*pi))" 617 | ] 618 | }, 619 | "metadata": {}, 620 | "output_type": "display_data" 621 | }, 622 | { 623 | "data": { 624 | "text/latex": [ 625 | "$\\displaystyle E{\\left(x^{2} \\right)} = \\frac{A^{2}}{8}$" 626 | ], 627 | "text/plain": [ 628 | "Eq(E(x**2), A**2/8)" 629 | ] 630 | }, 631 | "metadata": {}, 632 | "output_type": "display_data" 633 | } 634 | ], 635 | "source": [ 636 | "# Calculate Expectation of Power of A/2 * sin(t)\n", 637 | "E = Function('E')(x**2)\n", 638 | "E_x2 = Eq(E,(1/(2*pi))*Integral(((A/2)*sin(t))**2,(t,0,2*pi)))\n", 639 | "display(E_x2)\n", 640 | "display(E_x2.doit())" 641 | ] 642 | }, 643 | { 644 | "cell_type": "markdown", 645 | "metadata": { 646 | "slideshow": { 647 | "slide_type": "-" 648 | } 649 | }, 650 | "source": [ 651 | "So this leads to an SNR of:\n", 652 | "\n", 653 | "$$ \\large\n", 654 | "SNR=\\frac{\\frac{A^2}{8}} {\\frac{\\Delta^2}{12}}=\\frac{3 \\cdot A^2} {2 \\cdot \\Delta^2}\n", 655 | "$$\n", 656 | "\n", 657 | "Now assume again we have a A/D converter with N bits, and the sinusoid is at full range for this converter. Then \n", 658 | "$A=2^N \\cdot \\Delta$\n", 659 | "\n", 660 | "We can plug in this result into the above equation, and get\n", 661 | "\n", 662 | "$$ \\large\n", 663 | "SNR=\\frac{3 \\cdot 2^{2N} \\cdot \\Delta^2} {2 \\cdot \\Delta^2}={1.5 \\cdot 2^{2N}} $$\n", 664 | "\n", 665 | "In dB this will now be:\n", 666 | "\n", 667 | "$$\\large 10 \\cdot \\log_{10}(SNR)=10 \\cdot \\log_{10}(1.5) + N \\cdot 20 \\cdot \\log_{10}(2)=\n", 668 | "$$\n", 669 | "\n", 670 | "$$\\large = 1.76 dB +N \\cdot 6.02 dB$$\n", 671 | "\n", 672 | "\n", 673 | "Here we can see now, that using a sinusoidal signal instead of a uniformly distributed signal gives us a **boost of 1.76 dB** in SNR. This is because it is more likely to have larger values!\n", 674 | "We see that our rule of 6dB more SNR for each bit still holds!" 675 | ] 676 | }, 677 | { 678 | "cell_type": "code", 679 | "execution_count": 13, 680 | "metadata": { 681 | "slideshow": { 682 | "slide_type": "-" 683 | } 684 | }, 685 | "outputs": [ 686 | { 687 | "data": { 688 | "text/latex": [ 689 | "$\\displaystyle \\Delta = 2^{- N} A$" 690 | ], 691 | "text/plain": [ 692 | "Eq(\\Delta, 2**(-N)*A)" 693 | ] 694 | }, 695 | "metadata": {}, 696 | "output_type": "display_data" 697 | }, 698 | { 699 | "data": { 700 | "text/latex": [ 701 | "$\\displaystyle A = 2^{N} \\Delta$" 702 | ], 703 | "text/plain": [ 704 | "Eq(A, 2**N*\\Delta)" 705 | ] 706 | }, 707 | "metadata": {}, 708 | "output_type": "display_data" 709 | } 710 | ], 711 | "source": [ 712 | "# Stepsize as function of full range\n", 713 | "delta, N = symbols('\\Delta N')\n", 714 | "Eq_delta = Eq(delta, A/(2**N) )\n", 715 | "display(Eq_delta)\n", 716 | "Eq_A = Eq(A,solve(Eq_delta,A)[0])\n", 717 | "display(Eq_A)" 718 | ] 719 | }, 720 | { 721 | "cell_type": "code", 722 | "execution_count": 14, 723 | "metadata": { 724 | "slideshow": { 725 | "slide_type": "-" 726 | } 727 | }, 728 | "outputs": [ 729 | { 730 | "data": { 731 | "text/latex": [ 732 | "$\\displaystyle \\frac{3 A^{2}}{2 \\Delta^{2}}$" 733 | ], 734 | "text/plain": [ 735 | "3*A**2/(2*\\Delta**2)" 736 | ] 737 | }, 738 | "metadata": {}, 739 | "output_type": "display_data" 740 | }, 741 | { 742 | "data": { 743 | "text/latex": [ 744 | "$\\displaystyle \\frac{3 \\cdot 2^{2 N}}{2}$" 745 | ], 746 | "text/plain": [ 747 | "3*2**(2*N)/2" 748 | ] 749 | }, 750 | "metadata": {}, 751 | "output_type": "display_data" 752 | } 753 | ], 754 | "source": [ 755 | "# Calculate Signal to Noise Rate\n", 756 | "SNR = E_x2.doit().rhs / (delta**2/12)\n", 757 | "display(SNR)\n", 758 | "display(SNR.subs(A,Eq_A.rhs))" 759 | ] 760 | } 761 | ], 762 | "metadata": { 763 | "kernelspec": { 764 | "display_name": "Python 3", 765 | "language": "python", 766 | "name": "python3" 767 | }, 768 | "language_info": { 769 | "codemirror_mode": { 770 | "name": "ipython", 771 | "version": 3 772 | }, 773 | "file_extension": ".py", 774 | "mimetype": "text/x-python", 775 | "name": "python", 776 | "nbconvert_exporter": "python", 777 | "pygments_lexer": "ipython3", 778 | "version": "3.7.5" 779 | }, 780 | "livereveal": { 781 | "rise": { 782 | "height": "90%", 783 | "width": "90%" 784 | }, 785 | "scroll": true, 786 | "theme": "sky", 787 | "transition": "zoom" 788 | }, 789 | "widgets": { 790 | "application/vnd.jupyter.widget-state+json": { 791 | "state": {}, 792 | "version_major": 2, 793 | "version_minor": 0 794 | } 795 | } 796 | }, 797 | "nbformat": 4, 798 | "nbformat_minor": 2 799 | } 800 | -------------------------------------------------------------------------------- /ADSP_04_LloydMax.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "markdown", 5 | "metadata": { 6 | "slideshow": { 7 | "slide_type": "slide" 8 | } 9 | }, 10 | "source": [ 11 | "
\n", 12 | " \n", 13 | "
\n", 14 | "\n", 15 | "### Prof. Dr. -Ing. Gerald Schuller
Jupyter Notebook: Renato Profeta\n" 16 | ] 17 | }, 18 | { 19 | "cell_type": "markdown", 20 | "metadata": { 21 | "slideshow": { 22 | "slide_type": "-" 23 | } 24 | }, 25 | "source": [ 26 | "# Lloyd-Max Quantizer" 27 | ] 28 | }, 29 | { 30 | "cell_type": "code", 31 | "execution_count": 1, 32 | "metadata": { 33 | "hide_input": true 34 | }, 35 | "outputs": [ 36 | { 37 | "data": { 38 | "text/html": [ 39 | "\n" 40 | ], 41 | "text/plain": [ 42 | "" 43 | ] 44 | }, 45 | "metadata": {}, 46 | "output_type": "display_data" 47 | } 48 | ], 49 | "source": [ 50 | "%%html\n", 51 | "" 52 | ] 53 | }, 54 | { 55 | "cell_type": "markdown", 56 | "metadata": { 57 | "slideshow": { 58 | "slide_type": "-" 59 | } 60 | }, 61 | "source": [ 62 | "**Idea:** Wouldn't it be helpful if we choose our **quantization steps smaller** where **signal samples appear most often**, to reduce the quantization error there, and make the quantization step size (and also the error) larger, where there are only a few samples?\n", 63 | "\n", 64 | "This is the idea behind the Lloyd-Max quantizer (see also the Book: N.S. Jayant, P. Noll: “Digital coding of waveforms“).\n", 65 | "\n", 66 | "**Observe** that this is not quite the same as for $\\mu$-law companding. There, the **small** values get the smallest quantization step sizes, here, the **most likely** values get the smallest quantization steps sizes.\n", 67 | "\n", 68 | "This is a type of non-uniform quantizer, which is adapted to the signals pdf. It basically minimizes the expectation of the quanization power (the expectaion of the squared signal, or its second moment), given the pdf of the signal to quantize." 69 | ] 70 | }, 71 | { 72 | "cell_type": "code", 73 | "execution_count": 2, 74 | "metadata": { 75 | "hide_input": true 76 | }, 77 | "outputs": [ 78 | { 79 | "data": { 80 | "text/html": [ 81 | "\n" 82 | ], 83 | "text/plain": [ 84 | "" 85 | ] 86 | }, 87 | "metadata": {}, 88 | "output_type": "display_data" 89 | } 90 | ], 91 | "source": [ 92 | "%%html\n", 93 | "" 94 | ] 95 | }, 96 | { 97 | "cell_type": "markdown", 98 | "metadata": { 99 | "slideshow": { 100 | "slide_type": "-" 101 | } 102 | }, 103 | "source": [ 104 | "Let's call our Quantisation function Q(x) (this is quantization followed by reverse quantization). You can also think of non-uniform quantization as first applying this non-linear function and then to use uniform quantization. Then the expectation of our quantization power is:\n", 105 | "\n", 106 | "$$\n", 107 | "D=E((x-Q(x))^2)\n", 108 | "$$\n", 109 | "\n", 110 | "Observe that we use the square here, and not for instance the magnitude of the error, because the square leads to an easier solution for minimum, which we would like to find.\n", 111 | "\n", 112 | "Our **goal** is to **minimize this expectation** of the quantisation error power D.\n", 113 | "Starting with the pdf of our signal, the result should be our quantisation intervals and reconstruction values. Since we now assume non-uniform intervals, we need to give those intervals and their reconstruction values names, which can be see in the following graphic:\n", 114 | "\n", 115 | "
\n", 116 | " \n", 117 | "
" 118 | ] 119 | }, 120 | { 121 | "cell_type": "code", 122 | "execution_count": 3, 123 | "metadata": { 124 | "hide_input": true 125 | }, 126 | "outputs": [ 127 | { 128 | "data": { 129 | "text/html": [ 130 | "\n" 131 | ], 132 | "text/plain": [ 133 | "" 134 | ] 135 | }, 136 | "metadata": {}, 137 | "output_type": "display_data" 138 | } 139 | ], 140 | "source": [ 141 | "%%html\n", 142 | "" 143 | ] 144 | }, 145 | { 146 | "cell_type": "markdown", 147 | "metadata": { 148 | "slideshow": { 149 | "slide_type": "-" 150 | } 151 | }, 152 | "source": [ 153 | "The encoder knows the $b_k$, and decides in which interval (what we called $\\Delta$ before) the sample lies, and assigns the interval index k to it, as before (remember: only the index k is transmitted to the decoder). The decoder takes this index, and assigns the reconstructed value $y_k$ to it, also as before.\n", 154 | "\n", 155 | "\n", 156 | "We call $b_k$ the decision boundaries, in the A/D converter or encoder (each interval gets an index as before), and on the decoding side we have the $y_k$ as the reconstruction values for each index from the encoding side.
\n", 157 | "In the multidimensional case, they are also called a “**codeword**”. \n", 158 | "\n", 159 | "So using these definitions, and the pdf our the measured **probability distribution** of our signal p(x), we can re-write our equation for the error power or distortion:\n", 160 | "\n", 161 | "$$ \\large\n", 162 | "D=E((x-Q(x))^2)=\\int_{-\\infty} ^ \\infty (x-Q(x))^2 p(x) dx\n", 163 | "$$\n", 164 | "\n", 165 | "we can now subdivide the integral over the quantisation intervals, assuming we have M quantization intervals, by just adding the quantization error power of all the quantisation intervals (see also: Wikipedia: quantization (signal processing)):\n", 166 | "\n", 167 | "$$ \\large\n", 168 | "D=\\sum _ {k=1} ^ {M }\\int _ {b_{k-1}} ^ {b_k} (x-y_k)^2 p(x) dx$$\n", 169 | "\n", 170 | "We would now like to have the minimum of this expression for the decision boundaries $b_k$ and the reconstruction values $y_k$. Hence we need to take the first derivative of the distortion D with respect to those variables and obtain the zero point." 171 | ] 172 | }, 173 | { 174 | "cell_type": "code", 175 | "execution_count": 4, 176 | "metadata": { 177 | "hide_input": true 178 | }, 179 | "outputs": [ 180 | { 181 | "data": { 182 | "text/html": [ 183 | "\n" 184 | ], 185 | "text/plain": [ 186 | "" 187 | ] 188 | }, 189 | "metadata": {}, 190 | "output_type": "display_data" 191 | } 192 | ], 193 | "source": [ 194 | "%%html\n", 195 | "" 196 | ] 197 | }, 198 | { 199 | "cell_type": "markdown", 200 | "metadata": { 201 | "slideshow": { 202 | "slide_type": "-" 203 | } 204 | }, 205 | "source": [ 206 | "Lets start with the decision boundaries $b_k$:\n", 207 | "\n", 208 | "$$\\large\n", 209 | "\\frac{\\partial D} {\\partial {b_k}}=0$$\n", 210 | "\n", 211 | "To obtain this derivative, we could first solve the integral, over 2 neighbouring quantisation intervals, because each decision interval $b_k$ appears in two intervals (one where it is the upper boundary, and one where it it the lower boundary).\n", 212 | "\n", 213 | "$$ \\large\n", 214 | "D_k=\\int _ {b_k }^ {b_{k+1}} (x-y_{k+1})^2 p(x) dx+ \\int _ {b_{k-1}} ^ {b_{k}} (x-y_{k})^2 p(x) dx\n", 215 | "$$\n", 216 | "\n", 217 | "Here we cannot really get a closed form solution for a general probability function p(x). Hence, to simplify matters, we make the **assumption** that p(x) is **approximately constant** over our 2 neighbouring quantisation intervals. This means we assume that our quantisation intervals are small in comparison with the changes of p(x)! \n", 218 | "\n", 219 | "**We need to keep this assumption in mind, because the derived algorithm is based on this assumption!**\n", 220 | "\n", 221 | "Hence we can set:\n", 222 | "\n", 223 | "$$p(x)=p$$\n", 224 | "\n", 225 | "Using this simplification we can now solve this integral:\n", 226 | "\n", 227 | "$$ \\large\n", 228 | "\\frac{D_k} {p}= \\frac{(b_k-y_k)^3}{ 3} - \\frac{(b_{k-1}-y_k)^3} {3 }+ \\frac{(b_{k+1}-y_{k+1})^3} { 3} -\\frac{(b_{k}-y_{k+1})^3} {3} $$" 229 | ] 230 | }, 231 | { 232 | "cell_type": "markdown", 233 | "metadata": { 234 | "slideshow": { 235 | "slide_type": "subslide" 236 | } 237 | }, 238 | "source": [ 239 | "#### Solving using Sympy" 240 | ] 241 | }, 242 | { 243 | "cell_type": "code", 244 | "execution_count": 5, 245 | "metadata": { 246 | "slideshow": { 247 | "slide_type": "-" 248 | } 249 | }, 250 | "outputs": [], 251 | "source": [ 252 | "# Imports \n", 253 | "from sympy import Eq, symbols, Integral, Derivative, simplify, solve\n", 254 | "\n", 255 | "# Define Symbols\n", 256 | "x, yk, yk1, bk, bkp1, bkm1, p = symbols('x y_k y_{k+1} b_k b_{k+1} b_{k-1} p', real=True)" 257 | ] 258 | }, 259 | { 260 | "cell_type": "code", 261 | "execution_count": 6, 262 | "metadata": { 263 | "slideshow": { 264 | "slide_type": "-" 265 | } 266 | }, 267 | "outputs": [ 268 | { 269 | "data": { 270 | "text/latex": [ 271 | "$\\displaystyle \\int\\limits_{b_{k-1}}^{b_{k}} p \\left(x - y_{k}\\right)^{2}\\, dx + \\int\\limits_{b_{k}}^{b_{k+1}} p \\left(x - y_{k+1}\\right)^{2}\\, dx$" 272 | ], 273 | "text/plain": [ 274 | "Integral(p*(x - y_k)**2, (x, b_{k-1}, b_k)) + Integral(p*(x - y_{k+1})**2, (x, b_k, b_{k+1}))" 275 | ] 276 | }, 277 | "metadata": {}, 278 | "output_type": "display_data" 279 | }, 280 | { 281 | "data": { 282 | "text/latex": [ 283 | "$\\displaystyle \\frac{p \\left(- 3 b_{k}^{2} y_{k} + 3 b_{k}^{2} y_{k+1} + 3 b_{k} y_{k}^{2} - 3 b_{k} y_{k+1}^{2} + b_{k+1}^{3} - 3 b_{k+1}^{2} y_{k+1} + 3 b_{k+1} y_{k+1}^{2} - b_{k-1}^{3} + 3 b_{k-1}^{2} y_{k} - 3 b_{k-1} y_{k}^{2}\\right)}{3}$" 284 | ], 285 | "text/plain": [ 286 | "p*(-3*b_k**2*y_k + 3*b_k**2*y_{k+1} + 3*b_k*y_k**2 - 3*b_k*y_{k+1}**2 + b_{k+1}**3 - 3*b_{k+1}**2*y_{k+1} + 3*b_{k+1}*y_{k+1}**2 - b_{k-1}**3 + 3*b_{k-1}**2*y_k - 3*b_{k-1}*y_k**2)/3" 287 | ] 288 | }, 289 | "execution_count": 6, 290 | "metadata": {}, 291 | "output_type": "execute_result" 292 | } 293 | ], 294 | "source": [ 295 | "# Dk Integral\n", 296 | "Dk = Integral((x-yk1)**2*p,(x,bk,bkp1)) + Integral((x-yk)**2*p,(x,bkm1,bk))\n", 297 | "display(Dk)\n", 298 | "simplify(Dk.doit())" 299 | ] 300 | }, 301 | { 302 | "cell_type": "markdown", 303 | "metadata": { 304 | "slideshow": { 305 | "slide_type": "-" 306 | } 307 | }, 308 | "source": [ 309 | "Since we now have a closed form solution, we can easily take the derivative with respect to $b_k$ (which only influences $D_k$ in $D$, hence we can drop the k in the derivative):\n", 310 | "\n", 311 | "$$ \\large\n", 312 | "\\frac{\\partial D/p} {\\partial {b_k}} = (b_k -y_k)^2 -(b_k -y_{k+1})^2$$" 313 | ] 314 | }, 315 | { 316 | "cell_type": "code", 317 | "execution_count": 7, 318 | "metadata": { 319 | "slideshow": { 320 | "slide_type": "-" 321 | } 322 | }, 323 | "outputs": [ 324 | { 325 | "data": { 326 | "text/latex": [ 327 | "$\\displaystyle \\frac{\\partial}{\\partial b_{k}} \\frac{\\int\\limits_{b_{k-1}}^{b_{k}} p \\left(x - y_{k}\\right)^{2}\\, dx + \\int\\limits_{b_{k}}^{b_{k+1}} p \\left(x - y_{k+1}\\right)^{2}\\, dx}{p}$" 328 | ], 329 | "text/plain": [ 330 | "Derivative((Integral(p*(x - y_k)**2, (x, b_{k-1}, b_k)) + Integral(p*(x - y_{k+1})**2, (x, b_k, b_{k+1})))/p, b_k)" 331 | ] 332 | }, 333 | "metadata": {}, 334 | "output_type": "display_data" 335 | }, 336 | { 337 | "data": { 338 | "text/latex": [ 339 | "$\\displaystyle - 2 b_{k} y_{k} + 2 b_{k} y_{k+1} + y_{k}^{2} - y_{k+1}^{2}$" 340 | ], 341 | "text/plain": [ 342 | "-2*b_k*y_k + 2*b_k*y_{k+1} + y_k**2 - y_{k+1}**2" 343 | ] 344 | }, 345 | "execution_count": 7, 346 | "metadata": {}, 347 | "output_type": "execute_result" 348 | } 349 | ], 350 | "source": [ 351 | "display(Derivative(Dk/p,bk))\n", 352 | "simplify(Derivative(Dk/p,bk).doit())" 353 | ] 354 | }, 355 | { 356 | "cell_type": "markdown", 357 | "metadata": { 358 | "slideshow": { 359 | "slide_type": "-" 360 | } 361 | }, 362 | "source": [ 363 | "We can set this then to zero, and observing that $y_{k+1}>b_k$ (see above image), we can take the positive square root of both sides:\n", 364 | "\n", 365 | "$$ \\large\n", 366 | "(b_k -y_k)^2 -(b_k -y_{k+1})^2=0\n", 367 | "$$\n", 368 | "\n", 369 | "$$ \\large\n", 370 | "(b_k -y_k) =( y_{k+1} - b_k)\n", 371 | "$$\n", 372 | "\n", 373 | "$$ \\large\n", 374 | "b_k= \\frac{y_{k+1}+\n", 375 | "y_k} { 2}$$\n", 376 | "\n", 377 | "This means that we put our decision boundaries right in the middle of two reconstruction values. But remember, this is only optimal if we assume that the signals pdf is roughly constant over the 2 quantisation intervals! This approach is also called the “**nearest neighbour**”, because any signal value or data point is always quantized to the **nearest reconstruction value**. This is one important result of this strategy." 378 | ] 379 | }, 380 | { 381 | "cell_type": "code", 382 | "execution_count": 8, 383 | "metadata": { 384 | "slideshow": { 385 | "slide_type": "-" 386 | } 387 | }, 388 | "outputs": [ 389 | { 390 | "data": { 391 | "text/latex": [ 392 | "$\\displaystyle - 2 b_{k} y_{k} + 2 b_{k} y_{k+1} + y_{k}^{2} - y_{k+1}^{2} = 0$" 393 | ], 394 | "text/plain": [ 395 | "Eq(-2*b_k*y_k + 2*b_k*y_{k+1} + y_k**2 - y_{k+1}**2, 0)" 396 | ] 397 | }, 398 | "metadata": {}, 399 | "output_type": "display_data" 400 | }, 401 | { 402 | "data": { 403 | "text/latex": [ 404 | "$\\displaystyle b_{k} = \\frac{y_{k}}{2} + \\frac{y_{k+1}}{2}$" 405 | ], 406 | "text/plain": [ 407 | "Eq(b_k, y_k/2 + y_{k+1}/2)" 408 | ] 409 | }, 410 | "metadata": {}, 411 | "output_type": "display_data" 412 | } 413 | ], 414 | "source": [ 415 | "Eq_bk = Eq(simplify(Derivative(Dk/p,bk).doit()))\n", 416 | "display(Eq_bk)\n", 417 | "display(Eq(bk,solve(Eq_bk,bk)[0]))" 418 | ] 419 | }, 420 | { 421 | "cell_type": "markdown", 422 | "metadata": { 423 | "slideshow": { 424 | "slide_type": "subslide" 425 | } 426 | }, 427 | "source": [ 428 | "Now we have the decision boundaries, but we still need the reconstruction values $y_k$. To obtain them, we can again take the derivative of D, and set it to zero. Here we cannot start with an assumption of a uniform pdf, because we would like to have a dependency on a non-uniform pdf. We could make this assumption before, because we only assumed it for the (small) quantisation intervals. This can be true in practice also for non-uniform pdf's, if we have enough quantisation intervals.\n", 429 | "\n", 430 | "But to still have the dependency on the pdf, for the reconstruction values $y_k$ we have to start at the beginning, take the derivative of the original formulation of D.\n", 431 | "\n", 432 | "$$ \\large\n", 433 | "D=\\sum_{k=1} ^M \\int _{b_{k-1}}^ {b_k} (x-y_k)^2 p(x) dx$$\n", 434 | "\n", 435 | "\n", 436 | "Here we have the pdf p(x) and the reconstruction values (codewords) $y_k$. Now we start with taking the derivative with respect to the reconstruction value $y_k$ and set it to 0:\n", 437 | "\n", 438 | "$$ \\large\n", 439 | "\\frac{\\partial D} {\\partial {y_k}}=-\\sum_ {k=1} ^ {M} \\int_{b_{k-1}} ^{b_k} 2 \\cdot (x-y_k) p(x) dx = 0\n", 440 | "$$" 441 | ] 442 | }, 443 | { 444 | "cell_type": "code", 445 | "execution_count": 9, 446 | "metadata": { 447 | "hide_input": true 448 | }, 449 | "outputs": [ 450 | { 451 | "data": { 452 | "text/html": [ 453 | "\n" 454 | ], 455 | "text/plain": [ 456 | "" 457 | ] 458 | }, 459 | "metadata": {}, 460 | "output_type": "display_data" 461 | } 462 | ], 463 | "source": [ 464 | "%%html\n", 465 | "" 466 | ] 467 | }, 468 | { 469 | "cell_type": "code", 470 | "execution_count": 10, 471 | "metadata": { 472 | "slideshow": { 473 | "slide_type": "-" 474 | } 475 | }, 476 | "outputs": [], 477 | "source": [ 478 | "from sympy import Function, Sum, Indexed\n", 479 | "p_x = Function('p')(x)\n", 480 | "M, k = symbols('M k', real=True, positive=True)" 481 | ] 482 | }, 483 | { 484 | "cell_type": "code", 485 | "execution_count": 11, 486 | "metadata": { 487 | "slideshow": { 488 | "slide_type": "-" 489 | } 490 | }, 491 | "outputs": [ 492 | { 493 | "data": { 494 | "text/latex": [ 495 | "$\\displaystyle \\sum_{k=1}^{M} \\int\\limits_{b_{k-1}}^{b_{k}} \\left(x - y_{k}\\right)^{2} p{\\left(x \\right)}\\, dx$" 496 | ], 497 | "text/plain": [ 498 | "Sum(Integral((x - y_k)**2*p(x), (x, b_{k-1}, b_k)), (k, 1, M))" 499 | ] 500 | }, 501 | "metadata": {}, 502 | "output_type": "display_data" 503 | }, 504 | { 505 | "data": { 506 | "text/latex": [ 507 | "$\\displaystyle \\frac{\\partial}{\\partial y_{k}} \\sum_{k=1}^{M} \\int\\limits_{b_{k-1}}^{b_{k}} \\left(x - y_{k}\\right)^{2} p{\\left(x \\right)}\\, dx$" 508 | ], 509 | "text/plain": [ 510 | "Derivative(Sum(Integral((x - y_k)**2*p(x), (x, b_{k-1}, b_k)), (k, 1, M)), y_k)" 511 | ] 512 | }, 513 | "metadata": {}, 514 | "output_type": "display_data" 515 | } 516 | ], 517 | "source": [ 518 | "D = Sum(Integral((x-yk)**2*p_x,(x,bkm1,bk)),(k,1,M))\n", 519 | "display(D)\n", 520 | "display(Derivative(D,yk))" 521 | ] 522 | }, 523 | { 524 | "cell_type": "markdown", 525 | "metadata": { 526 | "slideshow": { 527 | "slide_type": "-" 528 | } 529 | }, 530 | "source": [ 531 | "Since the $y_k$ is only in 1 interval, the sum disappears:\n", 532 | "\n", 533 | "$$ \\large\n", 534 | "\\frac{\\partial D}{\\partial {y_k}}=- \\int _ {b_{k-1}}^{b_k} 2 \\cdot (x-y_k) p(x) dx = 0\n", 535 | "$$\n" 536 | ] 537 | }, 538 | { 539 | "cell_type": "code", 540 | "execution_count": 12, 541 | "metadata": { 542 | "slideshow": { 543 | "slide_type": "-" 544 | } 545 | }, 546 | "outputs": [ 547 | { 548 | "data": { 549 | "text/latex": [ 550 | "$\\displaystyle \\frac{\\partial}{\\partial y_{k}} \\int\\limits_{b_{k-1}}^{b_{k}} \\left(x - y_{k}\\right)^{2} p{\\left(x \\right)}\\, dx$" 551 | ], 552 | "text/plain": [ 553 | "Derivative(Integral((x - y_k)**2*p(x), (x, b_{k-1}, b_k)), y_k)" 554 | ] 555 | }, 556 | "metadata": {}, 557 | "output_type": "display_data" 558 | }, 559 | { 560 | "data": { 561 | "text/latex": [ 562 | "$\\displaystyle \\int\\limits_{b_{k-1}}^{b_{k}} 2 \\left(- x + y_{k}\\right) p{\\left(x \\right)}\\, dx$" 563 | ], 564 | "text/plain": [ 565 | "Integral(2*(-x + y_k)*p(x), (x, b_{k-1}, b_k))" 566 | ] 567 | }, 568 | "metadata": {}, 569 | "output_type": "display_data" 570 | } 571 | ], 572 | "source": [ 573 | "display(Derivative(Integral((x-yk)**2*p_x,(x,bkm1,bk)),yk))\n", 574 | "display(simplify(Derivative(Integral((x-yk)**2*p_x,(x,bkm1,bk)),yk).doit()))" 575 | ] 576 | }, 577 | { 578 | "cell_type": "markdown", 579 | "metadata": { 580 | "slideshow": { 581 | "slide_type": "-" 582 | } 583 | }, 584 | "source": [ 585 | "Since we have a sum, we can split this integral in 2 parts (and remove the - sign):\n", 586 | "\n", 587 | "\n", 588 | "$$ \\large\n", 589 | "\\int _ {b_{k-1}}^{b_k} 2 \\cdot x p(x) dx -\\int _{b_{k-1}} ^ {b_k} 2 \\cdot y_k p(x) dx = 0\n", 590 | "$$\n", 591 | "\n", 592 | "$$ \\large\n", 593 | "\\int _ {b_{k-1}} ^ {b_k} x \\cdot p(x) dx -y_k \\cdot \\int_ {b_{k-1}} ^ {b_k} p(x) dx = 0\n", 594 | "$$\n", 595 | "\n", 596 | "Hence we get the result\n", 597 | "\n", 598 | "$$ \\large\n", 599 | "y_k = \\frac{\\int _ {b_{k-1}}^ {b_k} x \\cdot p(x) dx} {\\int _{b_{k-1}} ^{b_k} p(x) dx}\n", 600 | "$$" 601 | ] 602 | }, 603 | { 604 | "cell_type": "code", 605 | "execution_count": 13, 606 | "metadata": { 607 | "slideshow": { 608 | "slide_type": "-" 609 | } 610 | }, 611 | "outputs": [ 612 | { 613 | "data": { 614 | "text/latex": [ 615 | "$\\displaystyle - 2 \\int\\limits_{b_{k-1}}^{b_{k}} x p{\\left(x \\right)}\\, dx + 2 \\int\\limits_{b_{k-1}}^{b_{k}} y_{k} p{\\left(x \\right)}\\, dx = 0$" 616 | ], 617 | "text/plain": [ 618 | "Eq(-2*Integral(x*p(x), (x, b_{k-1}, b_k)) + 2*Integral(y_k*p(x), (x, b_{k-1}, b_k)), 0)" 619 | ] 620 | }, 621 | "metadata": {}, 622 | "output_type": "display_data" 623 | }, 624 | { 625 | "data": { 626 | "text/latex": [ 627 | "$\\displaystyle - 2 \\int\\limits_{b_{k-1}}^{b_{k}} x p{\\left(x \\right)}\\, dx = - 2 y_{k} \\int\\limits_{b_{k-1}}^{b_{k}} p{\\left(x \\right)}\\, dx$" 628 | ], 629 | "text/plain": [ 630 | "Eq(-2*Integral(x*p(x), (x, b_{k-1}, b_k)), -2*y_k*Integral(p(x), (x, b_{k-1}, b_k)))" 631 | ] 632 | }, 633 | "metadata": {}, 634 | "output_type": "display_data" 635 | }, 636 | { 637 | "data": { 638 | "text/latex": [ 639 | "$\\displaystyle y_{k} = \\frac{\\int\\limits_{b_{k-1}}^{b_{k}} x p{\\left(x \\right)}\\, dx}{\\int\\limits_{b_{k-1}}^{b_{k}} p{\\left(x \\right)}\\, dx}$" 640 | ], 641 | "text/plain": [ 642 | "Eq(y_k, Integral(x*p(x), (x, b_{k-1}, b_k))/Integral(p(x), (x, b_{k-1}, b_k)))" 643 | ] 644 | }, 645 | "execution_count": 13, 646 | "metadata": {}, 647 | "output_type": "execute_result" 648 | } 649 | ], 650 | "source": [ 651 | "display(Eq(-2*(Integral(x*p_x,(x,bkm1,bk)) - Integral(yk*p_x,(x,bkm1,bk)))))\n", 652 | "Eq_yk=Eq(-2*(Integral(x*p_x,(x,bkm1,bk))),-2*yk*Integral(p_x,(x,bkm1,bk)))\n", 653 | "display(Eq_yk)\n", 654 | "Eq(yk,solve(Eq_yk,yk)[0])" 655 | ] 656 | }, 657 | { 658 | "cell_type": "markdown", 659 | "metadata": { 660 | "slideshow": { 661 | "slide_type": "-" 662 | } 663 | }, 664 | "source": [ 665 | "Observe that we now got a result without making any assumptions on p(x).\n", 666 | "\n", 667 | "This can be interpreted as a **conditional expectation** of our signal value over the quantization interval (given the signal is in this interval), or also its “**centroid**” as reconstruction value (codeword). \n", 668 | "\n", 669 | "- The value in the numerator can be seen as the expectation value of our signal in the interval.\n", 670 | "- The denominator can be seen as the probability of that signal being in that interval. \n", 671 | "\n", 672 | "Hence it can be interpreted as: Given the signal is inside the interval, this is its average or expected value.\n", 673 | "\n", 674 | "Since the decision boundaries $b_k$ depend on the reconstruction values $y_k$, and the $y_k$ in turn depend on the $b_k$, we need to come up with a way to compute them. The approach for this is an **iterative algorithm**:\n", 675 | "\n", 676 | "
    \n", 677 | "
  1. Decide on M, start (initialize the iteration) with a random assignment of M reconstruction values (codewords) $y_k$
  2. \n", 678 | "
  3. Using the reconstruction values $y_k$, compute the boundary values $b_k$ as mid-points between 2 reconstruction values / codewords (nearest neighbour rule)
  4. \n", 679 | "
  5. Using the pdf of our signal and the boundary values $b_k$, update, compute new reconstruction values (codewords) $y_k$ as centroids or conditional expectation over the quantisation areas between $b_k$ and $b_{k-1}$
  6. \n", 680 | "
  7. Go to 2) until update is sufficiently small (< epsilon).
  8. \n", 681 | "
\n", 682 | "\n", 683 | "This algorithm usually converges (it finds an equilibrium and doesn't change anymore), and it results in the minimum distortion D." 684 | ] 685 | }, 686 | { 687 | "cell_type": "code", 688 | "execution_count": 14, 689 | "metadata": { 690 | "hide_input": true 691 | }, 692 | "outputs": [ 693 | { 694 | "data": { 695 | "text/html": [ 696 | "\n" 697 | ], 698 | "text/plain": [ 699 | "" 700 | ] 701 | }, 702 | "metadata": {}, 703 | "output_type": "display_data" 704 | } 705 | ], 706 | "source": [ 707 | "%%html\n", 708 | "" 709 | ] 710 | }, 711 | { 712 | "cell_type": "markdown", 713 | "metadata": { 714 | "slideshow": { 715 | "slide_type": "slide" 716 | } 717 | }, 718 | "source": [ 719 | "## Example 1 for Max-Lloyd Interation" 720 | ] 721 | }, 722 | { 723 | "cell_type": "markdown", 724 | "metadata": { 725 | "slideshow": { 726 | "slide_type": "-" 727 | } 728 | }, 729 | "source": [ 730 | "Assume we have a signal x between $0\\leq x \\leq 1$, uniformly distributed (p(x)=1 on this interval) and we want to have 2 reconstruction values/ codewords $y_k$, and hence 3 boundaries $b_k$ (where $b_0=0$ and $b_2=1$), we need to find only $b_1$.\n", 731 | "\n", 732 | "1) **Random initialization:** $y_1=0.3$, $y_2=0.8$
\n", 733 | "2) **Nearest neighbour:** $b_1=(0.3+0.8)/2=0.55$
\n", 734 | "3) **Conditional expectation:**
\n", 735 | "\n", 736 | "$$ \\large\n", 737 | "y_k = \\frac{\\int_{b_{k-1}}^ {b_k} x \\cdot p(x) dx} {\\int_ {b_{k-1}}^{b_k} p(x) dx}$$\n", 738 | "\n", 739 | "now we use that $p(x)=1$.\n", 740 | "\n", 741 | "$$\n", 742 | "y_1 = \\frac{\\int_{0} ^{0.55} x dx} {\\int _ {0} ^ {0.55} 1 dx}=\\frac{0.55^2 /2}{ 0.55 }= 0.275\n", 743 | "$$\n", 744 | "
\n", 745 | "$$\n", 746 | "y_2 = \\frac{\\int_{0.55} ^{1} x dx} {\\int _ {0.55} ^ {1} 1 dx}=\\frac{1/2-0.55^2/2}{1- 0.55 }= 0.775\n", 747 | "$$
\n", 748 | "\n", 749 | "4) Go to 2), **nearest neighbour:**\n", 750 | "$b_1=(0.275+0.775)/2=0.525$\n", 751 | "\n", 752 | "3) **Conditional expectation:**
\n", 753 | "\n", 754 | "$y_1 = \\frac{0.525^2 /2}{ 0.525} = 0.26250$\n", 755 | "\n", 756 | "$y_2 =\\frac{1/2-0.525^2 / 2} {1- 0.525} = 0.76250$\n", 757 | "\n", 758 | "and so on until it doesn't change much any more. This should converge to $y_1=0.25$, $y_2=0.75$, and $b_1=0.5$." 759 | ] 760 | }, 761 | { 762 | "cell_type": "code", 763 | "execution_count": 15, 764 | "metadata": { 765 | "hide_input": true 766 | }, 767 | "outputs": [ 768 | { 769 | "data": { 770 | "text/html": [ 771 | "\n" 772 | ], 773 | "text/plain": [ 774 | "" 775 | ] 776 | }, 777 | "metadata": {}, 778 | "output_type": "display_data" 779 | } 780 | ], 781 | "source": [ 782 | "%%html\n", 783 | "" 784 | ] 785 | }, 786 | { 787 | "cell_type": "code", 788 | "execution_count": 16, 789 | "metadata": { 790 | "slideshow": { 791 | "slide_type": "-" 792 | } 793 | }, 794 | "outputs": [], 795 | "source": [ 796 | "import numpy as np\n", 797 | "from scipy.integrate import quad\n", 798 | "\n", 799 | "# Algorithm \n", 800 | "\n", 801 | "def b_k(y):\n", 802 | " return (y.sum())/2\n", 803 | "\n", 804 | "def y_k(b):\n", 805 | " return np.array([(quad(lambda x: x,0,b)[0]/quad(lambda x: 1,0,b)[0]),\n", 806 | " (quad(lambda x: x,b,1)[0]/quad(lambda x: 1,b,1)[0])])\n" 807 | ] 808 | }, 809 | { 810 | "cell_type": "code", 811 | "execution_count": 17, 812 | "metadata": { 813 | "slideshow": { 814 | "slide_type": "-" 815 | } 816 | }, 817 | "outputs": [ 818 | { 819 | "name": "stdout", 820 | "output_type": "stream", 821 | "text": [ 822 | "Iteration: 14\n", 823 | "[y1 y2]: [0.2500061 0.7500061]\n", 824 | "b: 0.500006103515625\n" 825 | ] 826 | } 827 | ], 828 | "source": [ 829 | "y = np.array([0.3,0.8])\n", 830 | "it = 100\n", 831 | "epsilon=1e-5\n", 832 | "b=0\n", 833 | "for i in range(it):\n", 834 | " b_old=b\n", 835 | " b=b_k(y)\n", 836 | " if i>0 and (b_old-b)<=epsilon:\n", 837 | " print('Iteration:',i+1)\n", 838 | " print('[y1 y2]:',y)\n", 839 | " print('b:',b)\n", 840 | " break\n", 841 | " y=y_k(b)" 842 | ] 843 | }, 844 | { 845 | "cell_type": "markdown", 846 | "metadata": { 847 | "slideshow": { 848 | "slide_type": "slide" 849 | } 850 | }, 851 | "source": [ 852 | "## Example 2" 853 | ] 854 | }, 855 | { 856 | "cell_type": "markdown", 857 | "metadata": { 858 | "slideshow": { 859 | "slide_type": "-" 860 | } 861 | }, 862 | "source": [ 863 | "Like above, but now with a **non-uniform**, Laplacian pdf: $p(x)=e^{-0.5\\cdot \\mid x \\mid}$\n", 864 | " \n", 865 | "1) **Random initialization:** $y_1=0.3$ ,$y_2=0.8$
\n", 866 | "2) **Nearest neighbour:** $b_1=(0.3+0.8)/2=0.55$
\n", 867 | "3) **Conditional expectation:**\n", 868 | "\n", 869 | "$$ \\large\n", 870 | "y_k=\\frac{\\int _{b_{k-1}} ^{b_k} x \\cdot p(x)dx}{\\int _{b_{k-1}}^{b_k} p(x)dx}\n", 871 | "$$\n" 872 | ] 873 | }, 874 | { 875 | "cell_type": "markdown", 876 | "metadata": { 877 | "slideshow": { 878 | "slide_type": "-" 879 | } 880 | }, 881 | "source": [ 882 | "Now we need Python to compute the numerator integral, for $y_1$:\n", 883 | "\n", 884 | "$$ \\large\n", 885 | "\\int _0^{b_1} x \\cdot p(x)dx= \\int_0 ^{0.55} x \\cdot e^{-0.5 \\cdot \\mid(x)\\mid } dx\n", 886 | "$$" 887 | ] 888 | }, 889 | { 890 | "cell_type": "code", 891 | "execution_count": 18, 892 | "metadata": { 893 | "hide_input": true 894 | }, 895 | "outputs": [ 896 | { 897 | "data": { 898 | "text/html": [ 899 | "\n" 900 | ], 901 | "text/plain": [ 902 | "" 903 | ] 904 | }, 905 | "metadata": {}, 906 | "output_type": "display_data" 907 | } 908 | ], 909 | "source": [ 910 | "%%html\n", 911 | "" 912 | ] 913 | }, 914 | { 915 | "cell_type": "code", 916 | "execution_count": 19, 917 | "metadata": { 918 | "slideshow": { 919 | "slide_type": "-" 920 | } 921 | }, 922 | "outputs": [ 923 | { 924 | "data": { 925 | "text/plain": [ 926 | "0.1261821715526608" 927 | ] 928 | }, 929 | "execution_count": 19, 930 | "metadata": {}, 931 | "output_type": "execute_result" 932 | } 933 | ], 934 | "source": [ 935 | "# Numerator\n", 936 | "Num,Nerr=quad(lambda x: x*np.exp(-0.5*abs(x)),0,0.55) \n", 937 | "Num" 938 | ] 939 | }, 940 | { 941 | "cell_type": "markdown", 942 | "metadata": { 943 | "slideshow": { 944 | "slide_type": "-" 945 | } 946 | }, 947 | "source": [ 948 | "For the denominator integral we get:\n", 949 | "$$ \\large\n", 950 | "\\int_0 ^{0.55} p(x)dx $$, hence:" 951 | ] 952 | }, 953 | { 954 | "cell_type": "code", 955 | "execution_count": 20, 956 | "metadata": { 957 | "slideshow": { 958 | "slide_type": "-" 959 | } 960 | }, 961 | "outputs": [ 962 | { 963 | "data": { 964 | "text/plain": [ 965 | "0.48085575355006305" 966 | ] 967 | }, 968 | "execution_count": 20, 969 | "metadata": {}, 970 | "output_type": "execute_result" 971 | } 972 | ], 973 | "source": [ 974 | "# Denominator\n", 975 | "Den,Derr=quad(lambda x: np.exp(-0.5*abs(x)),0,0.55) \n", 976 | "Den" 977 | ] 978 | }, 979 | { 980 | "cell_type": "markdown", 981 | "metadata": { 982 | "slideshow": { 983 | "slide_type": "-" 984 | } 985 | }, 986 | "source": [ 987 | "and hence we obtain,\n", 988 | " \n", 989 | "$$y_1= \\frac {Num}{ Den} = \\frac{0.12618 }{0.48086} = 0.26240$$" 990 | ] 991 | }, 992 | { 993 | "cell_type": "markdown", 994 | "metadata": {}, 995 | "source": [ 996 | "For $y_2$ we get:" 997 | ] 998 | }, 999 | { 1000 | "cell_type": "code", 1001 | "execution_count": 21, 1002 | "metadata": { 1003 | "slideshow": { 1004 | "slide_type": "-" 1005 | } 1006 | }, 1007 | "outputs": [ 1008 | { 1009 | "name": "stdout", 1010 | "output_type": "stream", 1011 | "text": [ 1012 | "Num = 0.23463387017153867\n", 1013 | "Den = 0.3060829270246701\n", 1014 | "0.7665696105703645\n" 1015 | ] 1016 | } 1017 | ], 1018 | "source": [ 1019 | "Num,Nerr=quad(lambda x: x*np.exp(-0.5*abs(x)),0.55,1)\n", 1020 | "print (\"Num = \",Num)\n", 1021 | "Den,Derr=quad(lambda x: np.exp(-0.5*abs(x)),0.55,1)\n", 1022 | "print (\"Den = \",Den)\n", 1023 | "\n", 1024 | "print(Num/Den) " 1025 | ] 1026 | }, 1027 | { 1028 | "cell_type": "markdown", 1029 | "metadata": { 1030 | "slideshow": { 1031 | "slide_type": "-" 1032 | } 1033 | }, 1034 | "source": [ 1035 | "Hence $y_2= 0.7665$.\n", 1036 | "Go back from here to step 2 until convergence." 1037 | ] 1038 | }, 1039 | { 1040 | "cell_type": "code", 1041 | "execution_count": 22, 1042 | "metadata": { 1043 | "slideshow": { 1044 | "slide_type": "-" 1045 | } 1046 | }, 1047 | "outputs": [], 1048 | "source": [ 1049 | "def b_k(y):\n", 1050 | " return (y.sum())/2\n", 1051 | "\n", 1052 | "def y_k(b):\n", 1053 | " return np.array([(quad(lambda x: x*np.exp(-0.5*abs(x)),0,b)[0]/quad(lambda x: np.exp(-0.5*abs(x)),0,b)[0]),\n", 1054 | " (quad(lambda x: x*np.exp(-0.5*abs(x)),b,1)[0]/quad(lambda x: np.exp(-0.5*abs(x)),b,1)[0])])" 1055 | ] 1056 | }, 1057 | { 1058 | "cell_type": "code", 1059 | "execution_count": 23, 1060 | "metadata": { 1061 | "slideshow": { 1062 | "slide_type": "-" 1063 | } 1064 | }, 1065 | "outputs": [ 1066 | { 1067 | "name": "stdout", 1068 | "output_type": "stream", 1069 | "text": [ 1070 | "Iteration: 28\n", 1071 | "[y1 y2]: [0.23001919 0.7282855 ]\n", 1072 | "b: 0.47915234324165445\n" 1073 | ] 1074 | } 1075 | ], 1076 | "source": [ 1077 | "y = np.array([0.3,0.8])\n", 1078 | "it = 100\n", 1079 | "epsilon=1e-9\n", 1080 | "b=0\n", 1081 | "for i in range(it):\n", 1082 | " b_old=b\n", 1083 | " b=b_k(y)\n", 1084 | " if i>0 and (b_old-b)<=epsilon:\n", 1085 | " print('Iteration:',i+1)\n", 1086 | " print('[y1 y2]:',y)\n", 1087 | " print('b:',b)\n", 1088 | " break\n", 1089 | " y=y_k(b)" 1090 | ] 1091 | } 1092 | ], 1093 | "metadata": { 1094 | "kernelspec": { 1095 | "display_name": "Python 3", 1096 | "language": "python", 1097 | "name": "python3" 1098 | }, 1099 | "language_info": { 1100 | "codemirror_mode": { 1101 | "name": "ipython", 1102 | "version": 3 1103 | }, 1104 | "file_extension": ".py", 1105 | "mimetype": "text/x-python", 1106 | "name": "python", 1107 | "nbconvert_exporter": "python", 1108 | "pygments_lexer": "ipython3", 1109 | "version": "3.7.5" 1110 | }, 1111 | "livereveal": { 1112 | "rise": { 1113 | "height": "90%", 1114 | "width": "90%" 1115 | }, 1116 | "scroll": true, 1117 | "theme": "sky", 1118 | "transition": "zoom" 1119 | }, 1120 | "widgets": { 1121 | "application/vnd.jupyter.widget-state+json": { 1122 | "state": { 1123 | "010411b23dde4ac9b0a3030e14cf116a": { 1124 | "model_module": "@jupyter-widgets/controls", 1125 | "model_module_version": "1.5.0", 1126 | "model_name": "ButtonModel", 1127 | "state": { 1128 | "description": "Start", 1129 | "layout": "IPY_MODEL_6a3bf4da31de478d94493fb7e7bf2612", 1130 | "style": "IPY_MODEL_28c5906b489444688437bc5e2decf81a" 1131 | } 1132 | }, 1133 | "02c9485b88554eb9992be45d9860b92e": { 1134 | "model_module": "@jupyter-widgets/base", 1135 | "model_module_version": "1.2.0", 1136 | "model_name": "LayoutModel", 1137 | "state": {} 1138 | }, 1139 | "0b8e46359cee465aa82778a67f6c0b96": { 1140 | "model_module": "@jupyter-widgets/base", 1141 | "model_module_version": "1.2.0", 1142 | "model_name": "LayoutModel", 1143 | "state": {} 1144 | }, 1145 | "0fbffec0398544c78cc392a8f3387f8e": { 1146 | "model_module": "@jupyter-widgets/base", 1147 | "model_module_version": "1.2.0", 1148 | "model_name": "LayoutModel", 1149 | "state": {} 1150 | }, 1151 | "14129132b8da4c588bdb14db56917502": { 1152 | "model_module": "@jupyter-widgets/controls", 1153 | "model_module_version": "1.5.0", 1154 | "model_name": "DescriptionStyleModel", 1155 | "state": { 1156 | "description_width": "" 1157 | } 1158 | }, 1159 | "16fff80d180c43a599f5bb2e9b551989": { 1160 | "model_module": "@jupyter-widgets/controls", 1161 | "model_module_version": "1.5.0", 1162 | "model_name": "DescriptionStyleModel", 1163 | "state": { 1164 | "description_width": "" 1165 | } 1166 | }, 1167 | "1b001b2ac3e847549ef031ffa10555a7": { 1168 | "model_module": "@jupyter-widgets/base", 1169 | "model_module_version": "1.2.0", 1170 | "model_name": "LayoutModel", 1171 | "state": {} 1172 | }, 1173 | "234045dd6a114ecda45e0086e0d54e99": { 1174 | "model_module": "@jupyter-widgets/base", 1175 | "model_module_version": "1.2.0", 1176 | "model_name": "LayoutModel", 1177 | "state": {} 1178 | }, 1179 | "238506e028044b5b881ef74c8ad59846": { 1180 | "model_module": "@jupyter-widgets/controls", 1181 | "model_module_version": "1.5.0", 1182 | "model_name": "BoundedIntTextModel", 1183 | "state": { 1184 | "description": "Bit-Depth:", 1185 | "layout": "IPY_MODEL_56ad1c5dc11f482f9602ecf86f593745", 1186 | "max": 16, 1187 | "min": 2, 1188 | "style": "IPY_MODEL_f832049896fd43d3a027ac200b0d333a", 1189 | "value": 8 1190 | } 1191 | }, 1192 | "25438168806e49268b476a257216e7dd": { 1193 | "model_module": "@jupyter-widgets/controls", 1194 | "model_module_version": "1.5.0", 1195 | "model_name": "HBoxModel", 1196 | "state": { 1197 | "children": [ 1198 | "IPY_MODEL_ad19b104bd2c4274827935f0bc642e1c" 1199 | ], 1200 | "layout": "IPY_MODEL_266d77a5a8bf4ba0b75999d1ff5ec2ba" 1201 | } 1202 | }, 1203 | "266d77a5a8bf4ba0b75999d1ff5ec2ba": { 1204 | "model_module": "@jupyter-widgets/base", 1205 | "model_module_version": "1.2.0", 1206 | "model_name": "LayoutModel", 1207 | "state": {} 1208 | }, 1209 | "28c5906b489444688437bc5e2decf81a": { 1210 | "model_module": "@jupyter-widgets/controls", 1211 | "model_module_version": "1.5.0", 1212 | "model_name": "ButtonStyleModel", 1213 | "state": {} 1214 | }, 1215 | "34f16d143e48488090e222e4ed23e9b8": { 1216 | "model_module": "@jupyter-widgets/controls", 1217 | "model_module_version": "1.5.0", 1218 | "model_name": "DescriptionStyleModel", 1219 | "state": { 1220 | "description_width": "" 1221 | } 1222 | }, 1223 | "37389e5b17cf48e3a0021f24e6b830b3": { 1224 | "model_module": "@jupyter-widgets/controls", 1225 | "model_module_version": "1.5.0", 1226 | "model_name": "DescriptionStyleModel", 1227 | "state": { 1228 | "description_width": "" 1229 | } 1230 | }, 1231 | "4181a03ad26243f18c1afcbac62c4b93": { 1232 | "model_module": "@jupyter-widgets/controls", 1233 | "model_module_version": "1.5.0", 1234 | "model_name": "DropdownModel", 1235 | "state": { 1236 | "_options_labels": [ 1237 | "Mid-Tread", 1238 | "Mid-Rise" 1239 | ], 1240 | "description": "Quantization Type:", 1241 | "index": 0, 1242 | "layout": "IPY_MODEL_0b8e46359cee465aa82778a67f6c0b96", 1243 | "style": "IPY_MODEL_16fff80d180c43a599f5bb2e9b551989" 1244 | } 1245 | }, 1246 | "462478cddfff483e922a3aa095a2e610": { 1247 | "model_module": "@jupyter-widgets/controls", 1248 | "model_module_version": "1.5.0", 1249 | "model_name": "CheckboxModel", 1250 | "state": { 1251 | "description": "$\\mu$-Law", 1252 | "disabled": false, 1253 | "layout": "IPY_MODEL_78c567360a394eb19dabc832927f8693", 1254 | "style": "IPY_MODEL_14129132b8da4c588bdb14db56917502", 1255 | "value": false 1256 | } 1257 | }, 1258 | "476db36e2ef8495598b90265cb380580": { 1259 | "model_module": "@jupyter-widgets/base", 1260 | "model_module_version": "1.2.0", 1261 | "model_name": "LayoutModel", 1262 | "state": {} 1263 | }, 1264 | "510465f7cad54c2db0e18fd7acd3311a": { 1265 | "model_module": "@jupyter-widgets/base", 1266 | "model_module_version": "1.2.0", 1267 | "model_name": "LayoutModel", 1268 | "state": {} 1269 | }, 1270 | "5254bdb17cad4908be4e921410737e7b": { 1271 | "model_module": "@jupyter-widgets/controls", 1272 | "model_module_version": "1.5.0", 1273 | "model_name": "DescriptionStyleModel", 1274 | "state": { 1275 | "description_width": "" 1276 | } 1277 | }, 1278 | "56ad1c5dc11f482f9602ecf86f593745": { 1279 | "model_module": "@jupyter-widgets/base", 1280 | "model_module_version": "1.2.0", 1281 | "model_name": "LayoutModel", 1282 | "state": {} 1283 | }, 1284 | "654babd4900b4e1d91e2eb5889a5db49": { 1285 | "model_module": "@jupyter-widgets/base", 1286 | "model_module_version": "1.2.0", 1287 | "model_name": "LayoutModel", 1288 | "state": {} 1289 | }, 1290 | "6a3bf4da31de478d94493fb7e7bf2612": { 1291 | "model_module": "@jupyter-widgets/base", 1292 | "model_module_version": "1.2.0", 1293 | "model_name": "LayoutModel", 1294 | "state": {} 1295 | }, 1296 | "78c567360a394eb19dabc832927f8693": { 1297 | "model_module": "@jupyter-widgets/base", 1298 | "model_module_version": "1.2.0", 1299 | "model_name": "LayoutModel", 1300 | "state": {} 1301 | }, 1302 | "7bec54694ea94b16aa7ddae3004a6907": { 1303 | "model_module": "@jupyter-widgets/controls", 1304 | "model_module_version": "1.5.0", 1305 | "model_name": "HBoxModel", 1306 | "state": { 1307 | "children": [ 1308 | "IPY_MODEL_238506e028044b5b881ef74c8ad59846" 1309 | ], 1310 | "layout": "IPY_MODEL_234045dd6a114ecda45e0086e0d54e99" 1311 | } 1312 | }, 1313 | "8aeb4d884e904dfe8c13404fefd0ef6f": { 1314 | "model_module": "@jupyter-widgets/controls", 1315 | "model_module_version": "1.5.0", 1316 | "model_name": "BoundedIntTextModel", 1317 | "state": { 1318 | "description": "Bit-Depth:", 1319 | "layout": "IPY_MODEL_a512d148087f4555b6bceeca8d4ea7a2", 1320 | "max": 16, 1321 | "min": 2, 1322 | "style": "IPY_MODEL_5254bdb17cad4908be4e921410737e7b", 1323 | "value": 8 1324 | } 1325 | }, 1326 | "8f63fda556ae49eea3ef4be03fdd736a": { 1327 | "model_module": "@jupyter-widgets/controls", 1328 | "model_module_version": "1.5.0", 1329 | "model_name": "ToggleButtonModel", 1330 | "state": { 1331 | "description": "Stop", 1332 | "layout": "IPY_MODEL_ae6ab56d84d049e8b3a4a6453ee62cb7", 1333 | "style": "IPY_MODEL_34f16d143e48488090e222e4ed23e9b8" 1334 | } 1335 | }, 1336 | "a105b9301e4e467b8f27efd88b0dd027": { 1337 | "model_module": "@jupyter-widgets/controls", 1338 | "model_module_version": "1.5.0", 1339 | "model_name": "CheckboxModel", 1340 | "state": { 1341 | "description": "$\\mu$-Law", 1342 | "disabled": false, 1343 | "layout": "IPY_MODEL_02c9485b88554eb9992be45d9860b92e", 1344 | "style": "IPY_MODEL_37389e5b17cf48e3a0021f24e6b830b3", 1345 | "value": false 1346 | } 1347 | }, 1348 | "a1f23f60b3804a438ade7232ff60fcbb": { 1349 | "model_module": "@jupyter-widgets/base", 1350 | "model_module_version": "1.2.0", 1351 | "model_name": "LayoutModel", 1352 | "state": {} 1353 | }, 1354 | "a512d148087f4555b6bceeca8d4ea7a2": { 1355 | "model_module": "@jupyter-widgets/base", 1356 | "model_module_version": "1.2.0", 1357 | "model_name": "LayoutModel", 1358 | "state": {} 1359 | }, 1360 | "ad19b104bd2c4274827935f0bc642e1c": { 1361 | "model_module": "@jupyter-widgets/controls", 1362 | "model_module_version": "1.5.0", 1363 | "model_name": "DropdownModel", 1364 | "state": { 1365 | "_options_labels": [ 1366 | "Mid-Tread", 1367 | "Mid-Rise" 1368 | ], 1369 | "description": "Quantization Type:", 1370 | "index": 0, 1371 | "layout": "IPY_MODEL_476db36e2ef8495598b90265cb380580", 1372 | "style": "IPY_MODEL_c7f454f84a4c4ffabeca0e6b66fd00c4" 1373 | } 1374 | }, 1375 | "ae6ab56d84d049e8b3a4a6453ee62cb7": { 1376 | "model_module": "@jupyter-widgets/base", 1377 | "model_module_version": "1.2.0", 1378 | "model_name": "LayoutModel", 1379 | "state": {} 1380 | }, 1381 | "c1920bdff8b14c4fa8e114b3921d9ade": { 1382 | "model_module": "@jupyter-widgets/controls", 1383 | "model_module_version": "1.5.0", 1384 | "model_name": "HBoxModel", 1385 | "state": { 1386 | "children": [ 1387 | "IPY_MODEL_4181a03ad26243f18c1afcbac62c4b93" 1388 | ], 1389 | "layout": "IPY_MODEL_a1f23f60b3804a438ade7232ff60fcbb" 1390 | } 1391 | }, 1392 | "c4d45858b9284681914cf8fde9407c40": { 1393 | "model_module": "@jupyter-widgets/controls", 1394 | "model_module_version": "1.5.0", 1395 | "model_name": "DescriptionStyleModel", 1396 | "state": { 1397 | "description_width": "" 1398 | } 1399 | }, 1400 | "c7f454f84a4c4ffabeca0e6b66fd00c4": { 1401 | "model_module": "@jupyter-widgets/controls", 1402 | "model_module_version": "1.5.0", 1403 | "model_name": "DescriptionStyleModel", 1404 | "state": { 1405 | "description_width": "" 1406 | } 1407 | }, 1408 | "cbfa24b75cc64fddbd7a4eab87c56c46": { 1409 | "model_module": "@jupyter-widgets/controls", 1410 | "model_module_version": "1.5.0", 1411 | "model_name": "HBoxModel", 1412 | "state": { 1413 | "children": [ 1414 | "IPY_MODEL_fe565191de1540f5b0197219c460af56", 1415 | "IPY_MODEL_8f63fda556ae49eea3ef4be03fdd736a", 1416 | "IPY_MODEL_a105b9301e4e467b8f27efd88b0dd027" 1417 | ], 1418 | "layout": "IPY_MODEL_1b001b2ac3e847549ef031ffa10555a7" 1419 | } 1420 | }, 1421 | "cff4dfddc8ee4f25a80a855bdc65994f": { 1422 | "model_module": "@jupyter-widgets/base", 1423 | "model_module_version": "1.2.0", 1424 | "model_name": "LayoutModel", 1425 | "state": {} 1426 | }, 1427 | "d559cd1da181460381dcc77443386833": { 1428 | "model_module": "@jupyter-widgets/controls", 1429 | "model_module_version": "1.5.0", 1430 | "model_name": "ButtonStyleModel", 1431 | "state": {} 1432 | }, 1433 | "d768baa1b42743999d0fb702cc36436b": { 1434 | "model_module": "@jupyter-widgets/controls", 1435 | "model_module_version": "1.5.0", 1436 | "model_name": "ToggleButtonModel", 1437 | "state": { 1438 | "description": "Stop", 1439 | "layout": "IPY_MODEL_510465f7cad54c2db0e18fd7acd3311a", 1440 | "style": "IPY_MODEL_c4d45858b9284681914cf8fde9407c40" 1441 | } 1442 | }, 1443 | "f6566c5300744aa18d1396449e916c5b": { 1444 | "model_module": "@jupyter-widgets/controls", 1445 | "model_module_version": "1.5.0", 1446 | "model_name": "HBoxModel", 1447 | "state": { 1448 | "children": [ 1449 | "IPY_MODEL_8aeb4d884e904dfe8c13404fefd0ef6f" 1450 | ], 1451 | "layout": "IPY_MODEL_cff4dfddc8ee4f25a80a855bdc65994f" 1452 | } 1453 | }, 1454 | "f7e7bb40afba4448b0c4506aed91c05a": { 1455 | "model_module": "@jupyter-widgets/controls", 1456 | "model_module_version": "1.5.0", 1457 | "model_name": "HBoxModel", 1458 | "state": { 1459 | "children": [ 1460 | "IPY_MODEL_010411b23dde4ac9b0a3030e14cf116a", 1461 | "IPY_MODEL_d768baa1b42743999d0fb702cc36436b", 1462 | "IPY_MODEL_462478cddfff483e922a3aa095a2e610" 1463 | ], 1464 | "layout": "IPY_MODEL_0fbffec0398544c78cc392a8f3387f8e" 1465 | } 1466 | }, 1467 | "f832049896fd43d3a027ac200b0d333a": { 1468 | "model_module": "@jupyter-widgets/controls", 1469 | "model_module_version": "1.5.0", 1470 | "model_name": "DescriptionStyleModel", 1471 | "state": { 1472 | "description_width": "" 1473 | } 1474 | }, 1475 | "fe565191de1540f5b0197219c460af56": { 1476 | "model_module": "@jupyter-widgets/controls", 1477 | "model_module_version": "1.5.0", 1478 | "model_name": "ButtonModel", 1479 | "state": { 1480 | "description": "Start", 1481 | "layout": "IPY_MODEL_654babd4900b4e1d91e2eb5889a5db49", 1482 | "style": "IPY_MODEL_d559cd1da181460381dcc77443386833" 1483 | } 1484 | } 1485 | }, 1486 | "version_major": 2, 1487 | "version_minor": 0 1488 | } 1489 | } 1490 | }, 1491 | "nbformat": 4, 1492 | "nbformat_minor": 2 1493 | } 1494 | -------------------------------------------------------------------------------- /ADSP_07a_The_z-Transform.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "markdown", 5 | "metadata": { 6 | "slideshow": { 7 | "slide_type": "slide" 8 | } 9 | }, 10 | "source": [ 11 | "
\n", 12 | " \n", 13 | "
\n", 14 | "\n", 15 | "### Prof. Dr. -Ing. Gerald Schuller
Jupyter Notebook: Renato Profeta\n" 16 | ] 17 | }, 18 | { 19 | "cell_type": "markdown", 20 | "metadata": { 21 | "slideshow": { 22 | "slide_type": "-" 23 | } 24 | }, 25 | "source": [ 26 | "# The z-Transform" 27 | ] 28 | }, 29 | { 30 | "cell_type": "code", 31 | "execution_count": 1, 32 | "metadata": { 33 | "hide_input": true 34 | }, 35 | "outputs": [ 36 | { 37 | "data": { 38 | "text/html": [ 39 | "\n" 40 | ], 41 | "text/plain": [ 42 | "" 43 | ] 44 | }, 45 | "metadata": {}, 46 | "output_type": "display_data" 47 | } 48 | ], 49 | "source": [ 50 | "%%html\n", 51 | "" 52 | ] 53 | }, 54 | { 55 | "cell_type": "markdown", 56 | "metadata": { 57 | "slideshow": { 58 | "slide_type": "-" 59 | } 60 | }, 61 | "source": [ 62 | "The z-Transform is a more general transform than the Fourier transform, and we will use it to obtain perfect reconstruction in filter banks and wavelets. Hence we will now look at the effects of sampling and some more tools in the z-domain.\n", 63 | "\n", 64 | "Since we usually deal with causal systems in practice, we use the **1-sided z-Transform**, defined as\n", 65 | "\n", 66 | "$$ \\large\n", 67 | "X(z)=\\sum_ {n=0} ^\\infty x(n)z^{-n} \n", 68 | "$$ \n", 69 | " \n", 70 | "Observe this simply takes our sequence $x(n)$ and **turns it into the polynomial** $X(z)$.\n", 71 | "\n", 72 | "First observe that we get our usual frequency response (the Discrete Time Fourier Transform for a causal signal, starting at n=0) if we evaluate the z-tranform along the unit circle in the z-domain,\n", 73 | "\n", 74 | "$$z=e^{j\\Omega}$$\n", 75 | "\n", 76 | "This connects the z-Transform with the DTFT, except for the sample index n, which for the so-called one-side z-Tranform starts at n=0, and for the DTFT starts at $n=-\\infty$.\n", 77 | "\n", 78 | "In general, we can write complex variable z with an angle and a magnitude,\n", 79 | "\n", 80 | "$$\\large\n", 81 | "z=r\\cdot e^{j\\Omega}$$\n", 82 | "\n", 83 | "where we can interpret the $\\Omega$ as the **normalized angular frequency**, and the $r$ a damping factor for an exponentially decaying oscillation, if $r<1$ (or exponentially growing if $r>1$.\n", 84 | "\n", 85 | "**Observe**: This damping factor is **not** in the DTFT. This means in the z-Transform we can have a converging sum of the transform even for unstable signals or system, by just choosing r large enough! This means the **Region of Convergence** (ROC) just becomes smaller. Remember, in the z-transform sum we have $z^{-1}=\\frac{1}{r}\\cdot e^{-j\\Omega}$." 86 | ] 87 | }, 88 | { 89 | "cell_type": "code", 90 | "execution_count": 2, 91 | "metadata": { 92 | "hide_input": true 93 | }, 94 | "outputs": [ 95 | { 96 | "data": { 97 | "text/html": [ 98 | "\n" 99 | ], 100 | "text/plain": [ 101 | "" 102 | ] 103 | }, 104 | "metadata": {}, 105 | "output_type": "display_data" 106 | } 107 | ], 108 | "source": [ 109 | "%%html\n", 110 | "" 111 | ] 112 | }, 113 | { 114 | "cell_type": "markdown", 115 | "metadata": { 116 | "slideshow": { 117 | "slide_type": "-" 118 | } 119 | }, 120 | "source": [ 121 | "**Recommended reading:**\n", 122 | "Alan V. Oppenheim, Ronald W. Schafer: “Discrete Time Signal Processing”, Prentice Hall.\n" 123 | ] 124 | }, 125 | { 126 | "cell_type": "code", 127 | "execution_count": 3, 128 | "metadata": { 129 | "hide_input": true 130 | }, 131 | "outputs": [ 132 | { 133 | "data": { 134 | "text/html": [ 135 | "\n" 136 | ], 137 | "text/plain": [ 138 | "" 139 | ] 140 | }, 141 | "metadata": {}, 142 | "output_type": "display_data" 143 | } 144 | ], 145 | "source": [ 146 | "%%html\n", 147 | "" 148 | ] 149 | }, 150 | { 151 | "cell_type": "markdown", 152 | "metadata": { 153 | "slideshow": { 154 | "slide_type": "slide" 155 | } 156 | }, 157 | "source": [ 158 | "## z-Transform Properties" 159 | ] 160 | }, 161 | { 162 | "cell_type": "markdown", 163 | "metadata": { 164 | "slideshow": { 165 | "slide_type": "-" 166 | } 167 | }, 168 | "source": [ 169 | "z-Transform definition:\n", 170 | "\n", 171 | "$$ \\large\n", 172 | "x(n) \\rightarrow \\sum _{n=0} ^ \\infty x(n) \\cdot z^{-n} =: X(z)\n", 173 | "$$\n", 174 | "\n", 175 | "The z-transform turns a sequence into a polynomial in z.\n", 176 | "\n", 177 | "Example: $x(n)=[2,4,3,1]$\n", 178 | "\n", 179 | "$$X(z)=2+4z^{-1}+3z^{-2}+z^{-3}$$" 180 | ] 181 | }, 182 | { 183 | "cell_type": "code", 184 | "execution_count": 3, 185 | "metadata": { 186 | "hide_input": true 187 | }, 188 | "outputs": [ 189 | { 190 | "data": { 191 | "text/html": [ 192 | "\n" 193 | ], 194 | "text/plain": [ 195 | "" 196 | ] 197 | }, 198 | "metadata": {}, 199 | "output_type": "display_data" 200 | } 201 | ], 202 | "source": [ 203 | "%%html\n", 204 | "" 205 | ] 206 | }, 207 | { 208 | "cell_type": "markdown", 209 | "metadata": { 210 | "slideshow": { 211 | "slide_type": "subslide" 212 | } 213 | }, 214 | "source": [ 215 | "### Shift Property" 216 | ] 217 | }, 218 | { 219 | "cell_type": "markdown", 220 | "metadata": { 221 | "slideshow": { 222 | "slide_type": "-" 223 | } 224 | }, 225 | "source": [ 226 | "Take two causal sequences (causal means sample value 0 for negative indices): Sequence x(n), and x(n-1), which is the same sequence but delayed by one sample. Then their z-transforms are: \n", 227 | " \n", 228 | "$$ \\large\n", 229 | "x(n) \\rightarrow \\sum _ {n=0 }^ \\infty x(n) \\cdot z^{-n} =: X(z)$$\n", 230 | " \n", 231 | "$$ \\large\n", 232 | "x(n-1) \\rightarrow \\sum _{n=0 }^ \\infty x(n-1) \\cdot z^{-n} =\\sum_{n=1} ^ \\infty x(n-1) \\cdot z^{-n} =\n", 233 | "$$ \n", 234 | "\n", 235 | "Use the index substitution, $n' \\leftarrow n-1$ or $n'+1\\leftarrow n$ to get rid of the \"$n-1$\" in the transform:\n", 236 | "\n", 237 | "\n", 238 | "$$ \\large\n", 239 | "=\\sum _{n'=0} ^\\infty x(n') \\cdot z^{-(n'+1)} = z^{-1} \\cdot \\sum_ {n'=0} ^\\infty x(n') \\cdot z^{-n'} = X(z) \\cdot z^{-1}\n", 240 | "$$
\n", 241 | "\n", 242 | "This shows that a **delay by 1 sample** in the signal sequence (time domain) corresponds to the **multiplication with** $z^{-1}$ in the z-domain:\n", 243 | " \n", 244 | "$$\\large x(n)\\rightarrow X(z)$$\n", 245 | "$$\\large x(n-1) \\rightarrow X(z)\\cdot z^{-1}$$" 246 | ] 247 | }, 248 | { 249 | "cell_type": "code", 250 | "execution_count": 4, 251 | "metadata": { 252 | "hide_input": true 253 | }, 254 | "outputs": [ 255 | { 256 | "data": { 257 | "text/html": [ 258 | "\n" 259 | ], 260 | "text/plain": [ 261 | "" 262 | ] 263 | }, 264 | "metadata": {}, 265 | "output_type": "display_data" 266 | } 267 | ], 268 | "source": [ 269 | "%%html\n", 270 | "" 271 | ] 272 | }, 273 | { 274 | "cell_type": "markdown", 275 | "metadata": { 276 | "slideshow": { 277 | "slide_type": "-" 278 | } 279 | }, 280 | "source": [ 281 | "**Example:**\n", 282 | "Signal:\n", 283 | "$x_0=[1,2,3]$ => $X_0(z)=1+2z^{-1}+3z^{-2}$\n", 284 | "\n", 285 | "Signal, delayed by 1 sampling period:\n", 286 | "\n", 287 | "$x_1=[0,1,2,3]=>X_1(z)=0+1z^{-1}+2z^{-2}+3z^{-3}=$\n", 288 | "\n", 289 | "In the z-domain the delay shows up as multiplication with $z^{-1}$,\n", 290 | "\n", 291 | "$$=X_0(z).z^{-1}$$" 292 | ] 293 | }, 294 | { 295 | "cell_type": "markdown", 296 | "metadata": { 297 | "slideshow": { 298 | "slide_type": "subslide" 299 | } 300 | }, 301 | "source": [ 302 | "Related to the shift property is the z-transform of the shifted unit pulse. The unit pulse is defined as\n", 303 | "\n", 304 | "$$\\large\n", 305 | "\\Delta \\left ( n \\right ) =\\left ( \\matrix {{1 , i f n =0} \\\\ {0 , e l s e}} \\right )$$\n", 306 | "\n", 307 | "so it is just a zero sequence with a 1 at time 0.\n", 308 | "\n", 309 | "Its z-Transform is then:\n", 310 | "\n", 311 | "$$\\large \\Delta(n)\\rightarrow 1$$\n", 312 | "\n", 313 | "The z-transform of the shifted unit pulse is:\n", 314 | "\n", 315 | "$$\\large \\Delta(n-d)\\rightarrow z^{-d}$$\n", 316 | "\n", 317 | "Shifted by d samples.\n", 318 | "\n", 319 | "The “**unit step**” function is defined as:\n", 320 | "\n", 321 | "$$\\large u\\left ( n \\right ) =\\left ( \\matrix {{1 , i f n \\geq 0} \\\\ {0 , e l s e}} \\right )$$" 322 | ] 323 | }, 324 | { 325 | "cell_type": "markdown", 326 | "metadata": { 327 | "slideshow": { 328 | "slide_type": "subslide" 329 | } 330 | }, 331 | "source": [ 332 | "### Linearity" 333 | ] 334 | }, 335 | { 336 | "cell_type": "markdown", 337 | "metadata": { 338 | "slideshow": { 339 | "slide_type": "-" 340 | } 341 | }, 342 | "source": [ 343 | "$$ \\large \n", 344 | "a \\cdot x(n) \\rightarrow a \\cdot X(z) $$\n", 345 | "\n", 346 | "$$\\large x(n)+y(n)\\rightarrow X(z)+Y(z)$$" 347 | ] 348 | }, 349 | { 350 | "cell_type": "markdown", 351 | "metadata": { 352 | "slideshow": { 353 | "slide_type": "subslide" 354 | } 355 | }, 356 | "source": [ 357 | "### Convolution" 358 | ] 359 | }, 360 | { 361 | "cell_type": "markdown", 362 | "metadata": { 363 | "slideshow": { 364 | "slide_type": "-" 365 | } 366 | }, 367 | "source": [ 368 | "$$\\large\n", 369 | "x(n)*y(n)\\rightarrow X(z)\\cdot Y(z)$$\n", 370 | "\n", 371 | "**The z-transform turns a convolution into a multiplication.**\n", 372 | "\n", 373 | "Remember: the convolution is defined as:\n", 374 | "\n", 375 | "$$ \\large\n", 376 | "x(n)*y(n)=\\sum _ {m= -\\infty} ^ \\infty x(m) \\cdot y(n-m)\n", 377 | "$$\n", 378 | "\n", 379 | "This is because the convolution of 2 sequences behave in the same way as the multiplication of 2 polynomials (the z-transform) of these sequences. This is one of the main advantages of the z-Transform, since it turns convolution into a simpler multiplication (which is in principle invertible)." 380 | ] 381 | }, 382 | { 383 | "cell_type": "markdown", 384 | "metadata": { 385 | "slideshow": { 386 | "slide_type": "slide" 387 | } 388 | }, 389 | "source": [ 390 | "## Example z-Transform" 391 | ] 392 | }, 393 | { 394 | "cell_type": "code", 395 | "execution_count": 1, 396 | "metadata": { 397 | "hide_input": true 398 | }, 399 | "outputs": [ 400 | { 401 | "data": { 402 | "text/html": [ 403 | "\n" 404 | ], 405 | "text/plain": [ 406 | "" 407 | ] 408 | }, 409 | "metadata": {}, 410 | "output_type": "display_data" 411 | } 412 | ], 413 | "source": [ 414 | "%%html\n", 415 | "" 416 | ] 417 | }, 418 | { 419 | "cell_type": "markdown", 420 | "metadata": { 421 | "slideshow": { 422 | "slide_type": "-" 423 | } 424 | }, 425 | "source": [ 426 | "Exponential decaying sequence: $x(n)=p^{n}$ for n=0,1,..., meaning the sequence\n", 427 | "\n", 428 | "$$\\large 1,p,p^{2},p^{3},...$$\n", 429 | "\n", 430 | "$$\\large \\rightarrow X(z)=\\sum _{n=0}^{\\infty}p^n \\cdot z^{-n}$$\n", 431 | "\n", 432 | "**Remember:** we had a closed form solution for this type of **geometric sums:**\n", 433 | "\n", 434 | "$$S= \\sum_ {k = 0}^{N - 1} c^k$$\n", 435 | "\n", 436 | "its solution was:\n", 437 | "\n", 438 | "$$\n", 439 | "S =\\frac{c^N - 1} {c - 1}\n", 440 | "$$\n", 441 | "\n", 442 | "Now we have an infinite sum, which means N goes towards infinity. But we have the expression $c^N$ in the solution. If $\\mid c\\mid <1$, then this goes to zero $c^N\\rightarrow 0$. Now we have $c=p\\cdot z^{-1}$. Hence, if $\\mid p\\cdot z^{-1}\\mid <1$ we get\n", 443 | "\n", 444 | "$$\\large\n", 445 | "\\rightarrow X(z)=\\frac{1}{1 -p \\cdot z^{-1}} = \\frac{z} {z-p}\n", 446 | "$$\n", 447 | "\n", 448 | "Observe that this fraction has a **pole** at position z=p, and a **zero** at position z=0. Hence if know the pole position, we know p, and if we know p we know the time sequence. So the location of the pole gives us very important information about the signal.\n", 449 | "\n", 450 | "Keep in mind that this solution is only valid for all p which fullfill $\\mid p\\cdot z^{-1}\\mid <1$. We see that this is true for $\\mid z\\mid >\\mid p\\mid $. This is also called the “**Region of Convergence” (ROC)**. The ROC is connected to the resulting stability of the system or signal. \n", 451 | "\n", 452 | "The region of convergence is outside the pole locations. If the region of convergence includes the unit circle, we have a stable system. This means: if the **poles are inside the unit circle**, we have a **stable system**.\n", 453 | "\n", 454 | "The sum of x(n) **converges** (we get the sum if we set $z=1$) if **abs(p)<1**. In this case we also say that the signal or system is **stable** (meaning we obtain a bounded output for a bounded input, so-called “BIBO stability”). In this case we see that the resulting pole of our z-transform is **inside the unit circle**. If abs(p)>1, we have an exponential growth, which is basically an “exploding” signal or system (meaning the output grows towards infinity), hence **unstable**.\n", 455 | "\n", 456 | "In general we say that a system or a signal is **stable**, if the **poles** of its z-transform are **inside the unit circle** in the z-domain, or **unstable** if **at least one pole is outside the unit circle** (it will exponentially grow).\n", 457 | "\n", 458 | "These are basic properties, which can be used to derive z-transforms of more complicated expressions, and they can also be used to obtain an inverse z-transform, by inspection.\n", 459 | "\n", 460 | "For instance if we see a fraction with a **pole** in the z-Transform, we know that the underlying time sequence has an **exponential decay or oscillation** in it.\n", 461 | "\n", 462 | "Observe that we can obtain a real valued decayed oscillation if we have 2 poles, each the conjugate complex of the other, or one with $+\\Omega$ and one with $-\\Omega$. In this way, we cancel the imaginary part.\n", 463 | "\n", 464 | "One of the main differences compared to the Discrete Time Fourier Transform (DTFT): With the z-transform we can see if a signal or system is stable by looking at the position of the poles in the z-domain. This is not possible for the DTFT, since there we don't know the positions of the poles. \n", 465 | "\n", 466 | "Now take a look at our down sampled signal from a previous notebook:\n", 467 | "$$ \\large\n", 468 | "x^d \\left ( n \\right ) =x \\left ( n \\right ) \\cdot \\Delta_N \\left ( n \\right ) =x ( n ) \\cdot \\frac{1} {N} \\sum _ {k = 0}^ {N - 1} e^{j \\frac{2 \\pi} {N }\\cdot k \\cdot n}\n", 469 | "$$\n", 470 | "\n", 471 | "Now we can z-transform it\n", 472 | "\n", 473 | "\n", 474 | "$$ \\large\n", 475 | "\\sum _ {n=0} ^\\infty x^d \\left ( n \\right ) \\cdot z^{-n} = \\sum_ {n=0}^ \\infty x ( n ) \\cdot \\frac{ 1} {N} \\sum_ {k = 0} ^{N - 1} e^{j \\frac{2\\pi} {N} \\cdot k \\cdot n} \\cdot z^{ -n }\n", 476 | "$$\n", 477 | "\n", 478 | "Hence the effect of **multiplying our signal with the delta impulse train** in the z-domain is\n", 479 | "\n", 480 | "$$\\large\n", 481 | "X^d(z)=\\frac{1} {N} \\sum _{k=0} ^{N-1} X( e^{-j \\frac{2 \\pi} {N }\\cdot k} \\cdot z)\n", 482 | "$$\n", 483 | "\n", 484 | "Observe that here the aliasing components appear by multiplying $z$ with $e^{-j\\frac{2 \\pi}{N}\\cdot k}$, which in effect is a shift of the frequency.\n", 485 | "\n", 486 | "\n", 487 | "Remember from last time, the effect of the **removal or re-insertion of the zeros** (changing the sampling rate) from or into the signal $x^d(n)$ at the higher sampling rate and $y(m)$ at the lower sampling rate in the z-domain is\n", 488 | "\n", 489 | "$$\\large\n", 490 | "Y(z)=X^{d} \\cdot \\left( z^{\\frac{1}{N}}\\right)$$" 491 | ] 492 | }, 493 | { 494 | "cell_type": "markdown", 495 | "metadata": { 496 | "slideshow": { 497 | "slide_type": "slide" 498 | } 499 | }, 500 | "source": [ 501 | "### Recommended" 502 | ] 503 | }, 504 | { 505 | "cell_type": "code", 506 | "execution_count": 2, 507 | "metadata": { 508 | "hide_input": true 509 | }, 510 | "outputs": [ 511 | { 512 | "data": { 513 | "text/html": [ 514 | "\n" 515 | ], 516 | "text/plain": [ 517 | "" 518 | ] 519 | }, 520 | "metadata": {}, 521 | "output_type": "display_data" 522 | } 523 | ], 524 | "source": [ 525 | "%%html\n", 526 | "" 527 | ] 528 | }, 529 | { 530 | "cell_type": "markdown", 531 | "metadata": { 532 | "slideshow": { 533 | "slide_type": "-" 534 | } 535 | }, 536 | "source": [ 537 | "**z-Transform using Python**\n", 538 | "\n", 539 | "https://github.com/GuitarsAI/MRSP_Notebooks" 540 | ] 541 | }, 542 | { 543 | "cell_type": "code", 544 | "execution_count": 5, 545 | "metadata": { 546 | "hide_input": true 547 | }, 548 | "outputs": [ 549 | { 550 | "data": { 551 | "text/html": [ 552 | "\n" 554 | ], 555 | "text/plain": [ 556 | "" 557 | ] 558 | }, 559 | "metadata": {}, 560 | "output_type": "display_data" 561 | } 562 | ], 563 | "source": [ 564 | "%%html\n", 565 | "" 567 | ] 568 | }, 569 | { 570 | "cell_type": "markdown", 571 | "metadata": { 572 | "slideshow": { 573 | "slide_type": "-" 574 | } 575 | }, 576 | "source": [ 577 | "**Frequency Response: z-Transform and the DTFT**" 578 | ] 579 | }, 580 | { 581 | "cell_type": "code", 582 | "execution_count": 6, 583 | "metadata": { 584 | "hide_input": true 585 | }, 586 | "outputs": [ 587 | { 588 | "data": { 589 | "text/html": [ 590 | "\n" 591 | ], 592 | "text/plain": [ 593 | "" 594 | ] 595 | }, 596 | "metadata": {}, 597 | "output_type": "display_data" 598 | } 599 | ], 600 | "source": [ 601 | "%%html\n", 602 | "" 603 | ] 604 | } 605 | ], 606 | "metadata": { 607 | "kernelspec": { 608 | "display_name": "Python 3", 609 | "language": "python", 610 | "name": "python3" 611 | }, 612 | "language_info": { 613 | "codemirror_mode": { 614 | "name": "ipython", 615 | "version": 3 616 | }, 617 | "file_extension": ".py", 618 | "mimetype": "text/x-python", 619 | "name": "python", 620 | "nbconvert_exporter": "python", 621 | "pygments_lexer": "ipython3", 622 | "version": "3.7.5" 623 | }, 624 | "livereveal": { 625 | "rise": { 626 | "height": "90%", 627 | "width": "90%" 628 | }, 629 | "scroll": true, 630 | "theme": "sky", 631 | "transition": "zoom" 632 | }, 633 | "widgets": { 634 | "application/vnd.jupyter.widget-state+json": { 635 | "state": { 636 | "010411b23dde4ac9b0a3030e14cf116a": { 637 | "model_module": "@jupyter-widgets/controls", 638 | "model_module_version": "1.5.0", 639 | "model_name": "ButtonModel", 640 | "state": { 641 | "description": "Start", 642 | "layout": "IPY_MODEL_6a3bf4da31de478d94493fb7e7bf2612", 643 | "style": "IPY_MODEL_28c5906b489444688437bc5e2decf81a" 644 | } 645 | }, 646 | "0124c108c90b41408309aa3aac820c5d": { 647 | "model_module": "@jupyter-widgets/controls", 648 | "model_module_version": "1.5.0", 649 | "model_name": "DescriptionStyleModel", 650 | "state": { 651 | "description_width": "" 652 | } 653 | }, 654 | "015addf4649b4d41b3ee5a4e08b1feef": { 655 | "model_module": "@jupyter-widgets/controls", 656 | "model_module_version": "1.5.0", 657 | "model_name": "DescriptionStyleModel", 658 | "state": { 659 | "description_width": "" 660 | } 661 | }, 662 | "01a5f4dbc4064fd3a34973eb916c31c5": { 663 | "model_module": "@jupyter-widgets/controls", 664 | "model_module_version": "1.5.0", 665 | "model_name": "ToggleButtonModel", 666 | "state": { 667 | "description": "Stop", 668 | "disabled": true, 669 | "layout": "IPY_MODEL_05ed0d85918542ce8e2d2b5a11d7d46c", 670 | "style": "IPY_MODEL_11beb2d8d5cb46ccbbbf8aa79a579437" 671 | } 672 | }, 673 | "02c9485b88554eb9992be45d9860b92e": { 674 | "model_module": "@jupyter-widgets/base", 675 | "model_module_version": "1.2.0", 676 | "model_name": "LayoutModel", 677 | "state": {} 678 | }, 679 | "05ed0d85918542ce8e2d2b5a11d7d46c": { 680 | "model_module": "@jupyter-widgets/base", 681 | "model_module_version": "1.2.0", 682 | "model_name": "LayoutModel", 683 | "state": {} 684 | }, 685 | "070df1bc17ac48328bf07a4c6bbf4386": { 686 | "model_module": "@jupyter-widgets/base", 687 | "model_module_version": "1.2.0", 688 | "model_name": "LayoutModel", 689 | "state": {} 690 | }, 691 | "08bcfe0454894f769d36cf36a969a89c": { 692 | "model_module": "@jupyter-widgets/controls", 693 | "model_module_version": "1.5.0", 694 | "model_name": "CheckboxModel", 695 | "state": { 696 | "description": "Downsampling with Zeros", 697 | "disabled": false, 698 | "layout": "IPY_MODEL_ec8397c2b6e5444587135da33d9144fd", 699 | "style": "IPY_MODEL_3fe6660526e44cc19947700d461a8a9d", 700 | "value": false 701 | } 702 | }, 703 | "0b8e46359cee465aa82778a67f6c0b96": { 704 | "model_module": "@jupyter-widgets/base", 705 | "model_module_version": "1.2.0", 706 | "model_name": "LayoutModel", 707 | "state": {} 708 | }, 709 | "0b9a6a693871477ebf610c47a13ce72a": { 710 | "model_module": "@jupyter-widgets/controls", 711 | "model_module_version": "1.5.0", 712 | "model_name": "DescriptionStyleModel", 713 | "state": { 714 | "description_width": "" 715 | } 716 | }, 717 | "0fbffec0398544c78cc392a8f3387f8e": { 718 | "model_module": "@jupyter-widgets/base", 719 | "model_module_version": "1.2.0", 720 | "model_name": "LayoutModel", 721 | "state": {} 722 | }, 723 | "11649f3e118b4488af7188e4a8e73291": { 724 | "model_module": "@jupyter-widgets/base", 725 | "model_module_version": "1.2.0", 726 | "model_name": "LayoutModel", 727 | "state": {} 728 | }, 729 | "11beb2d8d5cb46ccbbbf8aa79a579437": { 730 | "model_module": "@jupyter-widgets/controls", 731 | "model_module_version": "1.5.0", 732 | "model_name": "DescriptionStyleModel", 733 | "state": { 734 | "description_width": "" 735 | } 736 | }, 737 | "12c1d6bd34634a1fb100dddc180fee8c": { 738 | "model_module": "@jupyter-widgets/controls", 739 | "model_module_version": "1.5.0", 740 | "model_name": "ToggleButtonModel", 741 | "state": { 742 | "description": "Stop", 743 | "disabled": true, 744 | "layout": "IPY_MODEL_cbfc931a5e68487a91bda9c791d27a54", 745 | "style": "IPY_MODEL_154ee137a89643c596b033dd8318706c", 746 | "value": true 747 | } 748 | }, 749 | "1372b726ab434f9b89571f6da34c9e62": { 750 | "model_module": "@jupyter-widgets/base", 751 | "model_module_version": "1.2.0", 752 | "model_name": "LayoutModel", 753 | "state": {} 754 | }, 755 | "14129132b8da4c588bdb14db56917502": { 756 | "model_module": "@jupyter-widgets/controls", 757 | "model_module_version": "1.5.0", 758 | "model_name": "DescriptionStyleModel", 759 | "state": { 760 | "description_width": "" 761 | } 762 | }, 763 | "14f182217bd54f0eab515df20a2b5138": { 764 | "model_module": "@jupyter-widgets/base", 765 | "model_module_version": "1.2.0", 766 | "model_name": "LayoutModel", 767 | "state": {} 768 | }, 769 | "154ee137a89643c596b033dd8318706c": { 770 | "model_module": "@jupyter-widgets/controls", 771 | "model_module_version": "1.5.0", 772 | "model_name": "DescriptionStyleModel", 773 | "state": { 774 | "description_width": "" 775 | } 776 | }, 777 | "16fff80d180c43a599f5bb2e9b551989": { 778 | "model_module": "@jupyter-widgets/controls", 779 | "model_module_version": "1.5.0", 780 | "model_name": "DescriptionStyleModel", 781 | "state": { 782 | "description_width": "" 783 | } 784 | }, 785 | "1a8f9d0d68954f4fa2ce1361633bde98": { 786 | "model_module": "@jupyter-widgets/controls", 787 | "model_module_version": "1.5.0", 788 | "model_name": "DescriptionStyleModel", 789 | "state": { 790 | "description_width": "" 791 | } 792 | }, 793 | "1b001b2ac3e847549ef031ffa10555a7": { 794 | "model_module": "@jupyter-widgets/base", 795 | "model_module_version": "1.2.0", 796 | "model_name": "LayoutModel", 797 | "state": {} 798 | }, 799 | "1d77796b884c4861a25db47632b8d489": { 800 | "model_module": "@jupyter-widgets/controls", 801 | "model_module_version": "1.5.0", 802 | "model_name": "ButtonStyleModel", 803 | "state": {} 804 | }, 805 | "1e4739a8c3694e0184b1d7a856de0e23": { 806 | "model_module": "@jupyter-widgets/controls", 807 | "model_module_version": "1.5.0", 808 | "model_name": "DescriptionStyleModel", 809 | "state": { 810 | "description_width": "" 811 | } 812 | }, 813 | "1f7c5c8eb1f645d0b0b4ffb1db9e262b": { 814 | "model_module": "@jupyter-widgets/controls", 815 | "model_module_version": "1.5.0", 816 | "model_name": "DescriptionStyleModel", 817 | "state": { 818 | "description_width": "" 819 | } 820 | }, 821 | "224bcb4dea094163994aaa3f0121c825": { 822 | "model_module": "@jupyter-widgets/controls", 823 | "model_module_version": "1.5.0", 824 | "model_name": "DescriptionStyleModel", 825 | "state": { 826 | "description_width": "" 827 | } 828 | }, 829 | "234045dd6a114ecda45e0086e0d54e99": { 830 | "model_module": "@jupyter-widgets/base", 831 | "model_module_version": "1.2.0", 832 | "model_name": "LayoutModel", 833 | "state": {} 834 | }, 835 | "238506e028044b5b881ef74c8ad59846": { 836 | "model_module": "@jupyter-widgets/controls", 837 | "model_module_version": "1.5.0", 838 | "model_name": "BoundedIntTextModel", 839 | "state": { 840 | "description": "Bit-Depth:", 841 | "layout": "IPY_MODEL_56ad1c5dc11f482f9602ecf86f593745", 842 | "max": 16, 843 | "min": 2, 844 | "style": "IPY_MODEL_f832049896fd43d3a027ac200b0d333a", 845 | "value": 8 846 | } 847 | }, 848 | "25438168806e49268b476a257216e7dd": { 849 | "model_module": "@jupyter-widgets/controls", 850 | "model_module_version": "1.5.0", 851 | "model_name": "HBoxModel", 852 | "state": { 853 | "children": [ 854 | "IPY_MODEL_ad19b104bd2c4274827935f0bc642e1c" 855 | ], 856 | "layout": "IPY_MODEL_266d77a5a8bf4ba0b75999d1ff5ec2ba" 857 | } 858 | }, 859 | "266d77a5a8bf4ba0b75999d1ff5ec2ba": { 860 | "model_module": "@jupyter-widgets/base", 861 | "model_module_version": "1.2.0", 862 | "model_name": "LayoutModel", 863 | "state": {} 864 | }, 865 | "2770a82d9d574867b924b252a6697fcb": { 866 | "model_module": "@jupyter-widgets/controls", 867 | "model_module_version": "1.5.0", 868 | "model_name": "CheckboxModel", 869 | "state": { 870 | "description": "Downsampling with Zeros", 871 | "disabled": false, 872 | "layout": "IPY_MODEL_827b4767fde3485eb5c2b84a93302b94", 873 | "style": "IPY_MODEL_9e41a52328224716afc6e66f01c14e6e", 874 | "value": true 875 | } 876 | }, 877 | "28c5906b489444688437bc5e2decf81a": { 878 | "model_module": "@jupyter-widgets/controls", 879 | "model_module_version": "1.5.0", 880 | "model_name": "ButtonStyleModel", 881 | "state": {} 882 | }, 883 | "2a17130f6ba1491f959d24bee45727aa": { 884 | "model_module": "@jupyter-widgets/controls", 885 | "model_module_version": "1.5.0", 886 | "model_name": "ToggleButtonModel", 887 | "state": { 888 | "description": "Stop", 889 | "layout": "IPY_MODEL_9eefd0731f5c4392a5acde7f1e933fd5", 890 | "style": "IPY_MODEL_1f7c5c8eb1f645d0b0b4ffb1db9e262b", 891 | "value": true 892 | } 893 | }, 894 | "2aa28291b0e94968b90bc072bad5692c": { 895 | "model_module": "@jupyter-widgets/controls", 896 | "model_module_version": "1.5.0", 897 | "model_name": "DescriptionStyleModel", 898 | "state": { 899 | "description_width": "" 900 | } 901 | }, 902 | "2c0c1ccee30d431c9040ada58fd71129": { 903 | "model_module": "@jupyter-widgets/base", 904 | "model_module_version": "1.2.0", 905 | "model_name": "LayoutModel", 906 | "state": {} 907 | }, 908 | "2f2f8d6d9d194d8d81aa9445ae96bc2a": { 909 | "model_module": "@jupyter-widgets/controls", 910 | "model_module_version": "1.5.0", 911 | "model_name": "DescriptionStyleModel", 912 | "state": { 913 | "description_width": "" 914 | } 915 | }, 916 | "2f59316910c14ba5a89beb99d1c86a93": { 917 | "model_module": "@jupyter-widgets/controls", 918 | "model_module_version": "1.5.0", 919 | "model_name": "ToggleButtonModel", 920 | "state": { 921 | "description": "Stop", 922 | "layout": "IPY_MODEL_4d986dc237e54cb58da0435fa72d0f38", 923 | "style": "IPY_MODEL_48d6266121a349d48f11378c6804ee61", 924 | "value": true 925 | } 926 | }, 927 | "3121709f5a264cf080f39aa0e49e7279": { 928 | "model_module": "@jupyter-widgets/controls", 929 | "model_module_version": "1.5.0", 930 | "model_name": "ToggleButtonModel", 931 | "state": { 932 | "description": "Stop", 933 | "layout": "IPY_MODEL_f469e7d7b4a541af8a5340dd1d099999", 934 | "style": "IPY_MODEL_454bac39d61a47178f95831b6cee19a4" 935 | } 936 | }, 937 | "34f16d143e48488090e222e4ed23e9b8": { 938 | "model_module": "@jupyter-widgets/controls", 939 | "model_module_version": "1.5.0", 940 | "model_name": "DescriptionStyleModel", 941 | "state": { 942 | "description_width": "" 943 | } 944 | }, 945 | "367c6ac4f00e4104ba6837f8104dfb9f": { 946 | "model_module": "@jupyter-widgets/controls", 947 | "model_module_version": "1.5.0", 948 | "model_name": "DescriptionStyleModel", 949 | "state": { 950 | "description_width": "" 951 | } 952 | }, 953 | "36cef02e3ac343f597afecf7a0da19c4": { 954 | "model_module": "@jupyter-widgets/base", 955 | "model_module_version": "1.2.0", 956 | "model_name": "LayoutModel", 957 | "state": {} 958 | }, 959 | "37389e5b17cf48e3a0021f24e6b830b3": { 960 | "model_module": "@jupyter-widgets/controls", 961 | "model_module_version": "1.5.0", 962 | "model_name": "DescriptionStyleModel", 963 | "state": { 964 | "description_width": "" 965 | } 966 | }, 967 | "3c934745843a4bdb9ecd61d569af4ee9": { 968 | "model_module": "@jupyter-widgets/base", 969 | "model_module_version": "1.2.0", 970 | "model_name": "LayoutModel", 971 | "state": {} 972 | }, 973 | "3fe6660526e44cc19947700d461a8a9d": { 974 | "model_module": "@jupyter-widgets/controls", 975 | "model_module_version": "1.5.0", 976 | "model_name": "DescriptionStyleModel", 977 | "state": { 978 | "description_width": "" 979 | } 980 | }, 981 | "4181a03ad26243f18c1afcbac62c4b93": { 982 | "model_module": "@jupyter-widgets/controls", 983 | "model_module_version": "1.5.0", 984 | "model_name": "DropdownModel", 985 | "state": { 986 | "_options_labels": [ 987 | "Mid-Tread", 988 | "Mid-Rise" 989 | ], 990 | "description": "Quantization Type:", 991 | "index": 0, 992 | "layout": "IPY_MODEL_0b8e46359cee465aa82778a67f6c0b96", 993 | "style": "IPY_MODEL_16fff80d180c43a599f5bb2e9b551989" 994 | } 995 | }, 996 | "446d80c629a24e2fa2136e03dfc9d28b": { 997 | "model_module": "@jupyter-widgets/base", 998 | "model_module_version": "1.2.0", 999 | "model_name": "LayoutModel", 1000 | "state": {} 1001 | }, 1002 | "454bac39d61a47178f95831b6cee19a4": { 1003 | "model_module": "@jupyter-widgets/controls", 1004 | "model_module_version": "1.5.0", 1005 | "model_name": "DescriptionStyleModel", 1006 | "state": { 1007 | "description_width": "" 1008 | } 1009 | }, 1010 | "462478cddfff483e922a3aa095a2e610": { 1011 | "model_module": "@jupyter-widgets/controls", 1012 | "model_module_version": "1.5.0", 1013 | "model_name": "CheckboxModel", 1014 | "state": { 1015 | "description": "$\\mu$-Law", 1016 | "disabled": false, 1017 | "layout": "IPY_MODEL_78c567360a394eb19dabc832927f8693", 1018 | "style": "IPY_MODEL_14129132b8da4c588bdb14db56917502", 1019 | "value": false 1020 | } 1021 | }, 1022 | "476db36e2ef8495598b90265cb380580": { 1023 | "model_module": "@jupyter-widgets/base", 1024 | "model_module_version": "1.2.0", 1025 | "model_name": "LayoutModel", 1026 | "state": {} 1027 | }, 1028 | "48d6266121a349d48f11378c6804ee61": { 1029 | "model_module": "@jupyter-widgets/controls", 1030 | "model_module_version": "1.5.0", 1031 | "model_name": "DescriptionStyleModel", 1032 | "state": { 1033 | "description_width": "" 1034 | } 1035 | }, 1036 | "4d986dc237e54cb58da0435fa72d0f38": { 1037 | "model_module": "@jupyter-widgets/base", 1038 | "model_module_version": "1.2.0", 1039 | "model_name": "LayoutModel", 1040 | "state": {} 1041 | }, 1042 | "4db559233bc54c04b701ff71ebc1d55d": { 1043 | "model_module": "@jupyter-widgets/controls", 1044 | "model_module_version": "1.5.0", 1045 | "model_name": "DescriptionStyleModel", 1046 | "state": { 1047 | "description_width": "" 1048 | } 1049 | }, 1050 | "4e02c6cc9f2040c0924a4ba1a152edad": { 1051 | "model_module": "@jupyter-widgets/controls", 1052 | "model_module_version": "1.5.0", 1053 | "model_name": "CheckboxModel", 1054 | "state": { 1055 | "description": "Downsampling with Zeros", 1056 | "disabled": false, 1057 | "layout": "IPY_MODEL_8bfde2f187c84f8c936d80d6ab9dd110", 1058 | "style": "IPY_MODEL_6f86b5e8c23b4820bba2a6a839d624b3", 1059 | "value": false 1060 | } 1061 | }, 1062 | "50e455fde9824f468875e0b897625f4c": { 1063 | "model_module": "@jupyter-widgets/controls", 1064 | "model_module_version": "1.5.0", 1065 | "model_name": "DescriptionStyleModel", 1066 | "state": { 1067 | "description_width": "" 1068 | } 1069 | }, 1070 | "510465f7cad54c2db0e18fd7acd3311a": { 1071 | "model_module": "@jupyter-widgets/base", 1072 | "model_module_version": "1.2.0", 1073 | "model_name": "LayoutModel", 1074 | "state": {} 1075 | }, 1076 | "5254bdb17cad4908be4e921410737e7b": { 1077 | "model_module": "@jupyter-widgets/controls", 1078 | "model_module_version": "1.5.0", 1079 | "model_name": "DescriptionStyleModel", 1080 | "state": { 1081 | "description_width": "" 1082 | } 1083 | }, 1084 | "56ad1c5dc11f482f9602ecf86f593745": { 1085 | "model_module": "@jupyter-widgets/base", 1086 | "model_module_version": "1.2.0", 1087 | "model_name": "LayoutModel", 1088 | "state": {} 1089 | }, 1090 | "56c77fc92d1f40619026d3fbdd034c3a": { 1091 | "model_module": "@jupyter-widgets/controls", 1092 | "model_module_version": "1.5.0", 1093 | "model_name": "ToggleButtonModel", 1094 | "state": { 1095 | "description": "Stop", 1096 | "disabled": true, 1097 | "layout": "IPY_MODEL_e099daeead614c06ba66a3b6aa2a6519", 1098 | "style": "IPY_MODEL_1e4739a8c3694e0184b1d7a856de0e23", 1099 | "value": true 1100 | } 1101 | }, 1102 | "5d021f3d3f104103af22aff0c388a31d": { 1103 | "model_module": "@jupyter-widgets/controls", 1104 | "model_module_version": "1.5.0", 1105 | "model_name": "ToggleButtonModel", 1106 | "state": { 1107 | "description": "Stop", 1108 | "disabled": true, 1109 | "layout": "IPY_MODEL_c63e57f2060841f7aa9fb386480ae645", 1110 | "style": "IPY_MODEL_ec805846f5734669b7fcc4fd0ea88cde" 1111 | } 1112 | }, 1113 | "5e6239c4e5a14abba70b63e1be1f8edc": { 1114 | "model_module": "@jupyter-widgets/controls", 1115 | "model_module_version": "1.5.0", 1116 | "model_name": "ToggleButtonModel", 1117 | "state": { 1118 | "description": "Stop", 1119 | "disabled": true, 1120 | "layout": "IPY_MODEL_070df1bc17ac48328bf07a4c6bbf4386", 1121 | "style": "IPY_MODEL_cae0d9b30a044bcdbb4646d2a824b06f", 1122 | "value": true 1123 | } 1124 | }, 1125 | "60bf9fcb59ec405fbb5f47ca2b2cd2ff": { 1126 | "model_module": "@jupyter-widgets/controls", 1127 | "model_module_version": "1.5.0", 1128 | "model_name": "DescriptionStyleModel", 1129 | "state": { 1130 | "description_width": "" 1131 | } 1132 | }, 1133 | "617d2172171e4d4295d316b69ab86083": { 1134 | "model_module": "@jupyter-widgets/base", 1135 | "model_module_version": "1.2.0", 1136 | "model_name": "LayoutModel", 1137 | "state": {} 1138 | }, 1139 | "654babd4900b4e1d91e2eb5889a5db49": { 1140 | "model_module": "@jupyter-widgets/base", 1141 | "model_module_version": "1.2.0", 1142 | "model_name": "LayoutModel", 1143 | "state": {} 1144 | }, 1145 | "6a3bf4da31de478d94493fb7e7bf2612": { 1146 | "model_module": "@jupyter-widgets/base", 1147 | "model_module_version": "1.2.0", 1148 | "model_name": "LayoutModel", 1149 | "state": {} 1150 | }, 1151 | "6f85734c28af439a8da835c83e71c0c6": { 1152 | "model_module": "@jupyter-widgets/controls", 1153 | "model_module_version": "1.5.0", 1154 | "model_name": "ButtonModel", 1155 | "state": { 1156 | "description": "Stop", 1157 | "layout": "IPY_MODEL_617d2172171e4d4295d316b69ab86083", 1158 | "style": "IPY_MODEL_1d77796b884c4861a25db47632b8d489" 1159 | } 1160 | }, 1161 | "6f86b5e8c23b4820bba2a6a839d624b3": { 1162 | "model_module": "@jupyter-widgets/controls", 1163 | "model_module_version": "1.5.0", 1164 | "model_name": "DescriptionStyleModel", 1165 | "state": { 1166 | "description_width": "" 1167 | } 1168 | }, 1169 | "6fdb7d274eab44d2aaf38dd4dcfa0511": { 1170 | "model_module": "@jupyter-widgets/base", 1171 | "model_module_version": "1.2.0", 1172 | "model_name": "LayoutModel", 1173 | "state": {} 1174 | }, 1175 | "72a59b1fcaff4177ba91b8edb4fb23bd": { 1176 | "model_module": "@jupyter-widgets/controls", 1177 | "model_module_version": "1.5.0", 1178 | "model_name": "CheckboxModel", 1179 | "state": { 1180 | "description": "Downsampling with Zeros", 1181 | "disabled": false, 1182 | "layout": "IPY_MODEL_1372b726ab434f9b89571f6da34c9e62", 1183 | "style": "IPY_MODEL_2aa28291b0e94968b90bc072bad5692c", 1184 | "value": false 1185 | } 1186 | }, 1187 | "739b843557fd4432826a28261e5b827e": { 1188 | "model_module": "@jupyter-widgets/controls", 1189 | "model_module_version": "1.5.0", 1190 | "model_name": "CheckboxModel", 1191 | "state": { 1192 | "description": "Downsampling with Zeros", 1193 | "disabled": false, 1194 | "layout": "IPY_MODEL_98cc8cdb6e87466a8f357e995b2a13e9", 1195 | "style": "IPY_MODEL_224bcb4dea094163994aaa3f0121c825", 1196 | "value": false 1197 | } 1198 | }, 1199 | "73b4db0032014d44a57d71fb87786ee8": { 1200 | "model_module": "@jupyter-widgets/controls", 1201 | "model_module_version": "1.5.0", 1202 | "model_name": "CheckboxModel", 1203 | "state": { 1204 | "description": "Downsampling with Zeros", 1205 | "disabled": false, 1206 | "layout": "IPY_MODEL_446d80c629a24e2fa2136e03dfc9d28b", 1207 | "style": "IPY_MODEL_4db559233bc54c04b701ff71ebc1d55d", 1208 | "value": false 1209 | } 1210 | }, 1211 | "779d357055284d7d839ee1ba611221e8": { 1212 | "model_module": "@jupyter-widgets/base", 1213 | "model_module_version": "1.2.0", 1214 | "model_name": "LayoutModel", 1215 | "state": {} 1216 | }, 1217 | "7836a2e5f5404d26ac461945a2ea0619": { 1218 | "model_module": "@jupyter-widgets/controls", 1219 | "model_module_version": "1.5.0", 1220 | "model_name": "CheckboxModel", 1221 | "state": { 1222 | "description": "Downsampling with Zeros", 1223 | "disabled": false, 1224 | "layout": "IPY_MODEL_e8f0676ca8644d3ea28ffb8dd3c7964a", 1225 | "style": "IPY_MODEL_dbd4fc6f05344d3893968667ea288e00", 1226 | "value": true 1227 | } 1228 | }, 1229 | "78c567360a394eb19dabc832927f8693": { 1230 | "model_module": "@jupyter-widgets/base", 1231 | "model_module_version": "1.2.0", 1232 | "model_name": "LayoutModel", 1233 | "state": {} 1234 | }, 1235 | "7bec54694ea94b16aa7ddae3004a6907": { 1236 | "model_module": "@jupyter-widgets/controls", 1237 | "model_module_version": "1.5.0", 1238 | "model_name": "HBoxModel", 1239 | "state": { 1240 | "children": [ 1241 | "IPY_MODEL_238506e028044b5b881ef74c8ad59846" 1242 | ], 1243 | "layout": "IPY_MODEL_234045dd6a114ecda45e0086e0d54e99" 1244 | } 1245 | }, 1246 | "7f64dea70b79470aa30508c8f0c20150": { 1247 | "model_module": "@jupyter-widgets/controls", 1248 | "model_module_version": "1.5.0", 1249 | "model_name": "ToggleButtonModel", 1250 | "state": { 1251 | "description": "Stop", 1252 | "layout": "IPY_MODEL_779d357055284d7d839ee1ba611221e8", 1253 | "style": "IPY_MODEL_81f45b5f76104f8a980503f3e39332bb", 1254 | "value": true 1255 | } 1256 | }, 1257 | "81f45b5f76104f8a980503f3e39332bb": { 1258 | "model_module": "@jupyter-widgets/controls", 1259 | "model_module_version": "1.5.0", 1260 | "model_name": "DescriptionStyleModel", 1261 | "state": { 1262 | "description_width": "" 1263 | } 1264 | }, 1265 | "827b4767fde3485eb5c2b84a93302b94": { 1266 | "model_module": "@jupyter-widgets/base", 1267 | "model_module_version": "1.2.0", 1268 | "model_name": "LayoutModel", 1269 | "state": {} 1270 | }, 1271 | "89d29651e3da4f80ade582061a753d91": { 1272 | "model_module": "@jupyter-widgets/controls", 1273 | "model_module_version": "1.5.0", 1274 | "model_name": "ToggleButtonModel", 1275 | "state": { 1276 | "description": "Stop", 1277 | "layout": "IPY_MODEL_2c0c1ccee30d431c9040ada58fd71129", 1278 | "style": "IPY_MODEL_50e455fde9824f468875e0b897625f4c", 1279 | "value": true 1280 | } 1281 | }, 1282 | "8aeb4d884e904dfe8c13404fefd0ef6f": { 1283 | "model_module": "@jupyter-widgets/controls", 1284 | "model_module_version": "1.5.0", 1285 | "model_name": "BoundedIntTextModel", 1286 | "state": { 1287 | "description": "Bit-Depth:", 1288 | "layout": "IPY_MODEL_a512d148087f4555b6bceeca8d4ea7a2", 1289 | "max": 16, 1290 | "min": 2, 1291 | "style": "IPY_MODEL_5254bdb17cad4908be4e921410737e7b", 1292 | "value": 8 1293 | } 1294 | }, 1295 | "8bfde2f187c84f8c936d80d6ab9dd110": { 1296 | "model_module": "@jupyter-widgets/base", 1297 | "model_module_version": "1.2.0", 1298 | "model_name": "LayoutModel", 1299 | "state": {} 1300 | }, 1301 | "8f63fda556ae49eea3ef4be03fdd736a": { 1302 | "model_module": "@jupyter-widgets/controls", 1303 | "model_module_version": "1.5.0", 1304 | "model_name": "ToggleButtonModel", 1305 | "state": { 1306 | "description": "Stop", 1307 | "layout": "IPY_MODEL_ae6ab56d84d049e8b3a4a6453ee62cb7", 1308 | "style": "IPY_MODEL_34f16d143e48488090e222e4ed23e9b8" 1309 | } 1310 | }, 1311 | "94b8806eb4eb41c29262f6f79153bdaa": { 1312 | "model_module": "@jupyter-widgets/base", 1313 | "model_module_version": "1.2.0", 1314 | "model_name": "LayoutModel", 1315 | "state": {} 1316 | }, 1317 | "98cc8cdb6e87466a8f357e995b2a13e9": { 1318 | "model_module": "@jupyter-widgets/base", 1319 | "model_module_version": "1.2.0", 1320 | "model_name": "LayoutModel", 1321 | "state": {} 1322 | }, 1323 | "9e41a52328224716afc6e66f01c14e6e": { 1324 | "model_module": "@jupyter-widgets/controls", 1325 | "model_module_version": "1.5.0", 1326 | "model_name": "DescriptionStyleModel", 1327 | "state": { 1328 | "description_width": "" 1329 | } 1330 | }, 1331 | "9eefd0731f5c4392a5acde7f1e933fd5": { 1332 | "model_module": "@jupyter-widgets/base", 1333 | "model_module_version": "1.2.0", 1334 | "model_name": "LayoutModel", 1335 | "state": {} 1336 | }, 1337 | "a105b9301e4e467b8f27efd88b0dd027": { 1338 | "model_module": "@jupyter-widgets/controls", 1339 | "model_module_version": "1.5.0", 1340 | "model_name": "CheckboxModel", 1341 | "state": { 1342 | "description": "$\\mu$-Law", 1343 | "disabled": false, 1344 | "layout": "IPY_MODEL_02c9485b88554eb9992be45d9860b92e", 1345 | "style": "IPY_MODEL_37389e5b17cf48e3a0021f24e6b830b3", 1346 | "value": false 1347 | } 1348 | }, 1349 | "a1f23f60b3804a438ade7232ff60fcbb": { 1350 | "model_module": "@jupyter-widgets/base", 1351 | "model_module_version": "1.2.0", 1352 | "model_name": "LayoutModel", 1353 | "state": {} 1354 | }, 1355 | "a512d148087f4555b6bceeca8d4ea7a2": { 1356 | "model_module": "@jupyter-widgets/base", 1357 | "model_module_version": "1.2.0", 1358 | "model_name": "LayoutModel", 1359 | "state": {} 1360 | }, 1361 | "aa489c5c6242430bb9ef76d4460d61b5": { 1362 | "model_module": "@jupyter-widgets/base", 1363 | "model_module_version": "1.2.0", 1364 | "model_name": "LayoutModel", 1365 | "state": {} 1366 | }, 1367 | "aba73fc98ae34b8e965b730c3c422205": { 1368 | "model_module": "@jupyter-widgets/base", 1369 | "model_module_version": "1.2.0", 1370 | "model_name": "LayoutModel", 1371 | "state": {} 1372 | }, 1373 | "ad19b104bd2c4274827935f0bc642e1c": { 1374 | "model_module": "@jupyter-widgets/controls", 1375 | "model_module_version": "1.5.0", 1376 | "model_name": "DropdownModel", 1377 | "state": { 1378 | "_options_labels": [ 1379 | "Mid-Tread", 1380 | "Mid-Rise" 1381 | ], 1382 | "description": "Quantization Type:", 1383 | "index": 0, 1384 | "layout": "IPY_MODEL_476db36e2ef8495598b90265cb380580", 1385 | "style": "IPY_MODEL_c7f454f84a4c4ffabeca0e6b66fd00c4" 1386 | } 1387 | }, 1388 | "ae6ab56d84d049e8b3a4a6453ee62cb7": { 1389 | "model_module": "@jupyter-widgets/base", 1390 | "model_module_version": "1.2.0", 1391 | "model_name": "LayoutModel", 1392 | "state": {} 1393 | }, 1394 | "b7257f546d6542c08e06a519a7cfcff9": { 1395 | "model_module": "@jupyter-widgets/base", 1396 | "model_module_version": "1.2.0", 1397 | "model_name": "LayoutModel", 1398 | "state": {} 1399 | }, 1400 | "bdb731b1250b48f6b81ae85d8318b6dc": { 1401 | "model_module": "@jupyter-widgets/controls", 1402 | "model_module_version": "1.5.0", 1403 | "model_name": "ButtonStyleModel", 1404 | "state": {} 1405 | }, 1406 | "bf97deef015c4827a8967a671813f149": { 1407 | "model_module": "@jupyter-widgets/controls", 1408 | "model_module_version": "1.5.0", 1409 | "model_name": "ToggleButtonModel", 1410 | "state": { 1411 | "description": "Stop", 1412 | "layout": "IPY_MODEL_aa489c5c6242430bb9ef76d4460d61b5", 1413 | "style": "IPY_MODEL_1a8f9d0d68954f4fa2ce1361633bde98" 1414 | } 1415 | }, 1416 | "c1920bdff8b14c4fa8e114b3921d9ade": { 1417 | "model_module": "@jupyter-widgets/controls", 1418 | "model_module_version": "1.5.0", 1419 | "model_name": "HBoxModel", 1420 | "state": { 1421 | "children": [ 1422 | "IPY_MODEL_4181a03ad26243f18c1afcbac62c4b93" 1423 | ], 1424 | "layout": "IPY_MODEL_a1f23f60b3804a438ade7232ff60fcbb" 1425 | } 1426 | }, 1427 | "c47984031d354d7bb041c39975e4cb8c": { 1428 | "model_module": "@jupyter-widgets/controls", 1429 | "model_module_version": "1.5.0", 1430 | "model_name": "ToggleButtonModel", 1431 | "state": { 1432 | "description": "Stop", 1433 | "layout": "IPY_MODEL_3c934745843a4bdb9ecd61d569af4ee9", 1434 | "style": "IPY_MODEL_015addf4649b4d41b3ee5a4e08b1feef", 1435 | "value": true 1436 | } 1437 | }, 1438 | "c4d45858b9284681914cf8fde9407c40": { 1439 | "model_module": "@jupyter-widgets/controls", 1440 | "model_module_version": "1.5.0", 1441 | "model_name": "DescriptionStyleModel", 1442 | "state": { 1443 | "description_width": "" 1444 | } 1445 | }, 1446 | "c63e57f2060841f7aa9fb386480ae645": { 1447 | "model_module": "@jupyter-widgets/base", 1448 | "model_module_version": "1.2.0", 1449 | "model_name": "LayoutModel", 1450 | "state": {} 1451 | }, 1452 | "c7d3112a971e4497b7fd873765aed42d": { 1453 | "model_module": "@jupyter-widgets/base", 1454 | "model_module_version": "1.2.0", 1455 | "model_name": "LayoutModel", 1456 | "state": {} 1457 | }, 1458 | "c7f454f84a4c4ffabeca0e6b66fd00c4": { 1459 | "model_module": "@jupyter-widgets/controls", 1460 | "model_module_version": "1.5.0", 1461 | "model_name": "DescriptionStyleModel", 1462 | "state": { 1463 | "description_width": "" 1464 | } 1465 | }, 1466 | "cae0d9b30a044bcdbb4646d2a824b06f": { 1467 | "model_module": "@jupyter-widgets/controls", 1468 | "model_module_version": "1.5.0", 1469 | "model_name": "DescriptionStyleModel", 1470 | "state": { 1471 | "description_width": "" 1472 | } 1473 | }, 1474 | "cbfa24b75cc64fddbd7a4eab87c56c46": { 1475 | "model_module": "@jupyter-widgets/controls", 1476 | "model_module_version": "1.5.0", 1477 | "model_name": "HBoxModel", 1478 | "state": { 1479 | "children": [ 1480 | "IPY_MODEL_fe565191de1540f5b0197219c460af56", 1481 | "IPY_MODEL_8f63fda556ae49eea3ef4be03fdd736a", 1482 | "IPY_MODEL_a105b9301e4e467b8f27efd88b0dd027" 1483 | ], 1484 | "layout": "IPY_MODEL_1b001b2ac3e847549ef031ffa10555a7" 1485 | } 1486 | }, 1487 | "cbfc931a5e68487a91bda9c791d27a54": { 1488 | "model_module": "@jupyter-widgets/base", 1489 | "model_module_version": "1.2.0", 1490 | "model_name": "LayoutModel", 1491 | "state": {} 1492 | }, 1493 | "cff4dfddc8ee4f25a80a855bdc65994f": { 1494 | "model_module": "@jupyter-widgets/base", 1495 | "model_module_version": "1.2.0", 1496 | "model_name": "LayoutModel", 1497 | "state": {} 1498 | }, 1499 | "d2a3e1a11bc648cbac44ac8d661fcaae": { 1500 | "model_module": "@jupyter-widgets/controls", 1501 | "model_module_version": "1.5.0", 1502 | "model_name": "ToggleButtonModel", 1503 | "state": { 1504 | "description": "Stop", 1505 | "disabled": true, 1506 | "layout": "IPY_MODEL_c7d3112a971e4497b7fd873765aed42d", 1507 | "style": "IPY_MODEL_2f2f8d6d9d194d8d81aa9445ae96bc2a", 1508 | "value": true 1509 | } 1510 | }, 1511 | "d3450ad02abc46db9032268bf51cf3a2": { 1512 | "model_module": "@jupyter-widgets/controls", 1513 | "model_module_version": "1.5.0", 1514 | "model_name": "DescriptionStyleModel", 1515 | "state": { 1516 | "description_width": "" 1517 | } 1518 | }, 1519 | "d559cd1da181460381dcc77443386833": { 1520 | "model_module": "@jupyter-widgets/controls", 1521 | "model_module_version": "1.5.0", 1522 | "model_name": "ButtonStyleModel", 1523 | "state": {} 1524 | }, 1525 | "d768baa1b42743999d0fb702cc36436b": { 1526 | "model_module": "@jupyter-widgets/controls", 1527 | "model_module_version": "1.5.0", 1528 | "model_name": "ToggleButtonModel", 1529 | "state": { 1530 | "description": "Stop", 1531 | "layout": "IPY_MODEL_510465f7cad54c2db0e18fd7acd3311a", 1532 | "style": "IPY_MODEL_c4d45858b9284681914cf8fde9407c40" 1533 | } 1534 | }, 1535 | "da223fb00a7e46f6a12a63b53e4f3d9c": { 1536 | "model_module": "@jupyter-widgets/controls", 1537 | "model_module_version": "1.5.0", 1538 | "model_name": "ButtonStyleModel", 1539 | "state": {} 1540 | }, 1541 | "dae75bebe0544ee88cd1071b3f87ff71": { 1542 | "model_module": "@jupyter-widgets/controls", 1543 | "model_module_version": "1.5.0", 1544 | "model_name": "DescriptionStyleModel", 1545 | "state": { 1546 | "description_width": "" 1547 | } 1548 | }, 1549 | "dbd4fc6f05344d3893968667ea288e00": { 1550 | "model_module": "@jupyter-widgets/controls", 1551 | "model_module_version": "1.5.0", 1552 | "model_name": "DescriptionStyleModel", 1553 | "state": { 1554 | "description_width": "" 1555 | } 1556 | }, 1557 | "dc77a42f93fd481294243d614e2c45ef": { 1558 | "model_module": "@jupyter-widgets/controls", 1559 | "model_module_version": "1.5.0", 1560 | "model_name": "ToggleButtonModel", 1561 | "state": { 1562 | "description": "Stop", 1563 | "layout": "IPY_MODEL_6fdb7d274eab44d2aaf38dd4dcfa0511", 1564 | "style": "IPY_MODEL_0b9a6a693871477ebf610c47a13ce72a", 1565 | "value": true 1566 | } 1567 | }, 1568 | "e099daeead614c06ba66a3b6aa2a6519": { 1569 | "model_module": "@jupyter-widgets/base", 1570 | "model_module_version": "1.2.0", 1571 | "model_name": "LayoutModel", 1572 | "state": {} 1573 | }, 1574 | "e139e8ce24694bdda7967b2165ee342c": { 1575 | "model_module": "@jupyter-widgets/controls", 1576 | "model_module_version": "1.5.0", 1577 | "model_name": "ToggleButtonModel", 1578 | "state": { 1579 | "description": "Stop", 1580 | "layout": "IPY_MODEL_94b8806eb4eb41c29262f6f79153bdaa", 1581 | "style": "IPY_MODEL_dae75bebe0544ee88cd1071b3f87ff71", 1582 | "value": true 1583 | } 1584 | }, 1585 | "e51f5a36e4394ed689235a9794c618c1": { 1586 | "model_module": "@jupyter-widgets/controls", 1587 | "model_module_version": "1.5.0", 1588 | "model_name": "CheckboxModel", 1589 | "state": { 1590 | "description": "Downsampling with Zeros", 1591 | "disabled": false, 1592 | "layout": "IPY_MODEL_b7257f546d6542c08e06a519a7cfcff9", 1593 | "style": "IPY_MODEL_0124c108c90b41408309aa3aac820c5d", 1594 | "value": true 1595 | } 1596 | }, 1597 | "e5505837f6154a0cae1a17c207323d4e": { 1598 | "model_module": "@jupyter-widgets/controls", 1599 | "model_module_version": "1.5.0", 1600 | "model_name": "ToggleButtonModel", 1601 | "state": { 1602 | "description": "Stop", 1603 | "disabled": true, 1604 | "layout": "IPY_MODEL_36cef02e3ac343f597afecf7a0da19c4", 1605 | "style": "IPY_MODEL_60bf9fcb59ec405fbb5f47ca2b2cd2ff", 1606 | "value": true 1607 | } 1608 | }, 1609 | "e5d441cf0b974fe5926d4f430e662b4a": { 1610 | "model_module": "@jupyter-widgets/controls", 1611 | "model_module_version": "1.5.0", 1612 | "model_name": "CheckboxModel", 1613 | "state": { 1614 | "description": "Downsampling with Zeros", 1615 | "disabled": false, 1616 | "layout": "IPY_MODEL_11649f3e118b4488af7188e4a8e73291", 1617 | "style": "IPY_MODEL_367c6ac4f00e4104ba6837f8104dfb9f", 1618 | "value": false 1619 | } 1620 | }, 1621 | "e7ffbebd8eea4250a1ff0c0a7ae94732": { 1622 | "model_module": "@jupyter-widgets/base", 1623 | "model_module_version": "1.2.0", 1624 | "model_name": "LayoutModel", 1625 | "state": {} 1626 | }, 1627 | "e8f0676ca8644d3ea28ffb8dd3c7964a": { 1628 | "model_module": "@jupyter-widgets/base", 1629 | "model_module_version": "1.2.0", 1630 | "model_name": "LayoutModel", 1631 | "state": {} 1632 | }, 1633 | "e9d3c86d3a7c49b799bdcc77191aa62a": { 1634 | "model_module": "@jupyter-widgets/controls", 1635 | "model_module_version": "1.5.0", 1636 | "model_name": "ButtonModel", 1637 | "state": { 1638 | "description": "Stop", 1639 | "layout": "IPY_MODEL_14f182217bd54f0eab515df20a2b5138", 1640 | "style": "IPY_MODEL_da223fb00a7e46f6a12a63b53e4f3d9c" 1641 | } 1642 | }, 1643 | "ec805846f5734669b7fcc4fd0ea88cde": { 1644 | "model_module": "@jupyter-widgets/controls", 1645 | "model_module_version": "1.5.0", 1646 | "model_name": "DescriptionStyleModel", 1647 | "state": { 1648 | "description_width": "" 1649 | } 1650 | }, 1651 | "ec8397c2b6e5444587135da33d9144fd": { 1652 | "model_module": "@jupyter-widgets/base", 1653 | "model_module_version": "1.2.0", 1654 | "model_name": "LayoutModel", 1655 | "state": {} 1656 | }, 1657 | "f2232b0768124cf1804c9bc977ca3bc6": { 1658 | "model_module": "@jupyter-widgets/controls", 1659 | "model_module_version": "1.5.0", 1660 | "model_name": "ButtonModel", 1661 | "state": { 1662 | "description": "Stop", 1663 | "layout": "IPY_MODEL_aba73fc98ae34b8e965b730c3c422205", 1664 | "style": "IPY_MODEL_bdb731b1250b48f6b81ae85d8318b6dc" 1665 | } 1666 | }, 1667 | "f2a8b23362844b65b7cc51c15b54f5cc": { 1668 | "model_module": "@jupyter-widgets/controls", 1669 | "model_module_version": "1.5.0", 1670 | "model_name": "ToggleButtonModel", 1671 | "state": { 1672 | "description": "Stop", 1673 | "layout": "IPY_MODEL_e7ffbebd8eea4250a1ff0c0a7ae94732", 1674 | "style": "IPY_MODEL_d3450ad02abc46db9032268bf51cf3a2", 1675 | "value": true 1676 | } 1677 | }, 1678 | "f469e7d7b4a541af8a5340dd1d099999": { 1679 | "model_module": "@jupyter-widgets/base", 1680 | "model_module_version": "1.2.0", 1681 | "model_name": "LayoutModel", 1682 | "state": {} 1683 | }, 1684 | "f6566c5300744aa18d1396449e916c5b": { 1685 | "model_module": "@jupyter-widgets/controls", 1686 | "model_module_version": "1.5.0", 1687 | "model_name": "HBoxModel", 1688 | "state": { 1689 | "children": [ 1690 | "IPY_MODEL_8aeb4d884e904dfe8c13404fefd0ef6f" 1691 | ], 1692 | "layout": "IPY_MODEL_cff4dfddc8ee4f25a80a855bdc65994f" 1693 | } 1694 | }, 1695 | "f7e7bb40afba4448b0c4506aed91c05a": { 1696 | "model_module": "@jupyter-widgets/controls", 1697 | "model_module_version": "1.5.0", 1698 | "model_name": "HBoxModel", 1699 | "state": { 1700 | "children": [ 1701 | "IPY_MODEL_010411b23dde4ac9b0a3030e14cf116a", 1702 | "IPY_MODEL_d768baa1b42743999d0fb702cc36436b", 1703 | "IPY_MODEL_462478cddfff483e922a3aa095a2e610" 1704 | ], 1705 | "layout": "IPY_MODEL_0fbffec0398544c78cc392a8f3387f8e" 1706 | } 1707 | }, 1708 | "f832049896fd43d3a027ac200b0d333a": { 1709 | "model_module": "@jupyter-widgets/controls", 1710 | "model_module_version": "1.5.0", 1711 | "model_name": "DescriptionStyleModel", 1712 | "state": { 1713 | "description_width": "" 1714 | } 1715 | }, 1716 | "fe565191de1540f5b0197219c460af56": { 1717 | "model_module": "@jupyter-widgets/controls", 1718 | "model_module_version": "1.5.0", 1719 | "model_name": "ButtonModel", 1720 | "state": { 1721 | "description": "Start", 1722 | "layout": "IPY_MODEL_654babd4900b4e1d91e2eb5889a5db49", 1723 | "style": "IPY_MODEL_d559cd1da181460381dcc77443386833" 1724 | } 1725 | } 1726 | }, 1727 | "version_major": 2, 1728 | "version_minor": 0 1729 | } 1730 | } 1731 | }, 1732 | "nbformat": 4, 1733 | "nbformat_minor": 2 1734 | } 1735 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Advanced Digital Signal Processing
Notebooks and Tutorials 2 |

3 | 4 |

5 | 6 | #### Prof. Dr. -Ing. Gerald Schuller
Jupyter Notebooks and Videos: Renato Profeta 7 | [Applied Media Systems Group](https://www.tu-ilmenau.de/en/applied-media-systems-group/)
8 | [Technische Universität Ilmenau](https://www.tu-ilmenau.de/) 9 | 10 | # Content 11 | - 01 Quantization:
12 | [![NBViewer](https://badgen.net/badge/Launch/on%20NBViewer/blue?icon=terminal)](https://nbviewer.jupyter.org/github/GuitarsAI/ADSP_Tutorials/blob/master/ADSP_01_Quantization.ipynb)[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/GuitarsAI/ADSP_Tutorials/master?filepath=ADSP_01_Quantization.ipynb)[![Google Colab](https://badgen.net/badge/Launch/on%20Google%20Colab/black?icon=terminal)](https://colab.research.google.com/github/GuitarsAI/ADSP_Tutorials/blob/master/ADSP_01_Quantization.ipynb)[![Youtube](https://badgen.net/badge/Launch/on%20YouTube/red?icon=terminal)](https://youtu.be/gFCjY9tNg3s) 13 | 14 | - Introduction 15 | - Quantization Error 16 | - Uniform Quantizers: Mir-Rise and Mid-Tread 17 | - Python Example: Uniform Quantizers 18 | - Python Example: Real-time Quantization Example 19 | 20 | - 02 Quantization - Signal to Noise Ratio (SNR):
21 | [![NBViewer](https://badgen.net/badge/Launch/on%20NBViewer/blue?icon=terminal)](https://nbviewer.jupyter.org/github/GuitarsAI/ADSP_Tutorials/blob/master/ADSP_02_Quantization_SNR.ipynb)[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/GuitarsAI/ADSP_Tutorials/master?filepath=ADSP_02_Quantization_SNR.ipynb)[![Google Colab](https://badgen.net/badge/Launch/on%20Google%20Colab/black?icon=terminal)](https://colab.research.google.com/github/GuitarsAI/ADSP_Tutorials/blob/master/ADSP_02_Quantization_SNR.ipynb)[![Youtube](https://badgen.net/badge/Launch/on%20YouTube/red?icon=terminal)](https://youtu.be/-4Dx7FpEAoc) 22 | 23 | - Signal to Noise Ratio (SNR) 24 | - SNR for Uniformly Distribution Signals 25 | - SNR for a Sine Wave 26 | - PDF of Time Series 27 | 28 | - 03 Quantization - Non-Uniform Quantization:
29 | [![NBViewer](https://badgen.net/badge/Launch/on%20NBViewer/blue?icon=terminal)](https://nbviewer.jupyter.org/github/GuitarsAI/ADSP_Tutorials/blob/master/ADSP_03_Non-Uniform_Quantization.ipynb)[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/GuitarsAI/ADSP_Tutorials/master?filepath=ADSP_03_Non-Uniform_Quantization.ipynb)[![Google Colab](https://badgen.net/badge/Launch/on%20Google%20Colab/black?icon=terminal)](https://colab.research.google.com/github/GuitarsAI/ADSP_Tutorials/blob/master/ADSP_03_Non-Uniform_Quantization.ipynb)[![Youtube](https://badgen.net/badge/Launch/on%20YouTube/red?icon=terminal)](https://youtu.be/ASTD7vkgaKM) 30 | 31 | - Companding 32 | - µ-LAw and A-Law 33 | - Python Example: µ-LAw 34 | - Python Example: Real-Time Mid-Tread, Mid-Rise, µ-Law 35 | 36 | - 04r Quantization - Revision: Histogram, PDFs, Numerical Integration
37 | [![NBViewer](https://badgen.net/badge/Launch/on%20NBViewer/blue?icon=terminal)](https://nbviewer.jupyter.org/github/GuitarsAI/ADSP_Tutorials/blob/master/ADSP_04r_PDF_Hist_Revision.ipynb)[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/GuitarsAI/ADSP_Tutorials/master?filepath=ADSP_04r_PDF_Hist_Revision.ipynb)[![Google Colab](https://badgen.net/badge/Launch/on%20Google%20Colab/black?icon=terminal)](https://colab.research.google.com/github/GuitarsAI/ADSP_Tutorials/blob/master/ADSP_04r_PDF_Hist_Revision.ipynb)[![Youtube](https://badgen.net/badge/Launch/on%20YouTube/red?icon=terminal)](https://youtu.be/NLo0jU8CGDE) 38 | 39 | - Histograms 40 | - Probability Density Functions 41 | - Numerical Integration 42 | - Riemann Sum 43 | - Trapezoidal Rule 44 | 45 | - 04 Quantization - Lloyd-Max Quantizer
46 | [![NBViewer](https://badgen.net/badge/Launch/on%20NBViewer/blue?icon=terminal)](https://nbviewer.jupyter.org/github/GuitarsAI/ADSP_Tutorials/blob/master/ADSP_04_LloydMax.ipynb)[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/GuitarsAI/ADSP_Tutorials/master?filepath=ADSP_04_LloydMax.ipynb)[![Google Colab](https://badgen.net/badge/Launch/on%20Google%20Colab/black?icon=terminal)](https://colab.research.google.com/github/GuitarsAI/ADSP_Tutorials/blob/master/ADSP_04_LloydMax.ipynb)[![Youtube](https://badgen.net/badge/Launch/on%20YouTube/red?icon=terminal)](https://youtu.be/n2xuCE2dKeo) 47 | 48 | - Lloyd-Max Quantizer 49 | - Lloyd-Max Quantizer Examples 50 | 51 | - 05 Quantization - Vector Quantizer (VQ) and Linde-Buzo-Gray (LBG) Algorithm
52 | [![NBViewer](https://badgen.net/badge/Launch/on%20NBViewer/blue?icon=terminal)](https://nbviewer.jupyter.org/github/GuitarsAI/ADSP_Tutorials/blob/master/ADSP_05_VQ_LBG.ipynb)[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/GuitarsAI/ADSP_Tutorials/master?filepath=ADSP_05_VQ_LBG.ipynb)[![Google Colab](https://badgen.net/badge/Launch/on%20Google%20Colab/black?icon=terminal)](https://colab.research.google.com/github/GuitarsAI/ADSP_Tutorials/blob/master/ADSP_05_VQ_LBG.ipynb)[![Youtube](https://badgen.net/badge/Launch/on%20YouTube/red?icon=terminal)](https://youtu.be/UKJ2sXqjsro) 53 | 54 | - Vector Quantization 55 | - Linde-Buzo-Gray Algorithm 56 | - Python Examples: Vector Quantization in an Encoder and Decoder 57 | - Iron Maiden - The Number of the Beast Introduction 58 | - Iron Maiden - Aces High Introduction 59 | 60 | - 06 Sampling - Sampling a Discrete Time Signal
61 | [![NBViewer](https://badgen.net/badge/Launch/on%20NBViewer/blue?icon=terminal)](https://nbviewer.jupyter.org/github/GuitarsAI/ADSP_Tutorials/blob/master/ADSP_06_Sampling.ipynb)[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/GuitarsAI/ADSP_Tutorials/master?filepath=ADSP_06_Sampling.ipynb)[![Google Colab](https://badgen.net/badge/Launch/on%20Google%20Colab/black?icon=terminal)](https://colab.research.google.com/github/GuitarsAI/ADSP_Tutorials/blob/master/ADSP_06_Sampling.ipynb)[![Youtube](https://badgen.net/badge/Launch/on%20YouTube/red?icon=terminal)](https://youtu.be/jAdkpMC4ZGo) 62 | 63 | - Sampling Introduction 64 | - Sampling a Discrete Time Signal 65 | - Downsampling 66 | - Upsampling 67 | - Python Example: Live Spectrogram: Sampling, LP Filtering 68 | 69 | - 07a The z-Transform - Theory and Properties
70 | [![NBViewer](https://badgen.net/badge/Launch/on%20NBViewer/blue?icon=terminal)](https://nbviewer.jupyter.org/github/GuitarsAI/ADSP_Tutorials/blob/master/ADSP_07a_The_z-Transform.ipynb)[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/GuitarsAI/ADSP_Tutorials/master?filepath=ADSP_07a_The_z-Transform.ipynb)[![Google Colab](https://badgen.net/badge/Launch/on%20Google%20Colab/black?icon=terminal)](https://colab.research.google.com/github/GuitarsAI/ADSP_Tutorials/blob/master/ADSP_07a_The_z-Transform.ipynb)[![Youtube](https://badgen.net/badge/Launch/on%20YouTube/red?icon=terminal)](https://youtu.be/pkY3RfUrGsM) 71 | 72 | - The z-Transform Definition 73 | - Properties of the z-Transform 74 | - Shift Property 75 | - Linearity 76 | - Convolution 77 | - z-Transform Example: Exponential Decaying Sequence 78 | 79 | - 07b Filters - FIR and IIR Filters
80 | [![NBViewer](https://badgen.net/badge/Launch/on%20NBViewer/blue?icon=terminal)](https://nbviewer.jupyter.org/github/GuitarsAI/ADSP_Tutorials/blob/master/ADSP_07b_Filters.ipynb)[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/GuitarsAI/ADSP_Tutorials/master?filepath=ADSP_07b_Filters.ipynb)[![Google Colab](https://badgen.net/badge/Launch/on%20Google%20Colab/black?icon=terminal)](https://colab.research.google.com/github/GuitarsAI/ADSP_Tutorials/blob/master/ADSP_07b_Filters.ipynb)[![Youtube](https://badgen.net/badge/Launch/on%20YouTube/red?icon=terminal)](https://youtu.be/5nw86XtKvyc) 81 | 82 | - Filters: Linear Time-Invariant Systems 83 | - Finite Impulse Response (FIR) Filters 84 | - Infinite Impulse Response (IIR) Filters 85 | - Filter Example: Exponential Decaying Signal 86 | - Computing the Resulting Frequency Response 87 | - The z-Plane 88 | - Impulse Response 89 | 90 | - 08 Filters and Noble Identities
91 | [![NBViewer](https://badgen.net/badge/Launch/on%20NBViewer/blue?icon=terminal)](https://nbviewer.jupyter.org/github/GuitarsAI/ADSP_Tutorials/blob/master/ADSP_08_Nobel%20Identities.ipynb)[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/GuitarsAI/ADSP_Tutorials/master?filepath=ADSP_08_Nobel%20Identities.ipynb)[![Google Colab](https://badgen.net/badge/Launch/on%20Google%20Colab/black?icon=terminal)](https://colab.research.google.com/github/GuitarsAI/ADSP_Tutorials/blob/master/ADSP_08_Nobel%20Identities.ipynb)[![Youtube](https://badgen.net/badge/Launch/on%20YouTube/red?icon=terminal)](https://youtu.be/Qd5fFXLKNq4) 92 | 93 | - Filter Design 94 | - Linear Phase and Signal Delay 95 | - General Phase and Groud Delay 96 | - Magnitude 97 | - Multirate Noble Identities 98 | - Polyphase Vectors 99 | - Python Example: Noble Identities and Polyphase Vectors 100 | 101 | - 09 Allpass Filters and Frequency Warping
102 | [![NBViewer](https://badgen.net/badge/Launch/on%20NBViewer/blue?icon=terminal)](https://nbviewer.jupyter.org/github/GuitarsAI/ADSP_Tutorials/blob/master/ADSP_09_AllPassFilters.ipynb)[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/GuitarsAI/ADSP_Tutorials/master?filepath=ADSP_09_AllPassFilters.ipynb)[![Google Colab](https://badgen.net/badge/Launch/on%20Google%20Colab/black?icon=terminal)](https://colab.research.google.com/github/GuitarsAI/ADSP_Tutorials/blob/master/ADSP_09_AllPassFilters.ipynb)[![Youtube](https://badgen.net/badge/Launch/on%20YouTube/red?icon=terminal)](https://youtu.be/sLY2mSAPh6M) 103 | 104 | - Allpass Filters 105 | - Allpass Filter as Fractional Delay 106 | - IIR Fractional Delay Filter Design 107 | - Simple IIR Allpass Filters 108 | - Frequency Warping Introduction 109 | - Frequency Warping and Bark Scale 110 | 111 | - 10 Frequency Warping and Minimum Phase Filters
112 | [![NBViewer](https://badgen.net/badge/Launch/on%20NBViewer/blue?icon=terminal)](https://nbviewer.jupyter.org/github/GuitarsAI/ADSP_Tutorials/blob/master/ADSP_10_FrequencyWarping.ipynb)[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/GuitarsAI/ADSP_Tutorials/master?filepath=ADSP_10_FrequencyWarping.ipynb)[![Google Colab](https://badgen.net/badge/Launch/on%20Google%20Colab/black?icon=terminal)](https://colab.research.google.com/github/GuitarsAI/ADSP_Tutorials/blob/master/ADSP_10_FrequencyWarping.ipynb)[![Youtube](https://badgen.net/badge/Launch/on%20YouTube/red?icon=terminal)](https://youtu.be/-kmD8XO4H8M) 113 | 114 | - Frequency Warping 115 | - Minimum Phase Filters 116 | - Python Example 117 | - Impulse Response 118 | - Frequency Response 119 | 120 | - 11 Complex Signals and Filters, Hilbert Transform
121 | [![NBViewer](https://badgen.net/badge/Launch/on%20NBViewer/blue?icon=terminal)](https://nbviewer.jupyter.org/github/GuitarsAI/ADSP_Tutorials/blob/master/ADSP_11_Complex_S_and_S.ipynb)[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/GuitarsAI/ADSP_Tutorials/master?filepath=ADSP_11_Complex_S_and_S.ipynb)[![Google Colab](https://badgen.net/badge/Launch/on%20Google%20Colab/black?icon=terminal)](https://colab.research.google.com/github/GuitarsAI/ADSP_Tutorials/blob/master/ADSP_11_Complex_S_and_S.ipynb)[![Youtube](https://badgen.net/badge/Launch/on%20YouTube/red?icon=terminal)](https://youtu.be/_f1rULreCok) 122 | 123 | - Complex Signals and Filters 124 | - Hilbert Transformer 125 | - Python Example 126 | - Impulse Response 127 | - Frequency Response 128 | - Example for the Measurement of the (Instantaneous) Amplitude 129 | 130 | - 12 Wiener Filters
131 | [![NBViewer](https://badgen.net/badge/Launch/on%20NBViewer/blue?icon=terminal)](https://nbviewer.jupyter.org/github/GuitarsAI/ADSP_Tutorials/blob/master/ADSP_12_Wiener_Filter.ipynb)[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/GuitarsAI/ADSP_Tutorials/master?filepath=ADSP_12_Wiener_Filter.ipynb)[![Google Colab](https://badgen.net/badge/Launch/on%20Google%20Colab/black?icon=terminal)](https://colab.research.google.com/github/GuitarsAI/ADSP_Tutorials/blob/master/ADSP_12_Wiener_Filter.ipynb)[![Youtube](https://badgen.net/badge/Launch/on%20YouTube/red?icon=terminal)](https://youtu.be/UxziKpwXiFw) 132 | 133 | - Wiener Filters 134 | - Python Example for Denoising Speech 135 | - Scipy Wiener Filter Example: Iron Maiden - The Number of the Beast Speech Intro 136 | 137 | - 13 Matched Filters
138 | [![NBViewer](https://badgen.net/badge/Launch/on%20NBViewer/blue?icon=terminal)](https://nbviewer.jupyter.org/github/GuitarsAI/ADSP_Tutorials/blob/master/ADSP_13_Matched_Filters.ipynb)[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/GuitarsAI/ADSP_Tutorials/master?filepath=ADSP_13_Matched_Filters.ipynb)[![Google Colab](https://badgen.net/badge/Launch/on%20Google%20Colab/black?icon=terminal)](https://colab.research.google.com/github/GuitarsAI/ADSP_Tutorials/blob/master/ADSP_13_Matched_Filters.ipynb)[![Youtube](https://badgen.net/badge/Launch/on%20YouTube/red?icon=terminal)](https://youtu.be/1tuLWEzDe3o) 139 | 140 | - Matched Filters 141 | - Python Example: Closed Form Solution 142 | - Convolutional Neural Network Implementation: PyTorch 143 | 144 | - 14 Prediction
145 | [![NBViewer](https://badgen.net/badge/Launch/on%20NBViewer/blue?icon=terminal)](https://nbviewer.jupyter.org/github/GuitarsAI/ADSP_Tutorials/blob/master/ADSP_14_Prediction.ipynb)[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/GuitarsAI/ADSP_Tutorials/master?filepath=ADSP_14_Prediction.ipynb)[![Google Colab](https://badgen.net/badge/Launch/on%20Google%20Colab/black?icon=terminal)](https://colab.research.google.com/github/GuitarsAI/ADSP_Tutorials/blob/master/ADSP_14_Prediction.ipynb)[![Youtube](https://badgen.net/badge/Launch/on%20YouTube/red?icon=terminal)](https://youtu.be/fKrlRUFPrDg) 146 | 147 | - Prediction 148 | - Wiener-Hopf Closed Form Solution 149 | - Encoder-Decoder System 150 | - Neural Network Implementation - PyTorch 151 | - Linear Predictive Coding (LPC) 152 | - Least Mean Squares (LMS) Algorithm 153 | - LMS with Quantizer 154 | 155 | 156 | # YouTube Playlist 157 | [![Youtube](https://badgen.net/badge/Launch/on%20YouTube/red?icon=terminal)](https://www.youtube.com/playlist?list=PL6QnpHKwdPYjbDezYkAE-sAQ5MOpYeqM6) 158 | 159 | # Requirements 160 | Please check the following files at the 'binder' folder: 161 | - environment.yml 162 | - postBuild 163 | 164 | # Note 165 | Examples requiring a microphone will not work on remote environments such as Binder and Google Colab. 166 | -------------------------------------------------------------------------------- /audio/Iron Maiden - Aces High.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GuitarsAI/ADSP_Tutorials/9dc1a9599908951ed47b1c169c4b7f0438eae93d/audio/Iron Maiden - Aces High.mp3 -------------------------------------------------------------------------------- /audio/Iron Maiden - The Number Of The Beast.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GuitarsAI/ADSP_Tutorials/9dc1a9599908951ed47b1c169c4b7f0438eae93d/audio/Iron Maiden - The Number Of The Beast.mp3 -------------------------------------------------------------------------------- /audio/Iron_Maiden_-_2_Minutes_To_Midnight.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GuitarsAI/ADSP_Tutorials/9dc1a9599908951ed47b1c169c4b7f0438eae93d/audio/Iron_Maiden_-_2_Minutes_To_Midnight.mp3 -------------------------------------------------------------------------------- /audio/fspeech.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GuitarsAI/ADSP_Tutorials/9dc1a9599908951ed47b1c169c4b7f0438eae93d/audio/fspeech.wav -------------------------------------------------------------------------------- /audio/led-zeppelin-rock-and-roll.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GuitarsAI/ADSP_Tutorials/9dc1a9599908951ed47b1c169c4b7f0438eae93d/audio/led-zeppelin-rock-and-roll.mp3 -------------------------------------------------------------------------------- /audio/the-dead-daisies_long-way-to-go.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GuitarsAI/ADSP_Tutorials/9dc1a9599908951ed47b1c169c4b7f0438eae93d/audio/the-dead-daisies_long-way-to-go.mp3 -------------------------------------------------------------------------------- /binder/environment.yml: -------------------------------------------------------------------------------- 1 | name: ADSPTutorials 2 | channels: 3 | - anaconda 4 | - conda-forge 5 | - pytorch 6 | - defaults 7 | dependencies: 8 | - librosa 9 | - pytorch 10 | - numpy 11 | - scipy 12 | - sympy 13 | - matplotlib=3.1 14 | - ipywidgets 15 | - jupyter_contrib_nbextensions 16 | - rise 17 | - plotly=3.10.0 18 | - pandas 19 | -------------------------------------------------------------------------------- /binder/postBuild: -------------------------------------------------------------------------------- 1 | jupyter contrib nbextension install --user 2 | jupyter nbextension enable --py widgetsnbextension 3 | jupyter nbextension enable python-markdown/main 4 | jupyter trust *.ipynb 5 | jupyter nbextension enable hide_input/main 6 | -------------------------------------------------------------------------------- /images/Diagram2.drawio: -------------------------------------------------------------------------------- 1 | 7VlNc9s2EP01umRGHn5bOlq22xySGafutMkRIiESDUmwIGSR+fVdkAApEJJF25TizFQXCQtgAe3b97AgZ+5tVv3OUJF8phFOZ44VVTP3buY4tuUu4EtY6tbiL6zWEDMSyUG94ZH8wGqmtG5JhEttIKc05aTQjSHNcxxyzYYYozt92Iam+qoFirFheAxRalr/JhFPpNW2rL7jIyZxIpde+LJjjcLvMaPbXK43c9xN82m7M6R8yfFlgiK62zO59zP3llHK219ZdYtTEVsVtnbeb0d6u30znPMxE/6kuz8eVzcs/RKhxd2X+uH+49M88Fs3TyjdYvU/mt3yWkUIRxAw2aSMJzSmOUrve+uqiQIW61jQ6sd8orQAow3GfzDntUQfbTkFU8KzVPZ2sRHzS87o9w4MFywbmnM51xbtdotiX0djIU0l3bIQPxMAV6YcYjHmz4zz7A4yoAKmGeashokMp4iTJ30jSOZk3I3rcYEfEpoXwOQeQClIYb+rtYZV8O9WpFMTsHnZROwGBkBoqr4TfsXi+4fyUW4LZZvbygj73LPvWde9bZAou4Rw/FigJuA7kAsdZFQWLYE3pBLJcgBoLQ/kf8aM4+p5nE1Y5ATPk+ST4uRY0sWup7rSq2Sf5NaZgFSq97P5Nibyk/DLeSNt5NQHSmDlDld/qeNqOwPAWj7LWQPMum28HkbnNIoibwkcM5/QGqcPtCSc0By61pRzmg0jHqEy6QBFKYnF0BCijZmOnHJ7I8dwgbjwVYh1syoWp/QVToFpTIy7QmsAG4X8qtxmB5GfgGbdYS7hWPoGy/wDLPPPxjITn1opmJDGUZrpgWY2wjeQzZm/ymf+3Z4iti6PiCJElQ90cAjvENOMRFHLcwz7QevGlUiMQuRzEyx/JbYAy4E7YHcpD0f9rHS8i4hsMEDftpxR8Ltng/99FDWvQmIS0bXds6jukOaXVl37eBn0IlYblK7+5/SA0x20HafHSfrZOB1474LTL7yoQLRZ/VUMv/JV85t01TTuKumrbdX7rQfMCARPpNPUAqHK4pPXnvOUb/bS0bLL8QYuziwk3ogqHMonlMdN1py414zPiYa8SipYyxrISY5kbTi3F8LHJiXFX9L5FNXZ9SDaBy5BwSUvQQrtvfAX705jpwi8qoNV4J3ACLx7SRG9NgNvimge3YjHatDKaY4v8pzGjODIm8Nbr5HB4PGAN4h8K6SGDp10dOnKSDF8JLBhisqShNMcbd1Z9k0/544cbeNPsZOH05Eq92fljv263OnoXiv2Xzh3zKq6r4dXxYdaNOZ203w/Gm0Hqi23o6TtLYLtDh4XqjJlp70YMFNqyPbpBNusen8hQPTaZjnV1eRaP1XtpVnOXF8UJPNxwy8D0QScMXTQLHIOVZevgAOa/euyVv76d5Lu/X8= -------------------------------------------------------------------------------- /images/Lecture11-1.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GuitarsAI/ADSP_Tutorials/9dc1a9599908951ed47b1c169c4b7f0438eae93d/images/Lecture11-1.PNG -------------------------------------------------------------------------------- /images/Lecture14-1.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GuitarsAI/ADSP_Tutorials/9dc1a9599908951ed47b1c169c4b7f0438eae93d/images/Lecture14-1.JPG -------------------------------------------------------------------------------- /images/Lecture14-2.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GuitarsAI/ADSP_Tutorials/9dc1a9599908951ed47b1c169c4b7f0438eae93d/images/Lecture14-2.JPG -------------------------------------------------------------------------------- /images/Lecture14-3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GuitarsAI/ADSP_Tutorials/9dc1a9599908951ed47b1c169c4b7f0438eae93d/images/Lecture14-3.jpg -------------------------------------------------------------------------------- /images/Lecture14-4.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GuitarsAI/ADSP_Tutorials/9dc1a9599908951ed47b1c169c4b7f0438eae93d/images/Lecture14-4.JPG -------------------------------------------------------------------------------- /images/Lecture6-10.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GuitarsAI/ADSP_Tutorials/9dc1a9599908951ed47b1c169c4b7f0438eae93d/images/Lecture6-10.PNG -------------------------------------------------------------------------------- /images/Lecture6-11.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GuitarsAI/ADSP_Tutorials/9dc1a9599908951ed47b1c169c4b7f0438eae93d/images/Lecture6-11.PNG -------------------------------------------------------------------------------- /images/Lecture6-12.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GuitarsAI/ADSP_Tutorials/9dc1a9599908951ed47b1c169c4b7f0438eae93d/images/Lecture6-12.PNG -------------------------------------------------------------------------------- /images/Lecture6-6.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GuitarsAI/ADSP_Tutorials/9dc1a9599908951ed47b1c169c4b7f0438eae93d/images/Lecture6-6.PNG -------------------------------------------------------------------------------- /images/Lecture6-7.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GuitarsAI/ADSP_Tutorials/9dc1a9599908951ed47b1c169c4b7f0438eae93d/images/Lecture6-7.PNG -------------------------------------------------------------------------------- /images/Lecture6-8.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GuitarsAI/ADSP_Tutorials/9dc1a9599908951ed47b1c169c4b7f0438eae93d/images/Lecture6-8.PNG -------------------------------------------------------------------------------- /images/Lecture6-9.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GuitarsAI/ADSP_Tutorials/9dc1a9599908951ed47b1c169c4b7f0438eae93d/images/Lecture6-9.PNG -------------------------------------------------------------------------------- /images/Lecture7-2.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GuitarsAI/ADSP_Tutorials/9dc1a9599908951ed47b1c169c4b7f0438eae93d/images/Lecture7-2.PNG -------------------------------------------------------------------------------- /images/Lecture7-3.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GuitarsAI/ADSP_Tutorials/9dc1a9599908951ed47b1c169c4b7f0438eae93d/images/Lecture7-3.PNG -------------------------------------------------------------------------------- /images/Lecture7-6.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GuitarsAI/ADSP_Tutorials/9dc1a9599908951ed47b1c169c4b7f0438eae93d/images/Lecture7-6.PNG -------------------------------------------------------------------------------- /images/Lecture8-1.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GuitarsAI/ADSP_Tutorials/9dc1a9599908951ed47b1c169c4b7f0438eae93d/images/Lecture8-1.PNG -------------------------------------------------------------------------------- /images/Lecture8-2.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GuitarsAI/ADSP_Tutorials/9dc1a9599908951ed47b1c169c4b7f0438eae93d/images/Lecture8-2.PNG -------------------------------------------------------------------------------- /images/Lecture8-3.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GuitarsAI/ADSP_Tutorials/9dc1a9599908951ed47b1c169c4b7f0438eae93d/images/Lecture8-3.PNG -------------------------------------------------------------------------------- /images/Lecture8-4.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GuitarsAI/ADSP_Tutorials/9dc1a9599908951ed47b1c169c4b7f0438eae93d/images/Lecture8-4.PNG -------------------------------------------------------------------------------- /images/Lecture8-5.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GuitarsAI/ADSP_Tutorials/9dc1a9599908951ed47b1c169c4b7f0438eae93d/images/Lecture8-5.PNG -------------------------------------------------------------------------------- /images/Lecture8-6.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GuitarsAI/ADSP_Tutorials/9dc1a9599908951ed47b1c169c4b7f0438eae93d/images/Lecture8-6.PNG -------------------------------------------------------------------------------- /images/Lecture8-7.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GuitarsAI/ADSP_Tutorials/9dc1a9599908951ed47b1c169c4b7f0438eae93d/images/Lecture8-7.PNG -------------------------------------------------------------------------------- /images/Lecture8-8.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GuitarsAI/ADSP_Tutorials/9dc1a9599908951ed47b1c169c4b7f0438eae93d/images/Lecture8-8.PNG -------------------------------------------------------------------------------- /images/Lecture9-2.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GuitarsAI/ADSP_Tutorials/9dc1a9599908951ed47b1c169c4b7f0438eae93d/images/Lecture9-2.PNG -------------------------------------------------------------------------------- /images/Lecture9-3.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GuitarsAI/ADSP_Tutorials/9dc1a9599908951ed47b1c169c4b7f0438eae93d/images/Lecture9-3.PNG -------------------------------------------------------------------------------- /images/adsp_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GuitarsAI/ADSP_Tutorials/9dc1a9599908951ed47b1c169c4b7f0438eae93d/images/adsp_logo.png -------------------------------------------------------------------------------- /images/aliasing_components.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GuitarsAI/ADSP_Tutorials/9dc1a9599908951ed47b1c169c4b7f0438eae93d/images/aliasing_components.PNG -------------------------------------------------------------------------------- /images/companding_block.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GuitarsAI/ADSP_Tutorials/9dc1a9599908951ed47b1c169c4b7f0438eae93d/images/companding_block.png -------------------------------------------------------------------------------- /images/diagram.drawio: -------------------------------------------------------------------------------- 1 | 7Vxbd6M2EP41Pqd9cA5IgPFjnLjdh+2ebNOzbR9lkDFdQFTIib2/vhJI2FwcY2OwG7IvC7qM5PnmmxmNOBnBh3DzK0Xx6jfi4mAENHczgo8jAHQN2vw/0bLNWkyoZw0e9V05aNfw7P/AaqZsXfsuTgoDGSEB8+Nio0OiCDus0IYoJa/FYUsSFFeNkYcrDc8OCqqtf/ouW8lWXdN2HZ+w763k0rYpOxbI+e5Rso7keiMAl+m/rDtESpYcn6yQS173muB8BB8oISx7CjcPOBC6VWrL5v1yoDffN8URazLhD/L6+/PsngZfXWQ/ft0+zT+9jKWUFxSssfoZVsDlzRb8wRMPqmFJ+Dr8Z7CtVJ3175qojnGSAnvPB+h2vNl1KimLkTnTRuajksb3mQksLsKb9xYGhfUAoz6KPPE2e135DD/HyBFdr9wyeduKhQF/0/kjCnwv4s8BXgpJCaPkew4vFC0KDC1f6AVThjcHlavnkHEqYBJiRrd8iJwAbImyZIF6fd2ZlCWbVvvGJNuQNGIvF7wDkj9ILE/AdVKDa0mb2OU8kK+EshXxSISC+a51lho3dqWWdmM+ExJLRf+DGdtKUqM1I0UYGuld7ONtrfNtkzV18Bu/F0rPgaiH2RvjQD2KFAeI+S/FfVwcFPgW2Y4Ti2umhlg/lIxkHas2QeucT3vtjVh2jFpJnLnhpb8RttEDuQzDLJALaFV22X2yS8WuwdCrLW3k1CfipzFE4jqZgAKuOigBltFZziphlm/jfBjBcRSF3fo8WfiMFjh4IonPfCICy4IwRsKyxl2UrHJAVQxyuLYxLSKnxN7LMUwgLmTFYt1w44lc6w4HnGlUjLtDCw42cthdsg5rkb8EzaxiDJuaFZaZNSwzu2KZNTCSqey36xhWT0YIi+hXyJjtv0LGiiBjckRQx6zWq7TenprDAoOH2jRelqItz2Kjt7LYcsaKN6w+M829QtkVhL7rZpaL+X7QIhUlLC0WCktVaM7EFvhyXBy312zbqXSxGWnJwOglNk9Kia+uNfMasLPYbN6E2zgLicu4kaa58AFgW/qRHO1r0f9wln0S+yvU33xwv8T9HNpb4T6ouv5b4D5XJ93+JeWlL3+LlztTvT5u9jsft/tvT5j6XDvCXtLGHh2J3dSRTDvxJIZRNC9o9exJ7IOepIPimD6c4hgEV66Ogds4v18xR5g2pDZsyex2qdz0OExDPqBDeOUTOrfa4zyK3HtxTcPfIhLhXhhQ1WBDDbXNfcGRiNX0DF0W1HtlrMkhagesE6Ak8Z1usqCLecXjeYz9LoxHLxVgjL6Npy5vGlJ0BVZTg2ubOLfz3nUF1o/7qAZxuHQflR9UrnUfBeoSJYlCjKLDYC5R6AfbDE7ehcI41RCEKWEyO+eTUZQIBVFSGZPOe6ibTQlPwU6ZkKQbXVIUOX7inDQTe0Tsc+0fniR+wzjhZ+mlaEo7SuZspuYs+1KjGyeZ1YneiNAQBXn/7uOPsUMCQrNB1Fv8BEwzX7T0/HNNPXkORvZsdD/fJ0gK2WCrSuX7AxNW2QX7zHLVB02DjWdQqwesbX3HLrpRc9pvnqKM6CP+tYx/FoDXjX+wruY/KIaChhlnayq3wwkcx2nIBZ3JxK4QqdeCDryNby7eyQUKNJqyEnQTYEsVBVuVdfoKsHXlwbYXKLV3s+IC5ct4QFcoE6sacnu9QoFNvjAecOnX1mBRxLmlXwhKgrombZPq3bsr/Wau6n9vPOXS71Tr90hl3EYiXrCSqhEdNE/9AunFBfMHVVa81gcY5pU/wDDqDuhnx+wTjUKFeJqxnRslQ/IoMtZtIWMZ+PE3KfwCId6qOP4rfyVhVOteKP9Q5cbKkhfRv13Uv1G9Xa/Tf2dfsxltb9dPtPhbT7Eml7ogLQvq+3bduMDt+rkhTruzrUmvYe5o9DLeh1VZpSOa2bNVWQ2i5Ufu1Tj3anqH31HtxlTe/9CRoGsf1aAS+J5yr6K2r15eMarlFZF7nVwtg3XVsi8HimTjW0vt9Nw45Hb0S2CtSlcK62kV67p4U3bnF8PabHJoHnCeZ5eLGOfmeX2fXy3Qe543GGzL2VZF0NnY8tfdH2XJhu/+8g2c/wc= -------------------------------------------------------------------------------- /images/diagram.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GuitarsAI/ADSP_Tutorials/9dc1a9599908951ed47b1c169c4b7f0438eae93d/images/diagram.png -------------------------------------------------------------------------------- /images/diagram2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GuitarsAI/ADSP_Tutorials/9dc1a9599908951ed47b1c169c4b7f0438eae93d/images/diagram2.png -------------------------------------------------------------------------------- /images/fir_filter_diag.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GuitarsAI/ADSP_Tutorials/9dc1a9599908951ed47b1c169c4b7f0438eae93d/images/fir_filter_diag.PNG -------------------------------------------------------------------------------- /images/lecture10_allpass.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GuitarsAI/ADSP_Tutorials/9dc1a9599908951ed47b1c169c4b7f0438eae93d/images/lecture10_allpass.jpg -------------------------------------------------------------------------------- /images/lloyd_max.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GuitarsAI/ADSP_Tutorials/9dc1a9599908951ed47b1c169c4b7f0438eae93d/images/lloyd_max.PNG -------------------------------------------------------------------------------- /images/mu_law.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GuitarsAI/ADSP_Tutorials/9dc1a9599908951ed47b1c169c4b7f0438eae93d/images/mu_law.png -------------------------------------------------------------------------------- /images/mu_law_graph.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GuitarsAI/ADSP_Tutorials/9dc1a9599908951ed47b1c169c4b7f0438eae93d/images/mu_law_graph.png -------------------------------------------------------------------------------- /images/pdf_a.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GuitarsAI/ADSP_Tutorials/9dc1a9599908951ed47b1c169c4b7f0438eae93d/images/pdf_a.png -------------------------------------------------------------------------------- /images/rise_tread_quantizers.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GuitarsAI/ADSP_Tutorials/9dc1a9599908951ed47b1c169c4b7f0438eae93d/images/rise_tread_quantizers.png -------------------------------------------------------------------------------- /images/saw_tooth.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GuitarsAI/ADSP_Tutorials/9dc1a9599908951ed47b1c169c4b7f0438eae93d/images/saw_tooth.png -------------------------------------------------------------------------------- /images/sphere_dense_1.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GuitarsAI/ADSP_Tutorials/9dc1a9599908951ed47b1c169c4b7f0438eae93d/images/sphere_dense_1.PNG -------------------------------------------------------------------------------- /images/sphere_dense_2.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GuitarsAI/ADSP_Tutorials/9dc1a9599908951ed47b1c169c4b7f0438eae93d/images/sphere_dense_2.PNG -------------------------------------------------------------------------------- /images/triang.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GuitarsAI/ADSP_Tutorials/9dc1a9599908951ed47b1c169c4b7f0438eae93d/images/triang.png -------------------------------------------------------------------------------- /images/voronoi.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GuitarsAI/ADSP_Tutorials/9dc1a9599908951ed47b1c169c4b7f0438eae93d/images/voronoi.png --------------------------------------------------------------------------------