Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/sfstoolbox/sfs
Browse files Browse the repository at this point in the history
  • Loading branch information
hagenw committed Apr 2, 2015
2 parents c0e1342 + 0b75e27 commit 9be8b5f
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 2 deletions.
34 changes: 34 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
<code>conf.localsfs</code> 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
Expand Down
4 changes: 2 additions & 2 deletions SFS_analysis/freq_response_localwfs.m
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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);
Expand Down
1 change: 1 addition & 0 deletions doc/generate_doc_plots.m
Original file line number Diff line number Diff line change
Expand Up @@ -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 ---
Expand Down

0 comments on commit 9be8b5f

Please sign in to comment.