Skip to content

Commit

Permalink
Update links to match correct equation
Browse files Browse the repository at this point in the history
  • Loading branch information
hagenw committed Mar 18, 2019
1 parent 3ee12c5 commit a9de4a2
Show file tree
Hide file tree
Showing 20 changed files with 43 additions and 55 deletions.
8 changes: 4 additions & 4 deletions SFS_general/secondary_source_selection.m
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@
% a = <
% \ 0, else
%
% See https://sfs.rtfd.io/en/3.2/#equation-wfs.pw.selection
% https://sfs.rtfd.io/en/3.2/d_wfs/#equation-wfs-secondary-source-selection-plane
%
% Direction of plane wave (nk) is set above
idx = nx0*nk(:) >= eps;
Expand All @@ -111,7 +111,7 @@
% a = <
% \ 0, else
%
% See https://sfs.rtfd.io/en/3.2/#equation-wfs.ps.selection
% https://sfs.rtfd.io/en/3.2/d_wfs/#equation-wfs-secondary-source-selection-point
%
idx = sum(nx0.*x0,2) - nx0*xs(1:3).' >= -2*eps;

Expand All @@ -126,7 +126,7 @@
% where v = x0-xs - <x0-xs,nxs > nxs,
% and |nxs| = 1.
%
% See https://sfs.rtfd.io/en/3.2/#equation-wfs.ls.selection
% https://sfs.rtfd.io/en/3.2/d_wfs/#equation-wfs-secondary-source-selection-line
%
%NOTE: We don't check if we are in a 2D or 3D scenario and use xs(4:6)
% whenever it is present. This can only provide problems if you use the
Expand All @@ -152,7 +152,7 @@
% a = <
% \ 0, else
%
% See https://sfs.rtfd.io/en/3.2/#equation-wfs.fs.selection
% https://sfs.rtfd.io/en/3.2/d_wfs/#equation-wfs-secondary-source-selection-focused
%
nxs = xs(4:6); % vector for orientation of focused source
xs = xs(1:3); % vector for position of focused source
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@
% 2pi r0 m=-N (2)
% Hm(w/c r0)
%
% See https://sfs.rtfd.io/en/3.2/#equation-D.nfchoa.ls.2D
% https://sfs.rtfd.io/en/3.2/d_nfchoa/#equation-fd-nfchoa-line-2d
%
for m=-N:N
D = D + 1 ./ (2.*pi.*r0) ...
Expand Down Expand Up @@ -126,8 +126,6 @@
% 2r0 m=-N (2)
% w/c h|m|(w/c r0)
%
% See https://sfs.rtfd.io/en/3.2/#equation-D.nfchoa.ls.2.5D
%
for m=-N:N
D = D + 1 ./ (2.*r0) ...
.* win(abs(m)+1) ...
Expand Down Expand Up @@ -166,8 +164,6 @@
% m
% x Yn(beta0,alpha0)
%
% See https://sfs.rtfd.io/en/3.2/#equation-D.nfchoa.ls.3D
%
for n=-N:N
for m=-n:n
D = D + 1 ./ (2.*r0.^2) ...
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@
% 2pi r0 m=-N (2)
% h|m|(w/c r0)
%
% See https://sfs.rtfd.io/en/3.2/#equation-D.nfchoa.ps.2.5D
% https://sfs.rtfd.io/en/3.2/d_nfchoa/#equation-fd-nfchoa-point-25d
for m=-N:N
D = D + 1 ./ (2.*pi.*r0) ...
.* win(abs(m)+1) ...
Expand Down Expand Up @@ -144,7 +144,7 @@
% m
% x Yn(theta0,phi0)
%
% See https://sfs.rtfd.io/en/3.2/#equation-D.nfchoa.ps.3D
% https://sfs.rtfd.io/en/3.2/d_nfchoa/#equation-fd-nfchoa-point-3d
%
for n=0:N
for m=-n:n
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@
% pi r0 m=-N (2)
% Hm(w/c r0)
%
% See https://sfs.rtfd.io/en/3.2/#equation-D.nfchoa.pw.2D
% https://sfs.rtfd.io/en/3.2/d_nfchoa/#equation-fd-nfchoa-plane-2d
%
for m=-N:N
D = D - 2.*1i ./ (pi.*r0) ...
Expand Down Expand Up @@ -122,7 +122,7 @@
% r0 m=-N (2)
% i w/c h|m|(w/c r0)
%
% See https://sfs.rtfd.io/en/3.2/#equation-D.nfchoa.pw.2.5D
% https://sfs.rtfd.io/en/3.2/d_nfchoa/#equation-fd-nfchoa-plane-25d
%
for m=-N:N
D = D - 2./r0 ...
Expand Down Expand Up @@ -154,7 +154,7 @@
% m
% x Yn(theta0,phi0)
%
% See https://sfs.rtfd.io/en/3.2/#equation-D.nfchoa.pw.3D
% https://sfs.rtfd.io/en/3.2/d_nfchoa/#equation-fd-nfchoa-plane-3d
%
for n=0:N
for m=-n:n
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@
% \ ----------_-_-_-_-_-_---------, |kx|>|w/c|
% K1( \|kx^2-(w/c)^2 yref )
%
% See https://sfs.rtfd.io/en/3.2/#equation-D.sdm.ps.2.5D
% https://sfs.rtfd.io/en/3.2/d_nfchoa/#equation-fd-sdm-point-25d
%
D(idxpr) = exp(1i*kx(idxpr)*xs(1)) .* ...
besselh(1,2,sqrt( (omega/c)^2 - kx(idxpr).^2 )*abs(xref(2)-xs(2))) ./ ...
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@
% H0 | - nky*xrefy |
% \c /
%
% See https://sfs.rtfd.io/en/3.2/#equation-D.sdm.pw.2.5D
% https://sfs.rtfd.io/en/3.2/d_nfchoa/#equation-fd-sdm-plane-25d
%
idx = find(kx>=omega/c*nk(:,1),1,'first');
D(idx) = 4*1i*exp(-1i*omega/c*nk(2).*xref(2)) / ...
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@
% H0 | - nky*xrefy |
% \c /
%
% See https://sfs.rtfd.io/en/3.2/#equation-D.sdm.pw.2.5D
% https://sfs.rtfd.io/en/3.2/d_nfchoa/#equation-fd-sdm-plane-25d
%
D = 4*1i.*exp(-1i*omega/c.*nk(:,2).*xref(:,2)) ./ ...
besselh(0,2,omega/c.*nk(:,2).*xref(:,2)) .* ...
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@
% D(x0,w) = --- --- ----------- e^(i w/c |x0-xs|)
% 2pi c |x0-xs|^2
%
% See https://sfs.rtfd.io/en/3.2/#equation-D.wfs.fs
% https://sfs.rtfd.io/en/3.2/d_wfs/#equation-fd-wfs-focused-3d
%
% r = |x0-xs|
r = vector_norm(x0-xs,2);
Expand Down Expand Up @@ -141,8 +141,6 @@
% D(x0,w) = - -- --------- H1 | - |x0-xs| |
% 2c |x0-xs| \ c /
%
% See https://sfs.rtfd.io/en/3.2/#equation-D.wfs.fs.ls
%
% r = |x0-xs|
r = vector_norm(x0-xs,2);
% Driving signal
Expand Down Expand Up @@ -199,7 +197,7 @@
% D_2.5D(x0,w) = g0 _ |--- _ |--- ------------- e^(i w/c |x0-xs|)
% \|2pi \| c |x0-xs|^(3/2)
%
% See https://sfs.rtfd.io/en/3.2/en/update_wfs_ps/#equation-D.wfs.fs.2.5D
% https://sfs.rtfd.io/en/3.2/d_wfs/#equation-fd-wfs-focused-25d
%
% Driving signal
D = 1./sqrt(2.*pi) .* sqrt(-1i.*omega./c) .* g0 ...
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@
% D(x0,w) = - -- ----------- H1 | - |x0-xs| |
% 2c |x0-xs| \ c /
%
% See https://sfs.rtfd.io/en/3.2/#equation-D.wfs.ls
% https://sfs.rtfd.io/en/3.2/d_wfs/#equation-fd-wfs-line
%
% r = |x0-xs|
r = vector_norm(x0-xs,2);
Expand Down Expand Up @@ -122,7 +122,7 @@
% D_2.5D(x0,w) = - -- _ |--- ----------- H1 | - |x0-xs| |
% 2 \| c |x0-xs| \ c /
%
% See https://sfs.rtfd.io/en/3.2/#equation-D.wfs.ls.2.5D
% https://sfs.rtfd.io/en/3.2/d_wfs/#equation-fd-wfs-line-25d
%
% r = |x0-xs|
r = vector_norm(x0-xs,2);
Expand Down Expand Up @@ -152,8 +152,7 @@
% where v = x0-xs - <x0-xs,nxs > nxs,
% and |nxs| = 1.
%
% See https://sfs.rtfd.io/en/3.2/#equation-d.wfs.ls
% and https://sfs.rtfd.io/en/3.2/#equation-v.ls
% https://sfs.rtfd.io/en/3.2/d_wfs/#equation-fd-wfs-line
%
% v = (I - nxs'nxs)(x0-xs)
% r = |v|
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@
% D(x0,w) = --- --- ----------- e^(-i w/c |x0-xs|)
% 2pi c |x0-xs|^2
%
% See https://sfs.rtfd.io/en/3.2/#equation-D.wfs.ps
% https://sfs.rtfd.io/en/3.2/d_wfs/#equation-fd-wfs-point
%
% r = |x0-xs|
r = vector_norm(x0-xs,2);
Expand All @@ -110,7 +110,7 @@
% D(x0,w) = --- | --- - ------- | ----------- e^(-i w/c |x0-xs|)
% 2pi \ c |x0-xs| / |x0-xs|^2
%
% See https://sfs.rtfd.io/en/3.2/#equation-D.wfs.ps.woapprox
% https://sfs.rtfd.io/en/3.2/d_wfs/#equation-fd-wfs-point-woapprox
%
% r = |x0-xs|
r = vector_norm(x0-xs,2);
Expand Down Expand Up @@ -186,7 +186,7 @@
% g0 _ |--- _ |--- ------------- e^(-i w/c |x0-xs|)
% \|2pi \| c |x0-xs|^(3/2)
%
% See https://sfs.rtfd.io/en/3.2/#equation-D.wfs.ps.2.5D
% https://sfs.rtfd.io/en/3.2/d_wfs/#equation-fd-wfs-point-25d
%
% Driving signal
D = 1./sqrt(2*pi) .* sqrt(1i.*omega./c) .* g0 ...
Expand Down Expand Up @@ -214,7 +214,7 @@
% g0 _ |--- _ |--- ------------- e^(-i w/c |x0-xs|)
% \|2pi \| c |x0-xs|^(3/2)
%
% See https://sfs.rtfd.io/en/3.2/#equation-D.wfs.ps.2.5D.refline
% https://sfs.rtfd.io/en/3.2/d_wfs/#equation-fd-wfs-point-25d-refline
%
% r = |x0-xs|
r = vector_norm(x0-xs,2);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@
% D(x0,w) = 2 --- nk nx0 e^(-i w/c nk x0)
% c
%
% See https://sfs.rtfd.io/en/3.2/#equation-D.wfs.pw
% https://sfs.rtfd.io/en/3.2/d_wfs/#equation-fd-wfs-plane
%
D = 2.*1i.*omega./c .* vector_product(nk,nx0,2) ...
.* exp(-1i.*omega./c.*vector_product(nk,x0,2));
Expand Down Expand Up @@ -119,7 +119,7 @@
% D_2.5D(x0,w) = 2g0 nk nx0 _ |--- e^(-i w/c nk x0)
% \| c
%
% See https://sfs.rtfd.io/en/3.2/#equation-D.wfs.pw.2.5D
% https://sfs.rtfd.io/en/3.2/d_wfs/#equation-fd-wfs-plane-25d
%
D = 2.*g0 .* vector_product(nk,nx0,2) .* sqrt(1i.*omega./c) ...
.* exp(-1i.*omega./c.*vector_product(nk,x0,2));
Expand Down
8 changes: 3 additions & 5 deletions SFS_monochromatic/greens_function_mono.m
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@
% G(x-xs,w) = --- -----------------
% 4pi |x-xs|
%
% See https://sfs.rtfd.io/en/3.2/#equation-S.ps
% https://sfs.rtfd.io/en/3.2/sources/#equation-fd-point
%
G = 1/(4*pi) * exp(-1i*omega/c .* sqrt((x-xs(1)).^2+(y-xs(2)).^2+(z-xs(3)).^2)) ./ ...
sqrt((x-xs(1)).^2+(y-xs(2)).^2+(z-xs(3)).^2);
Expand All @@ -86,8 +86,6 @@
% ---- G(x-xs,w) = --- | ----- + ------- | ----------- e^(-i w/c |x-xs|)
% d ns 4pi \ c |x-xs| / |x-xs|^2
%
% See https://sfs.rtfd.io/en/3.2/#equation-S.dps
%
% r = |x-xs|
r = sqrt((x-xs(1)).^2+(y-xs(2)).^2+(z-xs(3)).^2);
% scalar = (x-xs) nxs
Expand All @@ -102,7 +100,7 @@
% G(x-xs,w) = - - H0 | - |x-xs| |
% 4 \ c /
%
% See https://sfs.rtfd.io/en/3.2/#equation-S.ls
% https://sfs.rtfd.io/en/3.2/sources/#equation-fd-line
%
G = -1i/4 * besselh(0,2,omega/c* ...
sqrt( (x-xs(1)).^2 + (y-xs(2)).^2 + (z-xs(3)).^2 ));
Expand All @@ -112,7 +110,7 @@
%
% G(x,w) = e^(-i w/c n x)
%
% See: https://sfs.rtfd.io/en/3.2/#equation-S.pw
% https://sfs.rtfd.io/en/3.2/sources/#equation-fd-plane
%
% Direction of plane wave
nxs = xs(:,1:3) / norm(xs(:,1:3));
Expand Down
2 changes: 1 addition & 1 deletion SFS_monochromatic/sound_field_mono.m
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@
% P(x,omega) = | D(x0,omega) G(x-x0,omega) dx0
% /
%
% See https://sfs.rtfd.io/en/3.2/#equation-single-layer
% https://sfs.rtfd.io/en/3.2/problem/#equation-single-layer
%
% x0(ii,7) is a weight for the single secondary sources which includes for
% example a tapering window for WFS or a weighting of the sources for
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@
% d(x0,t) = h(t) * --- ----------- delta(t+|x0-xs|/c)
% 2pi |x0-xs|^2
%
% See https://sfs.rtfd.io/en/3.2/#equation-d.wfs.fs
% https://sfs.rtfd.io/en/3.2/d_wfs/#equation-td-wfs-focused-3d
%
% r = |x0-xs|
r = vector_norm(x0-xs,2);
Expand All @@ -110,7 +110,7 @@
% d(x0,t) = h(t) * _ |--- ------------- delta(t+|x0-xs|/c)
% \|2pi |x0-xs|^(3/2)
%
% See https://sfs.rtfd.io/en/3.2/#equation-d.wfs.fs.ls
% https://sfs.rtfd.io/en/3.2/d_wfs/#equation-td-wfs-focused-2d
%
% r = |x0-xs|
r = vector_norm(x0-xs,2);
Expand Down Expand Up @@ -167,7 +167,7 @@
% d_2.5D(x0,t) = h_pre(-t) * g0 _ |--- ------------- delta(t+|x0-xs|/c)
% \|2pi |x0-xs|^(3/2)
%
% See https://sfs.rtfd.io/en/3.2/#equation-d.wfs.fs.2.5D
% https://sfs.rtfd.io/en/3.2/d_wfs/#equation-td-wfs-focused-25d
%
% Delay and amplitude weight
delay = -1./c .* r;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@
% d(x0,t) = h(t) * _ |--- ------------- delta(t-|x0-xs|/c)
% \|2pi |x0-xs|^(3/2)
%
% See https://sfs.rtfd.io/en/3.2/#equation-d.wfs.ls
% https://sfs.rtfd.io/en/3.2/d_wfs/#equation-td-wfs-line
%
% r = |x0-xs|
r = vector_norm(x0-xs,2);
Expand Down Expand Up @@ -134,8 +134,7 @@
% where v = x0-xs - <x0-xs,nxs > nxs,
% and |nxs| = 1.
%
% See https://sfs.rtfd.io/en/3.2/#equation-d.wfs.ls
% and https://sfs.rtfd.io/en/3.2/#equation-v.ls
% https://sfs.rtfd.io/en/3.2/d_wfs/#equation-td-wfs-line
%
% v = (I - nxs'nxs)(x0-xs)
% r = |v|
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@
% d(x0,t) = h(t) * --- ----------- delta(t-|x0-xs|/c)
% 2pi |x0-xs|^2
%
% See https://sfs.rtfd.io/en/3.2/#equation-d.wfs.ps
% https://sfs.rtfd.io/en/3.2/d_wfs/#equation-td-wfs-point
%
% r = |x0-xs|
r = vector_norm(x0-xs,2);
Expand Down Expand Up @@ -142,7 +142,7 @@
% d_2.5D(x0,t) = h_pre(t) * g0 _ |--- ------------- delta(t-|x0-xs|/c)
% \|2pi |x0-xs|^(3/2)
%
% See https://sfs.rtfd.io/en/3.2/#equation-d.wfs.ps.2.5D
% https://sfs.rtfd.io/en/3.2/d_wfs/#equation-td-wfs-point-25d
%
% Delay and amplitude weight
delay = 1./c .* r;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@
%
% d_2D(x0,t) = h(t) * 2 nk nx0 delta(t - 1/c nk x0)
%
% See https://sfs.rtfd.io/en/3.2/#equation-d.wfs.pw
% https://sfs.rtfd.io/en/3.2/d_wfs/#equation-td-wfs-plane
%
% Delay and amplitude weight
delay = 1./c .* vector_product(nk,x0,2);
Expand Down Expand Up @@ -111,7 +111,7 @@
%
% d_2.5D(x0,t) = h(t) * 2 g0 nk nx0 delta(t - 1/c nk x0)
%
% See https://sfs.rtfd.io/en/3.2/en/update_wfs_ps/#equation-d.wfs.pw.2.5D
% https://sfs.rtfd.io/en/3.2/d_wfs/#equation-td-wfs-plane-25d
%
% Delay and amplitude weight
delay = 1./c .* vector_product(nk,x0,2);
Expand Down
Loading

0 comments on commit a9de4a2

Please sign in to comment.