From fe7b24221b64e9b22ee7fbe3472f53f76409e285 Mon Sep 17 00:00:00 2001 From: Frank Schultz Date: Mon, 17 Apr 2017 11:19:14 +0200 Subject: [PATCH 1/5] initial commit for unified 2.5D WFS framework --- .../driving_function_mono_unified_25d_wfs.m | 114 ++++++++++++++++++ 1 file changed, 114 insertions(+) create mode 100644 SFS_monochromatic/driving_function_mono_unified_25d_wfs.m diff --git a/SFS_monochromatic/driving_function_mono_unified_25d_wfs.m b/SFS_monochromatic/driving_function_mono_unified_25d_wfs.m new file mode 100644 index 00000000..8ef611a8 --- /dev/null +++ b/SFS_monochromatic/driving_function_mono_unified_25d_wfs.m @@ -0,0 +1,114 @@ +function D = driving_function_mono_unified_25d_wfs(x0,xs,src,f,conf) +%DRIVING_FUNCTION_MONO_UNIFIED_25D_WFS returns the driving signal D for WFS +% +% derived from D = driving_function_mono_wfs(x0,xs,src,f,conf) +% Usage: D = driving_function_mono_unified_25d_wfs(x0,xs,src,f,conf) +% +% Input parameters: +% x0 - position and direction of the secondary source / m [nx6] +% xs - position of virtual source or direction of plane +% wave / m [1x3] or [1x6] +% src - source type of the virtual source +% 'pw' - plane wave (xs is the direction of the +% plane wave in this case) +% 'ps' - point source +% 'ls' - line source +% 'fs' - focused source +% f - frequency of the monochromatic source / Hz +% conf - configuration struct (see SFS_config) +% +% Output parameters: +% D - driving function signal [nx1] +% +% References: +% [Sch17] Frank Schultz, Gergely Firtha, Peter Fiala, Sascha Spors (2017): +% "Wave Field Synthesis Driving Functions for Large-Scale Sound +% Reinforcement Using Line Source Arrays." In: Proc. of 142nd Audio Eng. +% Soc. Conv., Berlin, #9722. +% +% [Fir17] Gergely Firtha, Peter Fiala, Frank Schultz, Sascha Spors (2017): +% "Improved Referencing Schemes for 2.5D Wave Field Synthesis Driving +% Functions." In: IEEE/ACM Trans. Audio Speech Language Process., +% DOI 10.1109/TASLP.2017.2689245 +% +% DRIVING_FUNCTION_MONO_WFS(x0,xs,f,src,conf) returns the driving signal for +% the given secondary source and desired source type (src) for WFS for the +% given frequency using the unified 2.5D WFS framework +% +% See also: plot_sound_field, sound_field_mono_wfs_25d, +% driving_function_imp_wfs_25d + +%***************************************************************************** +% The MIT License (MIT) * +% * +% Copyright (c) 2010-2017 SFS Toolbox Developers * +% * +% Permission is hereby granted, free of charge, to any person obtaining a * +% copy of this software and associated documentation files (the "Software"), * +% to deal in the Software without restriction, including without limitation * +% the rights to use, copy, modify, merge, publish, distribute, sublicense, * +% and/or sell copies of the Software, and to permit persons to whom the * +% Software is furnished to do so, subject to the following conditions: * +% * +% The above copyright notice and this permission notice shall be included in * +% all copies or substantial portions of the Software. * +% * +% THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * +% IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * +% FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * +% THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * +% LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * +% FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * +% DEALINGS IN THE SOFTWARE. * +% * +% The SFS Toolbox allows to simulate and investigate sound field synthesis * +% methods like wave field synthesis or higher order ambisonics. * +% * +% http://sfstoolbox.org sfstoolbox@gmail.com * +%***************************************************************************** + + +%% ===== Checking of input parameters ================================== +nargmin = 5; +nargmax = 5; +narginchk(nargmin,nargmax); +isargsecondarysource(x0); +isargxs(xs); +isargpositivescalar(f); +isargchar(src); +isargstruct(conf); + + +%% ===== Computation ==================================================== +% Calculate the driving function in time-frequency domain + +% Secondary source positions and directions +nx0 = x0(:,4:6); +x0 = x0(:,1:3); + +% Source position/direction/orientation +xs = repmat(xs,[size(x0,1) 1]); + +% Get driving signals +if strcmp('pw',src) + % === Plane wave === + % Direction of plane wave + nk = bsxfun(@rdivide,xs,vector_norm(xs(:,1:3),2)); + % Driving signal + %D = driving_function_mono_wfs_pw(x0,nx0,nk,f,conf); + +elseif strcmp('ps',src) + % === Point source === + %D = driving_function_mono_wfs_ps(x0,nx0,xs(:,1:3),f,conf); + +elseif strcmp('ls',src) + % === Line source === + %D = driving_function_mono_wfs_ls(x0,nx0,xs,f,conf); + +elseif strcmp('fs',src) + % === Focused source === + %D = driving_function_mono_wfs_fs(x0,nx0,xs(:,1:3),f,conf); + +else + error('%s: %s is not a known source type.',upper(mfilename),src); +end From 9b9304c1a873a80abdcc92fcb1b3e27f09f0d935 Mon Sep 17 00:00:00 2001 From: Frank Schultz Date: Mon, 17 Apr 2017 14:54:02 +0200 Subject: [PATCH 2/5] initial driving functions for unified 2.5D WFS framework, needs to be checked --- .../driving_function_mono_unified_25d_wfs.m | 82 ++++++++++++++----- 1 file changed, 61 insertions(+), 21 deletions(-) diff --git a/SFS_monochromatic/driving_function_mono_unified_25d_wfs.m b/SFS_monochromatic/driving_function_mono_unified_25d_wfs.m index 8ef611a8..8721beab 100644 --- a/SFS_monochromatic/driving_function_mono_unified_25d_wfs.m +++ b/SFS_monochromatic/driving_function_mono_unified_25d_wfs.m @@ -1,24 +1,31 @@ -function D = driving_function_mono_unified_25d_wfs(x0,xs,src,f,conf) +function [D, xPCS] = driving_function_mono_unified_25d_wfs(x0,xs,dx0,src,f,conf) %DRIVING_FUNCTION_MONO_UNIFIED_25D_WFS returns the driving signal D for WFS % -% derived from D = driving_function_mono_wfs(x0,xs,src,f,conf) -% Usage: D = driving_function_mono_unified_25d_wfs(x0,xs,src,f,conf) +% derived driving_function_mono_wfs(x0,xs,src,f,conf) +% +% Usage: D = driving_function_mono_unified_25d_wfs(x0,xs,dx0,src,f,conf) % % Input parameters: % x0 - position and direction of the secondary source / m [nx6] % xs - position of virtual source or direction of plane % wave / m [1x3] or [1x6] +% dx0 - amplitude factor of unified 2.5D WFS framework +% to obtain amplitude correct synthesis at desired +% locations, i.e. along a definable reference curve, +% this is primary source AND x0 dependent, +% one dx0 per one x0, thus [nx1] % src - source type of the virtual source % 'pw' - plane wave (xs is the direction of the % plane wave in this case) % 'ps' - point source % 'ls' - line source % 'fs' - focused source -% f - frequency of the monochromatic source / Hz +% f - temporal frequency of the monochromatic source / Hz % conf - configuration struct (see SFS_config) % % Output parameters: -% D - driving function signal [nx1] +% D - driving function temporal spectrum [nx1] +% xPCS - locations of amplitude correct synthesis [nx3] % % References: % [Sch17] Frank Schultz, Gergely Firtha, Peter Fiala, Sascha Spors (2017): @@ -31,9 +38,10 @@ % Functions." In: IEEE/ACM Trans. Audio Speech Language Process., % DOI 10.1109/TASLP.2017.2689245 % -% DRIVING_FUNCTION_MONO_WFS(x0,xs,f,src,conf) returns the driving signal for -% the given secondary source and desired source type (src) for WFS for the -% given frequency using the unified 2.5D WFS framework +% DRIVING_FUNCTION_MONO_UNIFIED_25D_WFS(x0,xs,dx0,src,f,conf) +% returns the driving signal for +% the given secondary sources and desired source type (src) for the +% given temporal frequency using the unified 2.5D WFS framework % % See also: plot_sound_field, sound_field_mono_wfs_25d, % driving_function_imp_wfs_25d @@ -69,18 +77,21 @@ %% ===== Checking of input parameters ================================== -nargmin = 5; -nargmax = 5; +nargmin = 6; +nargmax = 6; narginchk(nargmin,nargmax); isargsecondarysource(x0); isargxs(xs); + +%isargdx0(dx0); TBD!!! + isargpositivescalar(f); isargchar(src); isargstruct(conf); %% ===== Computation ==================================================== -% Calculate the driving function in time-frequency domain +% Calculate the driving function in temporal-frequency domain % Secondary source positions and directions nx0 = x0(:,4:6); @@ -89,26 +100,55 @@ % Source position/direction/orientation xs = repmat(xs,[size(x0,1) 1]); -% Get driving signals +%% +% unified 2.5D WFS framework driving function, cf. [(1), Sch17], [(47), Fir17] +% get driving signals +omega = 2*pi*f; +c = conf.c; +w_c = omega/c; +pre = -sqrt(8*pi/(1i*w_c)); + if strcmp('pw',src) % === Plane wave === - % Direction of plane wave - nk = bsxfun(@rdivide,xs,vector_norm(xs(:,1:3),2)); - % Driving signal - %D = driving_function_mono_wfs_pw(x0,nx0,nk,f,conf); - + % directional derivative [(3)&(4), Sch17]: + nk = bsxfun(@rdivide,xs,vector_norm(xs(:,1:3),2)); % propagating direction of plane wave + dP_dn = (-1i*w_c) .*... + vector_product(nk,nx0,2) .*... + exp(-1i.*w_c.*vector_product(nk,x0,2)); + + xPCS = x0 + nk.*repmat(dx0,[1,3]); %get the locations/positions of + %amplitude correct synthesis, [(8), Sch17] + elseif strcmp('ps',src) % === Point source === - %D = driving_function_mono_wfs_ps(x0,nx0,xs(:,1:3),f,conf); + % directional derivative [(15)&(16), Sch17] + r = vector_norm(x0-xs,2); % r = |x0-xs| + dP_dn = (-1i*w_c) .*... + (vector_product(x0-xs,nx0,2)./r) .*... + (exp(-1i.*w_c.*r)./(4*pi*r)); + xPCS = x0 + (x0-xs) .* repmat(dx0./(r-dx0),[1,3]); %get the locations + %/positions of amplitude correct synthesis, [(20), Sch17], + %[(33)&(34), Fir17] + elseif strcmp('ls',src) % === Line source === - %D = driving_function_mono_wfs_ls(x0,nx0,xs,f,conf); + % directional derivative [(10), Sch17] + r = vector_norm(x0-xs,2); % r = |x0-xs| + dP_dn = (1i*w_c)/4 .*... + (vector_product(x0-xs,nx0,2)./r) .*... + besselh(1,2,w_c.*r); + + xPCS = x0 + ((x0-xs)./r).*repmat(dx0,[1,3]); %get the locations/ + %positions of amplitude correct synthesis, [(14), Sch17] elseif strcmp('fs',src) % === Focused source === - %D = driving_function_mono_wfs_fs(x0,nx0,xs(:,1:3),f,conf); - + error('%s: %s is not implemented yet.',upper(mfilename),src); else error('%s: %s is not a known source type.',upper(mfilename),src); end +% put all together for driving function +D = pre .* sqrt(dx0) .* dP_dn; + +end From dab14a1cb411058083f70c9a60e32347aff473d0 Mon Sep 17 00:00:00 2001 From: Frank Schultz Date: Mon, 17 Apr 2017 16:38:32 +0200 Subject: [PATCH 3/5] bugfix: ls xPCS, checked against [Fir17] fig. 9 & 10->ok --- SFS_monochromatic/driving_function_mono_unified_25d_wfs.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SFS_monochromatic/driving_function_mono_unified_25d_wfs.m b/SFS_monochromatic/driving_function_mono_unified_25d_wfs.m index 8721beab..918d738a 100644 --- a/SFS_monochromatic/driving_function_mono_unified_25d_wfs.m +++ b/SFS_monochromatic/driving_function_mono_unified_25d_wfs.m @@ -139,7 +139,7 @@ (vector_product(x0-xs,nx0,2)./r) .*... besselh(1,2,w_c.*r); - xPCS = x0 + ((x0-xs)./r).*repmat(dx0,[1,3]); %get the locations/ + xPCS = x0 + ((x0-xs)./repmat(r,[1,3])).*repmat(dx0,[1,3]); %get the locations/ %positions of amplitude correct synthesis, [(14), Sch17] elseif strcmp('fs',src) From 916fc76cb3d3d9f3afbeb64b63671b28bf71dbc6 Mon Sep 17 00:00:00 2001 From: Frank Schultz Date: Tue, 18 Apr 2017 13:04:05 +0200 Subject: [PATCH 4/5] added test script for unified 2.5D WFS, added sound_field_mono_unified_25d_wfs() to work with driving functions --- .../sound_field_mono_unified_25d_wfs.m | 105 +++++ validation/check_unified_25D_wfs.m | 358 ++++++++++++++++++ 2 files changed, 463 insertions(+) create mode 100644 SFS_monochromatic/sound_field_mono_unified_25d_wfs.m create mode 100644 validation/check_unified_25D_wfs.m diff --git a/SFS_monochromatic/sound_field_mono_unified_25d_wfs.m b/SFS_monochromatic/sound_field_mono_unified_25d_wfs.m new file mode 100644 index 00000000..76cf1932 --- /dev/null +++ b/SFS_monochromatic/sound_field_mono_unified_25d_wfs.m @@ -0,0 +1,105 @@ +function varargout = sound_field_mono_unified_25d_wfs(X,Y,Z,xs,src,f,conf,dx0) +%SOUND_FIELD_MONO_WFS simulates a sound field for WFS +% +% Usage: [P,x,y,z,x0] = sound_field_mono_wfs(X,Y,Z,xs,src,f,conf) +% +% Input parameters: +% X - x-axis / m; single value or [xmin,xmax] or nD-array +% Y - y-axis / m; single value or [ymin,ymax] or nD-array +% Z - z-axis / m; single value or [zmin,zmax] or nD-array +% xs - position of virtual source / m +% src - source type of the virtual source +% 'pw' - plane wave (xs is the direction of the +% plane wave in this case) +% 'ps' - point source +% 'fs' - focused source +% f - monochromatic frequency / Hz +% conf - configuration struct (see SFS_config) +% dx0 - amplitude factor of unified 2.5D WFS framework +% (i.e. the referencing function) +% to obtain amplitude correct synthesis at desired +% locations, i.e. along a definable reference curve, +% this is primary source AND x0 dependent, +% one dx0 per one x0 +% +% Output parameters: +% P - simulated sound field +% x - corresponding x values / m +% y - corresponding y values / m +% z - corresponding z values / m +% x0 - active secondary sources / m +% xPCS - positions/locations of amplitude correct synthesis +% i.e. the reference curve +% SOUND_FIELD_MONO_WFS(X,Y,Z,xs,src,f,conf) simulates a monochromatic sound +% field for the given source type (src) synthesized with wave field synthesis. +% +% To plot the result use: +% plot_sound_field(P,X,Y,Z,x0,conf); +% or simple call the function without output argument: +% sound_field_mono_wfs(X,Y,Z,xs,src,f,conf) +% +% See also: plot_sound_field, sound_field_imp_wfs, driving_function_mono_wfs + +%***************************************************************************** +% The MIT License (MIT) * +% * +% Copyright (c) 2010-2017 SFS Toolbox Developers * +% * +% Permission is hereby granted, free of charge, to any person obtaining a * +% copy of this software and associated documentation files (the "Software"), * +% to deal in the Software without restriction, including without limitation * +% the rights to use, copy, modify, merge, publish, distribute, sublicense, * +% and/or sell copies of the Software, and to permit persons to whom the * +% Software is furnished to do so, subject to the following conditions: * +% * +% The above copyright notice and this permission notice shall be included in * +% all copies or substantial portions of the Software. * +% * +% THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * +% IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * +% FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * +% THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * +% LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * +% FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * +% DEALINGS IN THE SOFTWARE. * +% * +% The SFS Toolbox allows to simulate and investigate sound field synthesis * +% methods like wave field synthesis or higher order ambisonics. * +% * +% http://sfstoolbox.org sfstoolbox@gmail.com * +%***************************************************************************** + + +%% ===== Checking of input parameters ================================== +nargmin = 8; +nargmax = 8; +narginchk(nargmin,nargmax); +isargxs(xs); +isargpositivescalar(f); +isargchar(src); +isargstruct(conf); + + +%% ===== Configuration ================================================== +if strcmp('2D',conf.dimension) + greens_function = 'ls'; +else + greens_function = 'ps'; +end + + +%% ===== Computation ==================================================== +% Get the position of the loudspeakers and its activity +x0 = secondary_source_positions(conf); +x0 = secondary_source_selection(x0,xs,src); +x0 = secondary_source_tapering(x0,conf); + +%% +% Driving function +[D, xPCS] = driving_function_mono_unified_25d_wfs(x0,xs,dx0,src,f,conf); +% Wave field +[varargout{1:min(nargout,4)}] = ... + sound_field_mono(X,Y,Z,x0,greens_function,D,f,conf); +% Return secondary sources if desired +if nargout==5, varargout{5}=x0; end +if nargout==6, varargout{5}=x0; varargout{6}=xPCS; end diff --git a/validation/check_unified_25D_wfs.m b/validation/check_unified_25D_wfs.m new file mode 100644 index 00000000..3ff45a95 --- /dev/null +++ b/validation/check_unified_25D_wfs.m @@ -0,0 +1,358 @@ +% check_unified_25D_wfs() script +% add new functionality to the toolbox: +% we add and check the unified 2.5D WFS framework from +% [Fir17] Gergely Firtha, Peter Fiala, Frank Schultz, Sascha Spors (2017): +% "Improved Referencing Schemes for 2.5D Wave Field Synthesis Driving +% Functions." In: IEEE/ACM Trans. Audio Speech Language Process., +% DOI 10.1109/TASLP.2017.2689245 +% +% [Sch17] Frank Schultz, Gergely Firtha, Peter Fiala, Sascha Spors (2017): +% "Wave Field Synthesis Driving Functions for Large-Scale Sound +% Reinforcement Using Line Source Arrays." In: Proc. of 142nd Audio Eng. +% Soc. Conv., Berlin, #9722. +% +% note that [Fir17] radiates into +y for linear SSD +% the simulations here consider radiation into -y for linear SSD +% +%***************************************************************************** +% The MIT License (MIT) * +% * +% Copyright (c) 2010-2017 SFS Toolbox Developers * +% * +% Permission is hereby granted, free of charge, to any person obtaining a * +% copy of this software and associated documentation files (the "Software"), * +% to deal in the Software without restriction, including without limitation * +% the rights to use, copy, modify, merge, publish, distribute, sublicense, * +% and/or sell copies of the Software, and to permit persons to whom the * +% Software is furnished to do so, subject to the following conditions: * +% * +% The above copyright notice and this permission notice shall be included in * +% all copies or substantial portions of the Software. * +% * +% THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * +% IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * +% FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * +% THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * +% LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * +% FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * +% DEALINGS IN THE SOFTWARE. * +% * +% The SFS Toolbox allows to simulate and investigate sound field synthesis * +% methods like wave field synthesis or higher order ambisonics. * +% * +% http://sfstoolbox.org sfstoolbox@gmail.com * +%***************************************************************************** + +if 0 + clear all; + close all; + clc; + fh1 = figure; + fh2 = figure; +else + clc; +end + +%% linear SSD: +conf = SFS_config; +conf.usetapwin = 0; +conf.secondary_sources.size = 60; +conf.secondary_sources.geometry = 'line'; +conf.secondary_sources.number = 2^11; +f = 1500; +w_c = 2*pi*f/conf.c; +%dref = 2 = const. + +if 0 +%% plane wave with linear SSD, [Fig. 3a/4a, Fir17] +nPW = [cos(300*pi/180) sin(300*pi/180) 0]; +nPW = nPW/norm(nPW); + +x0 = secondary_source_positions(conf); +x0 = secondary_source_selection(x0,nPW,'pw'); +%either +dx0 = 2*ones(size(x0,1),1); %[Fig. 3a, Fir17] +%or +%dx0 = abs(2/sin(300*pi/180))*ones(size(x0,1),1); %[Fig. 4a, Fir17] + + +[P,x,y,z,x0,xPCS] = sound_field_mono_unified_25d_wfs([-6 6],[-3 0],0,nPW,'pw',f,conf,dx0); +P_ref = exp(-1i*w_c*(nPW(1)*x + nPW(2)*y)); +figure(fh1) +surf(x,y,20*log10(abs(P-P_ref))), hold on +for n=1:size(x0,1) + plot3(x0(n,1),x0(n,2),x0(n,2)*0+1e6,'ok','MarkerFaceColor','k','MarkerSize',.5) + plot3(xPCS(n,1),xPCS(n,2),xPCS(n,2)*0+1e3,'ow','MarkerFaceColor','w','MarkerSize',.5) +end +hold off +shading flat +axis equal +axis([-6 6 -3 0]) +view([0 90]) +dBMax = 20; +dBMin = -35; +dBStep = 1; +N_cm = abs((dBMax-dBMin)/dBStep); +cm = (moreland(N_cm)); +colormap(cm); +cb = colorbar('east'); +cb.Ticks = [dBMin:5:dBMax]; +set(gca,'CLim',[dBMin dBMax]) +ylabel(cb,'dB') +xlabel('x / m') +ylabel('y / m') +figure(fh2) +surf(x,y,real(P)) +shading flat +axis equal +axis([-6 6 -3 0]) +view([0 90]) +dBMax = 1; +dBMin = -1; +dBStep = 1/100; +N_cm = abs((dBMax-dBMin)/dBStep); +cm = (moreland(N_cm)); +colormap(cm); +cb = colorbar('east'); +cb.Ticks = [dBMin:0.25:dBMax]; +set(gca,'CLim',[dBMin dBMax]) +ylabel(cb,'dB') +xlabel('x / m') +ylabel('y / m') +end + +if 0 +%% line source with linear SSD, [Fig. 3b/4b, Fir17] +xPS = [0 1 0]; + +x0 = secondary_source_positions(conf); +x0 = secondary_source_selection(x0,xPS,'ls'); + +%either +dx0 = 2*ones(size(x0,1),1); %[Fig. 3b, Fir17] +%or +%dx0 = ones(size(x0,1),1); %prep for [Fig. 4b, Fir17] +%for n=1:size(dx0,1) +% dx0(n,1) = dx0(n,1)*2*vector_norm(x0(n,1:3)-xPS,2)/xPS(2); %[Fig. 4b, Fir17] +%end + +[P,x,y,z,x0,xPCS] = sound_field_mono_unified_25d_wfs([-6 6],[-3 0],0,xPS,'ls',f,conf,dx0); +r = sqrt((x-xPS(1)).^2+(y-xPS(2)).^2); +P_ref = -1i/4*besselh(0,2,w_c*r); +figure(fh1) +surf(x,y,20*log10(abs(P-P_ref))), hold on +for n=1:size(x0,1) + plot3(x0(n,1),x0(n,2),x0(n,2)*0+1e6,'ok','MarkerFaceColor','k','MarkerSize',.5) + plot3(xPCS(n,1),xPCS(n,2),xPCS(n,2)*0+1e3,'ow','MarkerFaceColor','w','MarkerSize',.5) +end +hold off +shading flat +axis equal +axis([-6 6 -3 0]) +view([0 90]) +dBMax = 0; +dBMin = -70; +dBStep = 1; +N_cm = abs((dBMax-dBMin)/dBStep); +cm = (moreland(N_cm)); +colormap(cm); +cb = colorbar('east'); +cb.Ticks = [dBMin:10:dBMax]; +set(gca,'CLim',[dBMin dBMax]) +ylabel(cb,'dB') +xlabel('x / m') +ylabel('y / m') +figure(fh2) +surf(x,y,real(P)) +shading flat +axis equal +axis([-6 6 -3 0]) +view([0 90]) +dBMax = 0.1; +dBMin = -0.1; +dBStep = 1/1000; +N_cm = abs((dBMax-dBMin)/dBStep); +cm = (moreland(N_cm)); +colormap(cm); +cb = colorbar('east'); +cb.Ticks = [dBMin:1/50:dBMax]; +set(gca,'CLim',[dBMin dBMax]) +ylabel(cb,'dB') +xlabel('x / m') +ylabel('y / m') +end + + + + +%% circular SSD: +conf = SFS_config; +conf.usetapwin = 0; +conf.secondary_sources.size = 3; +conf.secondary_sources.geometry = 'circular'; +conf.secondary_sources.number = 2^9; +f = 2000; +w_c = 2*pi*f/conf.c; + +if 0 +%% plane wave with circular SSD, [Fig. 9a, Fir17] +nPW = [1 0 0]; +nPW = nPW/norm(nPW); + +x0 = secondary_source_positions(conf); +x0 = secondary_source_selection(x0,nPW,'pw'); +dx0 = 0.75*ones(size(x0,1),1); %[Fig. 9/10, Fir17] + +[P,x,y,z,x0,xPCS] = sound_field_mono_unified_25d_wfs([-2 2],[-2 2],0,nPW,'pw',f,conf,dx0); +P_ref = exp(-1i*w_c*(nPW(1)*x + nPW(2)*y)); +figure(fh1) +surf(x,y,20*log10(abs(P-P_ref))), hold on +for n=1:size(x0,1) + plot3(x0(n,1),x0(n,2),x0(n,2)*0+1e6,'ok','MarkerFaceColor','k','MarkerSize',.5) + plot3(xPCS(n,1),xPCS(n,2),xPCS(n,2)*0+1e3,'ow','MarkerFaceColor','w','MarkerSize',.5) +end +hold off +shading flat +axis square +axis([-2 2 -2 2]) +view([0 90]) +dBMax = 20; +dBMin = -35; +dBStep = 1; +N_cm = abs((dBMax-dBMin)/dBStep); +cm = (moreland(N_cm)); +colormap(cm); +cb = colorbar('east'); +cb.Ticks = [dBMin:5:dBMax]; +set(gca,'CLim',[dBMin dBMax]) +ylabel(cb,'dB') +xlabel('x / m') +ylabel('y / m') +end + +if 0 +%% line source with circular SSD, [Fig. 9b, Fir17] +xPS = [-2 0 0]; + +x0 = secondary_source_positions(conf); +x0 = secondary_source_selection(x0,xPS,'ls'); +dx0 = 0.75*ones(size(x0,1),1); %[Fig. 9/10, Fir17] + +[P,x,y,z,x0,xPCS] = sound_field_mono_unified_25d_wfs([-2 2],[-2 2],0,xPS,'ls',f,conf,dx0); +r = sqrt((x-xPS(1)).^2+(y-xPS(2)).^2); +P_ref = -1i/4*besselh(0,2,w_c*r); +surf(x,y,20*log10(abs(P-P_ref))), hold on +for n=1:size(x0,1) + plot3(x0(n,1),x0(n,2),x0(n,2)*0+1e6,'ok','MarkerFaceColor','k','MarkerSize',.5) + plot3(xPCS(n,1),xPCS(n,2),xPCS(n,2)*0+1e3,'ow','MarkerFaceColor','w','MarkerSize',.5) +end +hold off +shading flat +axis square +axis([-2 2 -2 2]) +view([0 90]) +dBMax = -10; +dBMin = -70; +dBStep = 1; +N_cm = abs((dBMax-dBMin)/dBStep); +cm = (moreland(N_cm)); +colormap(cm); +cb = colorbar('east'); +cb.Ticks = [dBMin:5:dBMax]; +set(gca,'CLim',[dBMin dBMax]) +ylabel(cb,'dB') +xlabel('x / m') +ylabel('y / m') +end + +if 0 +%% point source with circular SSD, [Fig. 10b, Fir17] +xPS = [-3 0 0]; % + +x0 = secondary_source_positions(conf); +x0 = secondary_source_selection(x0,xPS,'ps'); +dx0 = 0.75*ones(size(x0,1),1); %[Fig. 9/10, Fir17] + +[P,x,y,z,x0,xPCS] = sound_field_mono_unified_25d_wfs([-2 2],[-2 2],0,xPS,'ps',f,conf,dx0); +P_ref = exp(-1i*w_c*sqrt((x-xPS(1)).^2+(y-xPS(2)).^2)) ./(4*pi*sqrt((x-xPS(1)).^2+(y-xPS(2)).^2)); +surf(x,y,20*log10(abs(P-P_ref))), hold on +for n=1:size(x0,1) + plot3(x0(n,1),x0(n,2),x0(n,2)*0+1e6,'ok','MarkerFaceColor','k','MarkerSize',.5) + plot3(xPCS(n,1),xPCS(n,2),xPCS(n,2)*0+1e3,'ow','MarkerFaceColor','w','MarkerSize',.5) +end +hold off +shading flat +axis square +axis([-2 2 -2 2]) +view([0 90]) +dBMax = -10; +dBMin = -70; +dBStep = 1; +N_cm = abs((dBMax-dBMin)/dBStep); +cm = (moreland(N_cm)); +colormap(cm); +cb = colorbar('east'); +cb.Ticks = [dBMin:5:dBMax]; +set(gca,'CLim',[dBMin dBMax]) +ylabel(cb,'dB') +xlabel('x / m') +ylabel('y / m') +end + + + +if 1 +%% plane wave with circular SSD, [Fig. 12a, Fir17] +nPW = [1 0 0]; +nPW = nPW/norm(nPW); + +x0 = secondary_source_positions(conf); +x0 = secondary_source_selection(x0,nPW,'pw'); + +beta = 180 - 180/pi*cart2pol(x0(:,1),x0(:,2)); +RSSD = beta*0 + conf.secondary_sources.size/2 ; +Rref = beta*0 +1.; +dx0 = RSSD.*cos(beta*pi/180) - sqrt(Rref.^2-RSSD.^2.*(sin(beta*pi/180)).^2); %[Fig. 12a, Fir17] +%complex dx0 here + +[P,x,y,z,x0,xPCS] = sound_field_mono_unified_25d_wfs([-2 2],[-2 2],0,nPW,'pw',f,conf,dx0); +P_ref = exp(-1i*w_c*(nPW(1)*x + nPW(2)*y)); +figure(fh1) +surf(x,y,20*log10(abs(P-P_ref))), hold on +for n=1:size(x0,1) + plot3(x0(n,1),x0(n,2),x0(n,2)*0+1e6,'ok','MarkerFaceColor','k','MarkerSize',.5) + plot3(xPCS(n,1),xPCS(n,2),xPCS(n,2)*0+1e3,'ow','MarkerFaceColor','w','MarkerSize',.5) +end +hold off +shading flat +axis square +axis([-2 2 -2 2]) +view([0 90]) +dBMax = 20; +dBMin = -30; +dBStep = 1; +N_cm = abs((dBMax-dBMin)/dBStep); +cm = (moreland(N_cm)); +colormap(cm); +cb = colorbar('east'); +cb.Ticks = [dBMin:5:dBMax]; +set(gca,'CLim',[dBMin dBMax]) +ylabel(cb,'dB') +xlabel('x / m') +ylabel('y / m') +end + + + + + + + + + + + + + + + From 112b6fd2c28094852e1284c00ad51742be077bd9 Mon Sep 17 00:00:00 2001 From: Frank Schultz Date: Sun, 30 Apr 2017 21:04:31 +0200 Subject: [PATCH 5/5] Added some further referencing schemes, also Fig. 7 of IEEE DOI 10.1109/TASLP.2017.2689245 checked. The current handling is far from being nice, but it allows to check the referencing functions d(x0) of the Spors, Ahrens, Start WFS approaches compared to the unified framework. Some ideas for a suitable handling within the toolbox are welcome. --- .../driving_function_mono_unified_25d_wfs.m | 4 +- .../sound_field_mono_unified_25d_wfs.m | 7 +- validation/check_unified_25D_wfs.m | 211 ++++++++++++++++-- 3 files changed, 196 insertions(+), 26 deletions(-) diff --git a/SFS_monochromatic/driving_function_mono_unified_25d_wfs.m b/SFS_monochromatic/driving_function_mono_unified_25d_wfs.m index 918d738a..a1bcb2a4 100644 --- a/SFS_monochromatic/driving_function_mono_unified_25d_wfs.m +++ b/SFS_monochromatic/driving_function_mono_unified_25d_wfs.m @@ -35,8 +35,8 @@ % % [Fir17] Gergely Firtha, Peter Fiala, Frank Schultz, Sascha Spors (2017): % "Improved Referencing Schemes for 2.5D Wave Field Synthesis Driving -% Functions." In: IEEE/ACM Trans. Audio Speech Language Process., -% DOI 10.1109/TASLP.2017.2689245 +% Functions." In: IEEE/ACM Trans Audio Speech Lang Process, +% 25(5):1117-1127, DOI 10.1109/TASLP.2017.2689245 % % DRIVING_FUNCTION_MONO_UNIFIED_25D_WFS(x0,xs,dx0,src,f,conf) % returns the driving signal for diff --git a/SFS_monochromatic/sound_field_mono_unified_25d_wfs.m b/SFS_monochromatic/sound_field_mono_unified_25d_wfs.m index 76cf1932..7b8e896e 100644 --- a/SFS_monochromatic/sound_field_mono_unified_25d_wfs.m +++ b/SFS_monochromatic/sound_field_mono_unified_25d_wfs.m @@ -1,5 +1,5 @@ function varargout = sound_field_mono_unified_25d_wfs(X,Y,Z,xs,src,f,conf,dx0) -%SOUND_FIELD_MONO_WFS simulates a sound field for WFS +%SOUND_FIELD_MONO_UNIFIED_25D_WFS simulates a sound field for unified 2.5D WFS % % Usage: [P,x,y,z,x0] = sound_field_mono_wfs(X,Y,Z,xs,src,f,conf) % @@ -30,9 +30,12 @@ % x0 - active secondary sources / m % xPCS - positions/locations of amplitude correct synthesis % i.e. the reference curve -% SOUND_FIELD_MONO_WFS(X,Y,Z,xs,src,f,conf) simulates a monochromatic sound +% SOUND_FIELD_MONO_UNIFIED_25D_WFS(X,Y,Z,xs,src,f,conf,dx0) simulates a monochromatic sound % field for the given source type (src) synthesized with wave field synthesis. % +% driving_function_mono_unified_25d_wfs() is used for driving +% functions +% % To plot the result use: % plot_sound_field(P,X,Y,Z,x0,conf); % or simple call the function without output argument: diff --git a/validation/check_unified_25D_wfs.m b/validation/check_unified_25D_wfs.m index 3ff45a95..6305a5bb 100644 --- a/validation/check_unified_25D_wfs.m +++ b/validation/check_unified_25D_wfs.m @@ -3,16 +3,16 @@ % we add and check the unified 2.5D WFS framework from % [Fir17] Gergely Firtha, Peter Fiala, Frank Schultz, Sascha Spors (2017): % "Improved Referencing Schemes for 2.5D Wave Field Synthesis Driving -% Functions." In: IEEE/ACM Trans. Audio Speech Language Process., -% DOI 10.1109/TASLP.2017.2689245 +% Functions." In: IEEE/ACM Trans Audio Speech Lang Process, +% 25(5):1117-1127, DOI 10.1109/TASLP.2017.2689245. % % [Sch17] Frank Schultz, Gergely Firtha, Peter Fiala, Sascha Spors (2017): % "Wave Field Synthesis Driving Functions for Large-Scale Sound % Reinforcement Using Line Source Arrays." In: Proc. of 142nd Audio Eng. % Soc. Conv., Berlin, #9722. % -% note that [Fir17] radiates into +y for linear SSD -% the simulations here consider radiation into -y for linear SSD +% note that [Fir17] radiates into +y for a linear SSD +% the simulations here consider radiation into -y for a linear SSD % %***************************************************************************** % The MIT License (MIT) * @@ -54,6 +54,7 @@ end %% linear SSD: +%############### conf = SFS_config; conf.usetapwin = 0; conf.secondary_sources.size = 60; @@ -61,7 +62,6 @@ conf.secondary_sources.number = 2^11; f = 1500; w_c = 2*pi*f/conf.c; -%dref = 2 = const. if 0 %% plane wave with linear SSD, [Fig. 3a/4a, Fir17] @@ -75,6 +75,15 @@ %or %dx0 = abs(2/sin(300*pi/180))*ones(size(x0,1),1); %[Fig. 4a, Fir17] +%% other referencing schemes: +%[(25), Fir17] for xref = const +%this handling is equivalent with Spors Revisited WFS (26),(27) +xRef = [0,-2,0]; +%dx0 = zeros(size(x0,1),1); +for n=1:size(x0,1) +% dx0(n) = vector_norm(xRef-x0(n,1:3),2); +end +%% [P,x,y,z,x0,xPCS] = sound_field_mono_unified_25d_wfs([-6 6],[-3 0],0,nPW,'pw',f,conf,dx0); P_ref = exp(-1i*w_c*(nPW(1)*x + nPW(2)*y)); @@ -136,6 +145,16 @@ % dx0(n,1) = dx0(n,1)*2*vector_norm(x0(n,1:3)-xPS,2)/xPS(2); %[Fig. 4b, Fir17] %end +%% other referencing schemes: +%[(25), Fir17] for xref = const +%this handling is equivalent with Spors Revisited WFS (26) +xRef = [0,-2,0]; +%dx0 = zeros(size(x0,1),1); +for n=1:size(x0,1) +% dx0(n) = vector_norm(xRef-x0(n,1:3),2); +end +%% + [P,x,y,z,x0,xPCS] = sound_field_mono_unified_25d_wfs([-6 6],[-3 0],0,xPS,'ls',f,conf,dx0); r = sqrt((x-xPS(1)).^2+(y-xPS(2)).^2); P_ref = -1i/4*besselh(0,2,w_c*r); @@ -184,8 +203,111 @@ +if 1 +%% point source with linear SSD, [Fig. 7, Fir17] +xPS = [0 3 0]; + +x0 = secondary_source_positions(conf); +x0 = secondary_source_selection(x0,xPS,'ps'); + +%either dx0=const +dx0 = 1.5*ones(size(x0,1),1); %[Fig. 7a, Fir17], this would be the +%Ahrens WFS handling where generally dx0 = const is used (Sec. 3.9.3 in his book) + +%or parallel reference line (equivalent with Start Diss (3.16)/(3.17) and HF/Far approx. SDM solution) +%dx0 = zeros(size(x0,1),1); +yref = -1.5; %[Fig. 7b, Fir17], [eq. (42), Fir17] +for n=1:size(x0,1) +% dx0(n) = vector_norm(x0(n,1:3)-xPS,2) * (-yref/(-yref-(-xPS(2)))); +end + +%or %[Fig. 7c, Fir17], [eq. (45), Fir17] +Rref = xPS(2)+1.5; +%dx0 = zeros(size(x0,1),1); +for n=1:size(x0,1) + r0 = vector_norm(x0(n,1:3)-xPS,2); + %dx0(n) = r0*(Rref-r0)/Rref; +end + +%% other referencing schemes: +xRef = [0,-1.5,0]; +%dx0 = zeros(size(x0,1),1); +for n=1:size(x0,1) %from SPA 1, Schultz Diss (2.137), Start (Diss 3.10/3.11) with xref = const + %dx0(n) = vector_norm(xRef-x0(n,1:3),2)*vector_norm(x0(n,1:3)-xPS,2) / ... + % (vector_norm(xRef-x0(n,1:3),2) + vector_norm(x0(n,1:3)-xPS,2)); +end + +%Sascha Revisited WFS->uses the referencing function dx0 of 2D sound fields +%which for the 3D field of the virtual point source yields not the correct +%amplitude at desired reference positions (the SPA I ignores the influence of z-dimension) +%dx0 = zeros(size(x0,1),1); +for n=1:size(x0,1) %Sascha WFS revisited + %dx0(n) = vector_norm(xRef-x0(n,1:3),2)*2/3; %the 2/3 factor compensates the amplitude mismatch for the chosen example +end + +if 0 +%one might use: +for n=1:size(x0,1) + xRef = x0(n,1:3); + xRef(2) = -3; %fixing yRef, but xref varies with x0 + dx0(n) = vector_norm(xRef-x0(n,1:3),2)*vector_norm(x0(n,1:3)-xPS,2) / ... + (vector_norm(xRef-x0(n,1:3),2) + vector_norm(x0(n,1:3)-xPS,2)); +end +end +%% + +[P,x,y,z,x0,xPCS] = sound_field_mono_unified_25d_wfs([-6 6],[-4 0],0,xPS,'ps',f,conf,dx0); +P_ref = exp(-1i*w_c*sqrt((x-xPS(1)).^2+(y-xPS(2)).^2)) ./(4*pi*sqrt((x-xPS(1)).^2+(y-xPS(2)).^2)); +%% +figure(fh1) +surf(x,y,20*log10(abs(P-P_ref))), hold on +for n=1:size(x0,1) + plot3(x0(n,1),x0(n,2),x0(n,2)*0+1e6,'ok','MarkerFaceColor','k','MarkerSize',.5) + plot3(xPCS(n,1),xPCS(n,2),xPCS(n,2)*0+1e3,'ow','MarkerFaceColor','w','MarkerSize',.5) +end +hold off +shading flat +axis equal +axis([-6 6 -4 0]) +view([0 90]) +dBMax = 10; +dBMin = -80; +dBStep = 1; +N_cm = abs((dBMax-dBMin)/dBStep); +cm = (moreland(N_cm)); +cm = parula(N_cm); +colormap(cm); +cb = colorbar('east'); +cb.Ticks = [dBMin:10:dBMax]; +set(gca,'CLim',[dBMin dBMax]) +ylabel(cb,'dB') +xlabel('x / m') +ylabel('y / m') +figure(fh2) +surf(x,y,real(P)) +shading flat +axis equal +axis([-6 6 -4 0]) +view([0 90]) +dBMax = 0.1; +dBMin = -0.1; +dBStep = 1/1000; +N_cm = abs((dBMax-dBMin)/dBStep); +cm = (moreland(N_cm)); +colormap(cm); +cb = colorbar('east'); +cb.Ticks = [dBMin:1/50:dBMax]; +set(gca,'CLim',[dBMin dBMax]) +ylabel(cb,'dB') +xlabel('x / m') +ylabel('y / m') + +end + + %% circular SSD: +%############### conf = SFS_config; conf.usetapwin = 0; conf.secondary_sources.size = 3; @@ -203,6 +325,17 @@ x0 = secondary_source_selection(x0,nPW,'pw'); dx0 = 0.75*ones(size(x0,1),1); %[Fig. 9/10, Fir17] +%% other referencing schemes: +%[(25), Fir17] for xref = const +%this handling is equivalent with Spors Revisited WFS (26),(27) +%if xRef is in origin we end up with dx0 = SSD radius +xRef = [-0.75,0,0]; +%dx0 = zeros(size(x0,1),1); +for n=1:size(x0,1) +% dx0(n) = vector_norm(xRef-x0(n,1:3),2); +end +%% + [P,x,y,z,x0,xPCS] = sound_field_mono_unified_25d_wfs([-2 2],[-2 2],0,nPW,'pw',f,conf,dx0); P_ref = exp(-1i*w_c*(nPW(1)*x + nPW(2)*y)); figure(fh1) @@ -238,6 +371,17 @@ x0 = secondary_source_selection(x0,xPS,'ls'); dx0 = 0.75*ones(size(x0,1),1); %[Fig. 9/10, Fir17] +%% other referencing schemes: +%[(25), Fir17] for xref = const +%this handling is equivalent with Spors Revisited WFS (26) +%if xRef is in origin we end up with dx0 = SSD radius +xRef = [-0.75,0,0]; +%dx0 = zeros(size(x0,1),1); +for n=1:size(x0,1) +% dx0(n) = vector_norm(xRef-x0(n,1:3),2); +end +%% + [P,x,y,z,x0,xPCS] = sound_field_mono_unified_25d_wfs([-2 2],[-2 2],0,xPS,'ls',f,conf,dx0); r = sqrt((x-xPS(1)).^2+(y-xPS(2)).^2); P_ref = -1i/4*besselh(0,2,w_c*r); @@ -271,10 +415,33 @@ x0 = secondary_source_positions(conf); x0 = secondary_source_selection(x0,xPS,'ps'); -dx0 = 0.75*ones(size(x0,1),1); %[Fig. 9/10, Fir17] +dx0 = 0.75*ones(size(x0,1),1); %[Fig. 9/10, Fir17], this would be the +%Ahrens WFS handling where generally dx0 = const is used (Sec. 3.9.3 in his book) + +%% other referencing schemes: +% - Schultz Diss RefPoint Fig. 2.7 = SPA I +% - this is NOT equivalent to Sascha WFS revisited due to the 3D sound field +% characteristics +xRef = [0,0,0]; +%dx0 = zeros(size(x0,1),1); +for n=1:size(x0,1) %Schultz Diss reference point Fig. 2.7 + % = SPA I = Start 1997 (3.10/3.11) = [(31), Fir17] for xref = const + %dx0(n) = vector_norm(xRef-x0(n,1:3),2)*vector_norm(x0(n,1:3)-xPS,2) / ... + % (vector_norm(xRef-x0(n,1:3),2) + vector_norm(x0(n,1:3)-xPS,2)); +end + +%Sascha Revisited WFS->uses the referencing function dx0 of 2D sound fields +%which for the 3D field of the virtual point source yields not the correct +%amplitude at desired reference positions (the SPA I ignores the influence of z-dimension) +for n=1:size(x0,1) %Sascha WFS revisited + %dx0(n) = vector_norm(xRef-x0(n,1:3),2); %*10^(-6.0206/20); %factor 1/2 corrects this primary source mismatch for the here chosen example +end %and we end up precisely with the Ahrens approach if! xRef is in the origin, dx0 the corresponds to the SSD radius then +%% [P,x,y,z,x0,xPCS] = sound_field_mono_unified_25d_wfs([-2 2],[-2 2],0,xPS,'ps',f,conf,dx0); P_ref = exp(-1i*w_c*sqrt((x-xPS(1)).^2+(y-xPS(2)).^2)) ./(4*pi*sqrt((x-xPS(1)).^2+(y-xPS(2)).^2)); + +figure(fh1) surf(x,y,20*log10(abs(P-P_ref))), hold on for n=1:size(x0,1) plot3(x0(n,1),x0(n,2),x0(n,2)*0+1e6,'ok','MarkerFaceColor','k','MarkerSize',.5) @@ -301,7 +468,7 @@ -if 1 +if 0 %% plane wave with circular SSD, [Fig. 12a, Fir17] nPW = [1 0 0]; nPW = nPW/norm(nPW); @@ -309,12 +476,27 @@ x0 = secondary_source_positions(conf); x0 = secondary_source_selection(x0,nPW,'pw'); +%[eq. (51), Fir17] for [Fig. 12a, Fir17] beta = 180 - 180/pi*cart2pol(x0(:,1),x0(:,2)); RSSD = beta*0 + conf.secondary_sources.size/2 ; Rref = beta*0 +1.; dx0 = RSSD.*cos(beta*pi/180) - sqrt(Rref.^2-RSSD.^2.*(sin(beta*pi/180)).^2); %[Fig. 12a, Fir17] %complex dx0 here +%% other referencing schemes: +% - Schultz Diss RefPoint Fig. 2.7 = SPA I +% - this is equivalent to Sascha WFS revisited due to the 2D sound field +% characteristics +% - this is in this special case (with xRef in the origin) also equivalent to +% Ahrens WFS, where generally dx0 = const is used (Sec. 3.9.3 in his book) +xRef = [0,0,0]; +%dx0 = zeros(size(x0,1),1); +for n=1:size(x0,1) + %dx0(n) = vector_norm(xRef-x0(n,1:3),2); %Spors = Schultz = [(25), Fir17] for xref = const + %dx0(n) = 1.5; % = Ahrens only if xRef is in origin +end +%% + [P,x,y,z,x0,xPCS] = sound_field_mono_unified_25d_wfs([-2 2],[-2 2],0,nPW,'pw',f,conf,dx0); P_ref = exp(-1i*w_c*(nPW(1)*x + nPW(2)*y)); figure(fh1) @@ -341,18 +523,3 @@ xlabel('x / m') ylabel('y / m') end - - - - - - - - - - - - - - -