Add new "zero delay" notebook

The new "zero delay the easy way" provides tools for designing digital
filters based on analog prototypes, and analyzing the results, including
plotting frequency response accurately.
master
Raph Levien 10 years ago
parent 4465659857
commit 099ef4146e
  1. 21
      lab/Second order sections in matrix form.ipynb
  2. 1107
      lab/Zero delay the easy way.ipynb

@ -276,10 +276,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"As promised, the rest of the RBJ designs. Note that in this version, for all types other then the shelf filters, the calculation\n",
"of a1, a2, a3 has been reworked a bit to be done directly in terms of sine and cosine of the frequency, rather than tangent in\n",
"Simper's derivation (but should be mathematically equivalent). This version should be slightly faster to compute and also more\n",
"numerically robust."
"As promised, the rest of the RBJ designs."
]
},
{
@ -288,18 +285,10 @@
"input": [
"def svf_core(f, res, m, shelfA = 1):\n",
" k = 2 - 2 * res\n",
" if shelfA == 1:\n",
" s = sin(2 * pi * f)\n",
" rs = 1 / (2 + k * s)\n",
" rc = rs * cos(2 * pi * f)\n",
" a1 = rs + rc\n",
" a2 = s * rs\n",
" a3 = rs - rc\n",
" else:\n",
" g = tan(pi * f) * shelfA\n",
" a1 = 1/(1 + g * (g + k))\n",
" a2 = g * a1\n",
" a3 = g * a2\n",
" g = tan(pi * f) * shelfA\n",
" a1 = 1/(1 + g * (g + k))\n",
" a2 = g * a1\n",
" a3 = g * a2\n",
" A = array([[2*a1 - 1, -2*a2],\n",
" [2*a2, 1 - 2*a3]])\n",
" B = array([2 * a2, 2 * a3])\n",

File diff suppressed because one or more lines are too long
Loading…
Cancel
Save