Skip to content

Commit ff48bbd

Browse files
committed
use new sfs.util.normalize_rows()
1 parent 71415ba commit ff48bbd

File tree

1 file changed

+2
-17
lines changed

1 file changed

+2
-17
lines changed

doc/examples/wfs-referencing.ipynb

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -25,21 +25,6 @@
2525
"import sfs"
2626
]
2727
},
28-
{
29-
"cell_type": "code",
30-
"execution_count": null,
31-
"metadata": {},
32-
"outputs": [],
33-
"source": [
34-
"# we test the usage of\n",
35-
"# https://github.com/sfstoolbox/sfs-python/pull/194\n",
36-
"def normalize_rows(x):\n",
37-
" \"\"\"Normalize a list of vectors.\"\"\"\n",
38-
" x = sfs.util.asarray_of_rows(x)\n",
39-
" return x / np.linalg.norm(x, axis=1, keepdims=True)\n",
40-
"# to be removed once this is merged"
41-
]
42-
},
4328
{
4429
"cell_type": "markdown",
4530
"metadata": {},
@@ -151,7 +136,7 @@
151136
"# reference contour is a circle with origin xs and radius |xs|\n",
152137
"xref_dist = np.linalg.norm(xs)\n",
153138
"# calc reference contour xref(x0), cf. [Firtha19, eq. (24), (31)]\n",
154-
"xref = xs + xref_dist * normalize_rows(array.x - xs)\n",
139+
"xref = xs + xref_dist * sfs.util.normalize_rows(array.x - xs)\n",
155140
"d, selection, secondary_source = sfs.fd.wfs.point_25d(\n",
156141
" omega, array.x, array.n, xs, xref=xref)\n",
157142
"p_circ = sound_field(\n",
@@ -225,7 +210,7 @@
225210
"\n",
226211
"# plot stationary phase rays\n",
227212
"# one ray connects the virtual source with one activate loudspeaker\n",
228-
"spa = array.x + 3*R * normalize_rows(array.x - xs)\n",
213+
"spa = array.x + 3*R * sfs.util.normalize_rows(array.x - xs)\n",
229214
"plt.plot(\n",
230215
" np.vstack((array.x[selection, 0], spa[selection, 0])),\n",
231216
" np.vstack((array.x[selection, 1], spa[selection, 1])),\n",

0 commit comments

Comments
 (0)