Skip to content

Commit

Permalink
Establish line sink as default driving function for 2D WFS focused so…
Browse files Browse the repository at this point in the history
…urce
  • Loading branch information
Fiete Winter authored and hagenw committed Mar 3, 2017
1 parent c068dc6 commit 6f8975a
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@
%
% DRIVING_FUNCTION_MONO_WFS_FS(x0,xs,f,src,conf) returns WFS driving signals
% for the given secondary sources, the virtual focused source position and the
% frequency f.
% frequency f. For 3D and 2.5D the default behavior is to use a focused point
% source as source model, for 2D a focused line source is used instead.
%
% See also: driving_function_mono_wfs, driving_function_imp_wfs_ps

Expand Down Expand Up @@ -71,14 +72,14 @@
end


%% ===== Configuration ==================================================
%% ===== Configuration ===================================================
xref = conf.xref;
c = conf.c;
dimension = conf.dimension;
driving_functions = conf.driving_functions;


%% ===== Computation ====================================================
%% ===== Computation =====================================================
% Calculate the driving function in time-frequency domain

% Frequency
Expand All @@ -89,6 +90,11 @@

% === 2- or 3-Dimensional ============================================

% For 2D the default focussed source should be a line sink
if strcmp('2D',dimension) && strcmp('default',driving_functions)
driving_functions = 'line_sink';
end

switch driving_functions
case 'default'
% --- SFS Toolbox ------------------------------------------------
Expand Down Expand Up @@ -163,7 +169,6 @@
'for a focused source.'],upper(mfilename),driving_functions);
end


elseif strcmp('2.5D',dimension)

% === 2.5-Dimensional ================================================
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,11 @@

% === 2- or 3-Dimensional ============================================

% For 2D the default focussed source should be a line sink
if strcmp('2D',dimension) && strcmp('default',driving_functions)
driving_functions = 'line_sink';
end

switch driving_functions
case 'default'
% --- SFS Toolbox ------------------------------------------------
Expand All @@ -98,6 +103,21 @@
delay = -1./c .* r;
weight = 1./(2.*pi) .* vector_product(xs-x0,nx0,2) ./ r.^2;
%
case 'line_sink'
% d using a focused line source as source model
% ___
% | 1 (x0-xs) nx0
% d(x0,t) = h(t) * _ |--- ------------- delta(t+|x0-xs|/c)
% \|2pi |x0-xs|^(3/2)
%
% See http:https://sfstoolbox.org/#equation-d.wfs.fs.ls
%
% r = |x0-xs|
r = vector_norm(x0-xs,2);
% Delay and amplitude weight
delay = -1./c .* r;
weight = 1./(2.*pi) .* vector_product(x0-xs,nx0,2) ./ r.^(3./2);
%
case 'legacy'
% --- Old SFS Toolbox default ------------------------------------
% d using a focused point source as source model
Expand Down

0 comments on commit 6f8975a

Please sign in to comment.