diff --git a/README.md b/README.md index 47ffbc16..512eab60 100644 --- a/README.md +++ b/README.md @@ -323,6 +323,40 @@ sound_field_mono_nfchoa([-2 2],[-2 2],0,[0 -1 0],'pw',800,conf); ![Image](doc/img/sound_field_nfchoa_25d.png) +#### Local Wave Field Synthesis + +In Near-Field Compensated Higher Order Ambisonics aliasing frequency in a small +array inside the listening area can be increased by limiting the used order. A +similar outcome can be achoieved in Wave Field Synthesis by applying so called +local Wave Field Synthesis. In this case the original loudspeaker array is +driven by Wave Field Synthesis to create a virtual loudspeaker array consisting +of focused sources which can then be used to create the desired sound field in a +small area. +The settings are the same as for Wave Field Synthesis, but a new struct +conf.localsfs has to be filled out, which for example provides the +settings for the desired position and form of the local area with higher +aliasing frequency. + +```Matlab +conf = SFS_config_example; +conf.resolution = 1000; +conf.dimension = '2D'; +conf.secondary_sources.geometry = 'box'; +conf.secondary_sources.number = 4*56; +conf.secondary_sources.size = 2; +conf.localsfs.vss.size = 0.4; +conf.localsfs.vss.center = [0 0 0]; +conf.localsfs.vss.geometry = 'circular'; +conf.localsfs.vss.number = 56; +% sound_field_mono_localwfs(X,Y,Z,xs,src,f,conf); +sound_field_mono_localwfs([-1 1],[-1 1],0,[1.0 -1.0 0],'pw',7000,conf); +axis([-1.1 1.1 -1.1 1.1]); +%print_png('img/sound_field_localwfs_2d.png'); +``` + +![Image](doc/img/sound_field_localwfs_2d.png) + + #### Stereo The Toolbox includes not only WFS and NFC-HOA, but also some generic sound field diff --git a/SFS_analysis/freq_response_localwfs.m b/SFS_analysis/freq_response_localwfs.m index b4bc094e..b77bb5f0 100644 --- a/SFS_analysis/freq_response_localwfs.m +++ b/SFS_analysis/freq_response_localwfs.m @@ -85,7 +85,7 @@ %% ===== Computation ==================================================== % Get the position of the loudspeakers -x0 = secondary_source_positions(conf); +x0_real = secondary_source_positions(conf); % Generate frequencies (10^0-10^5) f = logspace(0,5,500)'; % We want only frequencies until f = 20000Hz @@ -95,7 +95,7 @@ % Get the result for all frequencies for ii = 1:length(f) if showprogress, progress_bar(ii,length(f)); end - D = driving_function_mono_localwfs(x0,xs,src,f(ii),conf); + [D, x0] = driving_function_mono_localwfs(x0_real,xs,src,f(ii),conf); % calculate sound field at the listener position P = sound_field_mono(X(1),X(2),X(3),x0,greens_function,D,f(ii),conf); S(ii) = abs(P); diff --git a/doc/generate_doc_plots.m b/doc/generate_doc_plots.m index f9ab8042..9d7c1d6b 100644 --- a/doc/generate_doc_plots.m +++ b/doc/generate_doc_plots.m @@ -151,6 +151,7 @@ conf.localsfs.vss.geometry = 'circular'; conf.localsfs.vss.number = 56; sound_field_mono_localwfs([-1 1],[-1 1],0,[1.0 -1.0 0],'pw',7000,conf); +axis([-1.1 1.1 -1.1 1.1]); print_png('img/sound_field_localwfs_2d.png'); % --- spatio-temporal snapshots of the sound field ---