Skip to content

Commit f30681e

Browse files
committed
Driving functions for focused sources by WFS
1 parent c9dce87 commit f30681e

File tree

1 file changed

+48
-0
lines changed

1 file changed

+48
-0
lines changed

sfs/mono/drivingfunction.py

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,54 @@ def wfs_25d_plane(omega, x0, n0, n=[0, 1, 0], xref=[0, 0, 0], c=None,
113113
wfs_3d_plane = _wfs_plane
114114

115115

116+
def _wfs_focused(omega, x0, n0, xs, ns, c=None):
117+
"""Focused source by two- or three-dimensional WFS.
118+
119+
::
120+
121+
(x0-xs) n0
122+
D(x0,k) = j k ------------- e^(j k |x0-xs|)
123+
|x0-xs|^(3/2)
124+
125+
"""
126+
x0 = np.asarray(x0)
127+
n0 = np.asarray(n0)
128+
xs = np.squeeze(np.asarray(xs))
129+
k = util.wavenumber(omega, c)
130+
ds = x0 - xs
131+
r = np.linalg.norm(ds, axis=1)
132+
return 1j * k * inner1d(ds, n0) / r ** (3 / 2) * np.exp(1j * k * r)
133+
134+
135+
wfs_2d_focused = _wfs_focused
136+
137+
138+
def wfs_25d_focused(omega, x0, n0, xs, xref=[0, 0, 0], c=None, omalias=None):
139+
"""Focused source by 2.5-dimensional WFS.
140+
141+
::
142+
143+
____________ (x0-xs) n0
144+
D(x0,w) = \|j k |xref-x0| ------------- e^(j k |x0-xs|)
145+
|x0-xs|^(3/2)
146+
147+
"""
148+
x0 = np.asarray(x0)
149+
n0 = np.asarray(n0)
150+
xs = np.squeeze(np.asarray(xs))
151+
xref = np.squeeze(np.asarray(xref))
152+
k = util.wavenumber(omega, c)
153+
ds = x0 - xs
154+
r = np.linalg.norm(ds, axis=1)
155+
156+
return wfs_25d_preeq(omega, omalias, c) * \
157+
np.sqrt(np.linalg.norm(xref - x0)) * inner1d(ds, n0) / \
158+
r ** (3 / 2) * np.exp(1j * k * r)
159+
160+
161+
wfs_3d_focused = _wfs_focused
162+
163+
116164
def wfs_25d_preeq(omega, omalias, c):
117165
"""Preqeualization for 2.5D WFS."""
118166
if omalias is None:

0 commit comments

Comments
 (0)