Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit db1b6a5

Browse files
committed
Preequalization of 2.5D Wave Field Synthesis wrt given aliasing frequency
1 parent 02e58ea commit db1b6a5

File tree

1 file changed

+19
-4
lines changed

1 file changed

+19
-4
lines changed

sfs/mono/drivingfunction.py

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ def _wfs_point(omega, x0, n0, xs, c=None):
4949
wfs_2d_point = _wfs_point
5050

5151

52-
def wfs_25d_point(omega, x0, n0, xs, xref=[0, 0, 0], c=None):
52+
def wfs_25d_point(omega, x0, n0, xs, xref=[0, 0, 0], c=None, omalias=None):
5353
"""Point source by 2.5-dimensional WFS.
5454
5555
::
@@ -66,7 +66,9 @@ def wfs_25d_point(omega, x0, n0, xs, xref=[0, 0, 0], c=None):
6666
k = util.wavenumber(omega, c)
6767
ds = x0 - xs
6868
r = np.linalg.norm(ds, axis=1)
69-
return np.sqrt(1j * k * np.linalg.norm(xref - x0)) * inner1d(ds, n0) / \
69+
70+
return wfs_25d_preeq(omega, omalias, c) * \
71+
np.sqrt(np.linalg.norm(xref - x0)) * inner1d(ds, n0) / \
7072
r ** (3 / 2) * np.exp(-1j * k * r)
7173

7274

@@ -91,7 +93,8 @@ def _wfs_plane(omega, x0, n0, n=[0, 1, 0], c=None):
9193
wfs_2d_plane = _wfs_plane
9294

9395

94-
def wfs_25d_plane(omega, x0, n0, n=[0, 1, 0], xref=[0, 0, 0], c=None):
96+
def wfs_25d_plane(omega, x0, n0, n=[0, 1, 0], xref=[0, 0, 0], c=None,
97+
omalias=None):
9598
"""Plane wave by 2.5-dimensional WFS.
9699
97100
::
@@ -105,13 +108,25 @@ def wfs_25d_plane(omega, x0, n0, n=[0, 1, 0], xref=[0, 0, 0], c=None):
105108
n = np.squeeze(np.asarray(n))
106109
xref = np.squeeze(np.asarray(xref))
107110
k = util.wavenumber(omega, c)
108-
return np.sqrt(2*np.pi * 1j * k * np.linalg.norm(xref - x0)) * \
111+
return wfs_25d_preeq(omega, omalias, c) * \
112+
np.sqrt(2*np.pi * np.linalg.norm(xref - x0)) * \
109113
np.inner(n, n0) * np.exp(-1j * k * np.inner(n, x0))
110114

111115

112116
wfs_3d_plane = _wfs_plane
113117

114118

119+
def wfs_25d_preeq(omega, omalias, c):
120+
"""Preqeualization for 2.5D WFS"""
121+
if omalias is None:
122+
return np.sqrt(1j * util.wavenumber(omega, c))
123+
else:
124+
if omega <= omalias:
125+
return np.sqrt(1j * util.wavenumber(omega, c))
126+
else:
127+
return np.sqrt(1j * util.wavenumber(omalias, c))
128+
129+
115130
def delay_3d_plane(omega, x0, n0, n=[0, 1, 0], c=None):
116131
"""Plane wave by simple delay of secondary sources."""
117132
x0 = np.asarray(x0)

0 commit comments

Comments
 (0)