-
Notifications
You must be signed in to change notification settings - Fork 4
/
fig6.m
74 lines (66 loc) · 1.95 KB
/
fig6.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
clear all
% Listening area
X = [-2 2]; % / m
Y = [-2 2]; % / m
Z = 0;
% virtual source position
xs = [0 1 0]; % / m
% virtual source type
src = 'pw';
% === Toolbox settings ===
conf.resolution = 1000; % / samples
conf.xref = [0 0 0]; % / m
conf.fs = 44100; % / Hz
conf.c = 343; % / m/s
conf.N = 1024;
conf.driving_functions = 'default';
conf.dimension = '2.5D';
conf.usetapwin = true;
conf.tapwinlen = 0.3;
conf.phase = 0; % / rad
conf.usenormalisation = true;
conf.plot.useplot = false;
conf.showprogress = false;
conf.debug = 0;
conf.tmpdir = '';
conf.usebandpass = false;
conf.bandpassflow = 10; % / Hz
conf.bandpassfhigh = 20000; % / Hz
conf.wfs.usehpre = false;
conf.wfs.hpretype = 'FIR';
conf.wfs.hpreflow = 50; % / Hz
conf.wfs.hprefhigh = 1200; % / Hz
conf.usefracdelay = false;
conf.fracdelay_method = 'resample';
conf.plot.useplot = false; % boolean
conf.plot.mode = 'monitor';
conf.plot.loudspeakers = true; % boolean
conf.plot.realloudspeakers = true; % boolean
conf.plot.lssize = 0.16; % m
conf.plot.size_unit = 'px'; % 'px','cm','inches'
conf.plot.size = [540 404];
conf.plot.resolution = 150; % / dpi
conf.plot.cmd = '';
conf.plot.usefile = 0;
conf.plot.file = '';
conf.plot.usegnuplot = false; % boolean
% get all six loudspeakers
conf.secondary_sources.size = 3; % / m
conf.secondary_sources.center = [0 0 0]; % / m
conf.secondary_sources.geometry = 'circle';
conf.secondary_sources.number = 56;
conf.secondary_sources.x0 = [];
% === single speaker at virtual source position ==========================
conf.plot.usedb = false;
conf.plot.caxis = [-1 1];
conf.plot.colormap = blueblack(256);
[P,x,y,z,x0] = sound_field_mono_wfs(X,Y,Z,xs,src,1000,conf);
x0(:,7) = ones(size(x0,1),1);
plot_sound_field(-P,x,y,z,x0,conf);
P = sound_field_mono_wfs(X,Y,Z,xs,src,2000,conf);
plot_sound_field(-P,x,y,z,x0,conf);
conf.plot.usedb = true;
conf.plot.caxis = [-45 0];
conf.plot.colormap = whitered(256);
p = sound_field_imp_wfs(X,Y,Z,xs,src,193,conf);
plot_sound_field(p,x,y,z,x0,conf);