-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathvisualize.m
29 lines (23 loc) · 890 Bytes
/
visualize.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
function visualize(room, mic, src, head_angles)
% visualize(room, mic, src, head_angles)
%
% Draw a 3d representation of the room setup and the position of the
% source and listener. Parameters are the same as those used in
% rlrs.m. The listener will be plotted as an isosceles triangle, with
% the base going between the two ears and the point in the direction
% the listener is facing. The source is plotted as a star.
% Copyright (C) 2008 Michael Mandel <mim at ee columbia edu>
% Distributable under the GPL version 3 or higher
if ~exist('head_angles', 'var') head_angles = [0 0 0]; end
ear_ear_nose = [0 -.075 0; 0 .075 0; .1 0 0]';
R = euler_matrix(head_angles);
xyz = mic(:)*[1 1 1] + R * ear_ear_nose;
plot3(src(1), src(2), src(3), '*')
patch(xyz(1,:), xyz(2,:), xyz(3,:), 0);
grid on
axis equal
room = [0 0 0; room(:)'];
axis(room(:))
xlabel('x')
ylabel('y')
zlabel('z')