Skip to content

Commit

Permalink
Version 0.93
Browse files Browse the repository at this point in the history
  • Loading branch information
torbenwendt committed Dec 13, 2017
1 parent abbbc15 commit d910d17
Show file tree
Hide file tree
Showing 180 changed files with 1,024 additions and 767 deletions.
28 changes: 17 additions & 11 deletions README
Expand Up @@ -4,7 +4,7 @@ RAZR SOFTWARE PACKAGE FOR MATHWORK'S MATLAB

RAZR - Room acoustics simulator

Version 0.92
Version 0.93

Copyright (c) 2014-2017, Torben Wendt, Steven van de Par, Stephan Ewert,
University of Oldenburg, Germany.
Expand Down Expand Up @@ -118,13 +118,18 @@ Demo and Example scripts
------------------------
To start the demo, type "razr demo".

Besides, in the directory "EXAMPLES", you can find some example scripts, which
Besides, in the directory "EXAMPLES", you can find some example scripts, that
demonstrate the usage of this program package. See the respective files for
details.
To start any of the examples, type "razr addpath" to temporally add all
required folders to MATLAB's path. Then type, e.g. "example_default" or
"example_options". When you have read and tried out all examples, you know the
most important features of RAZR.
details. When you have read and tried out all examples, you know the most
important features of RAZR.
To start any of the examples, type "razr addpath" to temporally add all required
folders to MATLAB's path. Then type, e.g., "example_default" or
"example_options".

A formal usage description is provided in the documentation of the top-level
function razr(). Type "razr help" to display it.

Please see also the changelog if you have already used earlier versions of RAZR.


Data structures
Expand All @@ -147,7 +152,8 @@ convenient way to store rooms as they can easily be loaded by filename.

(2) Options for the BRIR synthesis are defined in a structure, called "op" in
most scripts and functions. All possible fields and their default values are
stored in BASE/GET_DEFAULT_OPTIONS.M.
stored in BASE/GET_DEFAULT_OPTIONS.M. To display options, check out also the
function "sop".
Some of them are experimental, refer to features in development (and thus not
contained in the current version), or might read unclear. In doubt, stick to
the default or contact the author. See EXAMPLES/EXAMPLE_OPTIONS.M to see how
Expand All @@ -174,8 +180,8 @@ Configuration structures are defined in RAZR_CFG_DEFAULT.M and RAZR_CFG_USER.M.
(The latter one is automatically created when you run razr for the first time.)
Internally, RAZR_CFG_USER overloads RAZR_CFG_DEFAULT. You can also create and
store several configuration files in parallel. In the file SELECT_RAZR_CFG.M,
you can specify what configuration is actually used. RAZR_CFG_USER is the
pre-defined one.
you can specify what configuration is actually used to override
RAZR_CFG_DEFAULT. RAZR_CFG_USER is the predefined one.


===============================================================================
Expand Down Expand Up @@ -284,7 +290,7 @@ I'd like to thank all the people who tested earlier versions of the Software,
contributed to it, reported on bugs, or made suggestions for improvements:
Thomas Biberger, Oliver Buttler, Stephan D. Ewert, Jan-Hendrik Flessner, Nico
Goessling, Julian Grosse, Andreas Haeussler, Stefan Klockgether, Steven van de
Par, Josef Poppitz, Joachim Thiemann.
Par, Josef Poppitz, Joachim Thiemann. (Sorry if I forgot someone here.)

All files in the directory ./BASE/EXTERNAL and all subdirectories are written
by other authors. Please see the file headers or license.txt files further
Expand Down
2 changes: 1 addition & 1 deletion analysis_tools/apply_rir.m
Expand Up @@ -53,7 +53,7 @@
%------------------------------------------------------------------------------
% RAZR engine for Mathwork's MATLAB
%
% Version 0.92
% Version 0.93
%
% Author(s): Torben Wendt
%
Expand Down
2 changes: 1 addition & 1 deletion analysis_tools/cutnwin.m
Expand Up @@ -24,7 +24,7 @@
%------------------------------------------------------------------------------
% RAZR engine for Mathwork's MATLAB
%
% Version 0.92
% Version 0.93
%
% Author(s): Torben Wendt
%
Expand Down
2 changes: 1 addition & 1 deletion analysis_tools/definition_clarity.m
Expand Up @@ -31,7 +31,7 @@
%------------------------------------------------------------------------------
% RAZR engine for Mathwork's MATLAB
%
% Version 0.92
% Version 0.93
%
% Author(s): Torben Wendt
%
Expand Down
6 changes: 3 additions & 3 deletions analysis_tools/eq_abs_surfarea.m
Expand Up @@ -19,7 +19,7 @@
%------------------------------------------------------------------------------
% RAZR engine for Mathwork's MATLAB
%
% Version 0.92
% Version 0.93
%
% Author(s): Torben Wendt
%
Expand Down Expand Up @@ -49,8 +49,8 @@

% subtract door surfaces from wall surfaces:
if isfield(room, 'door') && ~isempty(room.door) && ~isempty(door_idx)
idx = normdir2idx(room.door(door_idx, 1));
doorsurfs = prod(room.door(door_idx, [4, 5]), 2);
idx = normdir2idx(room.door(door_idx).wall);
doorsurfs = prod(room.door(door_idx).size, 2);
surfs(idx) = surfs(idx) - doorsurfs;
end

Expand Down
2 changes: 1 addition & 1 deletion analysis_tools/estimate_abscoeff.m
Expand Up @@ -16,7 +16,7 @@
%------------------------------------------------------------------------------
% RAZR engine for Mathwork's MATLAB
%
% Version 0.92
% Version 0.93
%
% Author(s): Torben Wendt
%
Expand Down
2 changes: 1 addition & 1 deletion analysis_tools/estimate_rt.m
Expand Up @@ -17,7 +17,7 @@
%------------------------------------------------------------------------------
% RAZR engine for Mathwork's MATLAB
%
% Version 0.92
% Version 0.93
%
% Author(s): Torben Wendt
%
Expand Down
2 changes: 1 addition & 1 deletion analysis_tools/fadeout_ir.m
Expand Up @@ -18,7 +18,7 @@
%------------------------------------------------------------------------------
% RAZR engine for Mathwork's MATLAB
%
% Version 0.92
% Version 0.93
%
% Author(s): Torben Wendt
%
Expand Down
2 changes: 1 addition & 1 deletion analysis_tools/headphone_eq/load_headphone_eq.m
Expand Up @@ -19,7 +19,7 @@
%------------------------------------------------------------------------------
% RAZR engine for Mathwork's MATLAB
%
% Version 0.92
% Version 0.93
%
% Author(s): Torben Wendt
%
Expand Down
2 changes: 1 addition & 1 deletion analysis_tools/iacc.m
Expand Up @@ -34,7 +34,7 @@
%------------------------------------------------------------------------------
% RAZR engine for Mathwork's MATLAB
%
% Version 0.92
% Version 0.93
%
% Author(s): Torben Wendt
%
Expand Down
2 changes: 1 addition & 1 deletion analysis_tools/ild.m
Expand Up @@ -16,7 +16,7 @@
%------------------------------------------------------------------------------
% RAZR engine for Mathwork's MATLAB
%
% Version 0.92
% Version 0.93
%
% Author(s): Torben Wendt
%
Expand Down
2 changes: 1 addition & 1 deletion analysis_tools/ild_t_ir.m
Expand Up @@ -23,7 +23,7 @@
%------------------------------------------------------------------------------
% RAZR engine for Mathwork's MATLAB
%
% Version 0.92
% Version 0.93
%
% Author(s): Torben Wendt
%
Expand Down
2 changes: 1 addition & 1 deletion analysis_tools/lundeby_crosspoint.m
Expand Up @@ -20,7 +20,7 @@
%------------------------------------------------------------------------------
% RAZR engine for Mathwork's MATLAB
%
% Version 0.92
% Version 0.93
%
% Author(s): Torben Wendt
%
Expand Down
2 changes: 1 addition & 1 deletion analysis_tools/plot_diffr_filters.m
Expand Up @@ -16,7 +16,7 @@
%------------------------------------------------------------------------------
% RAZR engine for Mathwork's MATLAB
%
% Version 0.92
% Version 0.93
%
% Author(s): Torben Wendt
%
Expand Down
2 changes: 1 addition & 1 deletion analysis_tools/plot_ir.m
Expand Up @@ -27,7 +27,7 @@
%------------------------------------------------------------------------------
% RAZR engine for Mathwork's MATLAB
%
% Version 0.92
% Version 0.93
%
% Author(s): Torben Wendt
%
Expand Down
2 changes: 1 addition & 1 deletion analysis_tools/plot_irspec.m
Expand Up @@ -35,7 +35,7 @@
%------------------------------------------------------------------------------
% RAZR engine for Mathwork's MATLAB
%
% Version 0.92
% Version 0.93
%
% Author(s): Torben Wendt
%
Expand Down
2 changes: 1 addition & 1 deletion analysis_tools/plot_irspecgram.m
Expand Up @@ -4,7 +4,7 @@
%------------------------------------------------------------------------------
% RAZR engine for Mathwork's MATLAB
%
% Version 0.92
% Version 0.93
%
% Author(s): Torben Wendt
%
Expand Down
2 changes: 1 addition & 1 deletion analysis_tools/resample_ir.m
Expand Up @@ -14,7 +14,7 @@
%------------------------------------------------------------------------------
% RAZR engine for Mathwork's MATLAB
%
% Version 0.92
% Version 0.93
%
% Author(s): Torben Wendt
%
Expand Down
45 changes: 22 additions & 23 deletions analysis_tools/scene.m
Expand Up @@ -14,7 +14,7 @@
% Optional Name-Value-pair arguments (defaults in parentheses):
%
% Plotting:
% –––––––––
% ---------
% topview (false) Show room sketch from top view
% roomcolors (one room: [0 0 0]; multiple rooms: lines(length(rooms))) Matrix containing
% rgb values for each room. Each row represents one room.
Expand All @@ -26,7 +26,7 @@
% xl_doors (false) If true, enlarge doors, such that they are on the top level for top view
%
% Labels:
% –––––––
% -------
% materials (true) If wall materials are specified as key strings (see RAZR, GETABSCOEFF),
% label them on the respective walls
% srclabel ('') Labels for source(s). Cell array of strings or single string. If empty,
Expand All @@ -39,7 +39,7 @@
% title ('') Axes title with interpreter 'none'
%
% Image sources:
% ––––––––––––––
% --------------
% (for these plotting options, the ism_data structure, returned by razr, is required):
% ism_data (empty struct) ism_data-structure as being returned by razr
% plot_ispos (false) If true, plot image source positions, stored in ism_data
Expand All @@ -57,7 +57,7 @@
%------------------------------------------------------------------------------
% RAZR engine for Mathwork's MATLAB
%
% Version 0.92
% Version 0.93
%
% Author(s): Torben Wendt
%
Expand Down Expand Up @@ -133,10 +133,10 @@
labeloffset = [1 1 1].*(p.Results.labeloffset);

if iscell(adj)
adj = adj2idx({rooms.name}, adj);
adjx = adj2adjx(rooms, adj);
end

h.origins = get_room_origins(rooms, adj);
rooms = add_room_origins(rooms, adjx);

%%

Expand All @@ -151,40 +151,39 @@
for r = 1:numRooms;
% abbvrevs:
room = rooms(r);
origin = h.origins(r, :);
b = room.boxsize;

%% rooms:
h.plot.room(:, r) = plotbox(...
h.ax, b, origin, 'linewidth', 3, 'color', p.Results.roomcolors(r, :));
h.ax, b, room.origin, 'linewidth', 3, 'color', p.Results.roomcolors(r, :));

hold on

%% doors:
if isfield(room, 'door')
[rows, cols] = find(adj.rooms == r);
[rows, cols] = find(adjx.rooms == r);
numA = length(rows);
doors_of_cur_room = zeros(numA, 1);
states_of_cur_room = zeros(numA, 1);
for a = 1:numA
doors_of_cur_room(a) = adj.doors(rows(a), cols(a));
states_of_cur_room(a) = adj.states(rows(a));
doors_of_cur_room(a) = adjx.doors(rows(a), cols(a));
states_of_cur_room(a) = adjx.states(rows(a));
end

[wall_idx_abs, other_idxs] = idx_door_wall(room);

for d = 1:size(room.door, 1)
for d = 1:length(room.door)
doorbox(wall_idx_abs(d)) = 0; % thickness of door
doorbox(other_idxs(d, :)) = room.door(d, [4, 5]);
doorbox(other_idxs(d, :)) = room.door(d).size;
door_origin(wall_idx_abs(d)) = ...
b(wall_idx_abs(d)) * (sign(room.door(d, 1)) == 1) - sign(room.door(d, 1))*0.01;
door_origin(other_idxs(d, :)) = room.door(d, [2, 3]);
b(wall_idx_abs(d)) * (sign(room.door(d).wall) == 1) - sign(room.door(d).wall)*0.01;
door_origin(other_idxs(d, :)) = room.door(d).pos;

if p.Results.xl_doors
doorbox(3) = room.boxsize(3) + 1;
end
% increased linewidth to be visible in top view, too:
h.plot.door(:, d) = plotbox(h.ax, doorbox, door_origin + origin, ...
h.plot.door(:, d) = plotbox(h.ax, doorbox, door_origin + room.origin, ...
'linewidth', 5.0, 'color', p.Results.doorcolors(r, :));

% door state (temporally disabled, not important at the moment):
Expand All @@ -198,7 +197,7 @@
%% source(s):
if isfield(room, 'srcpos') && ~isempty(room.srcpos)
numSrc = size(room.srcpos, 1);
srcpos = room.srcpos + repmat(origin, numSrc, 1);
srcpos = room.srcpos + repmat(room.origin, numSrc, 1);
srclabel = get_labels(p.Results.srclabel, numSrc, 'Src');

if size(p.Results.srccolor, 1) == 1
Expand Down Expand Up @@ -239,7 +238,7 @@
end

for n = 1:numRec
recpos = room.recpos(n, :) + origin;
recpos = room.recpos(n, :) + room.origin;
h.plot.rec(n) = plot3(recpos(1), recpos(2), recpos(3), 'o', ...
'Linewidth', 2, 'markersize', 8, ...
'color', reccol(n, :), 'markerfacecolor', reccol(n, :));
Expand Down Expand Up @@ -281,7 +280,7 @@
mpos(4,:) = mpos(3,:) + [1 0 0].*b; % +x
mpos(5,:) = mpos(2,:) + [0 1 0].*b; % +y
mpos(6,:) = mpos(1,:) + [0 0 1].*b; % +z
mpos = mpos + repmat(origin, 6, 1);
mpos = mpos + repmat(room.origin, 6, 1);

h.text = text(mpos(:, 1), mpos(:, 2), mpos(:, 3), room.materials, ...
'HorizontalAlignment', 'center', 'Interpreter', 'none');
Expand All @@ -294,7 +293,7 @@
error('ism_data must be passed to scene if ISM positions shall be plotted.');
end

h = plot_ism(h, room, origin, p);
h = plot_ism(h, room, p);

if isfield(h.plot, 'img_src') && ~isempty(h.plot.img_src)
for is = 1:length(h.plot.img_src)
Expand Down Expand Up @@ -371,7 +370,7 @@

end

function h = plot_ism(h, room, origin, p)
function h = plot_ism(h, room, p)

if isempty(p.Results.ism_order)
desired_orders = unique(p.Results.ism_data.order);
Expand All @@ -395,8 +394,8 @@

numSrc = size(p.Results.ism_data.positions, 1);

pos = p.Results.ism_data.positions(:, 1:3) + repmat(origin, numSrc, 1);
pos_jit = p.Results.ism_data.relpos(:, 1:3) + repmat(origin, numSrc, 1) + repmat(room.recpos, numSrc, 1);
pos = p.Results.ism_data.positions(:, 1:3) + repmat(room.origin, numSrc, 1);
pos_jit = p.Results.ism_data.relpos(:, 1:3) + repmat(room.origin, numSrc, 1) + repmat(room.recpos, numSrc, 1);
idx_a = p.Results.ism_data.idx_auralize;


Expand Down
2 changes: 1 addition & 1 deletion analysis_tools/schroeder_rt.m
Expand Up @@ -39,7 +39,7 @@
%------------------------------------------------------------------------------
% RAZR engine for Mathwork's MATLAB
%
% Version 0.92
% Version 0.93
%
% Author(s): Torben Wendt
%
Expand Down

0 comments on commit d910d17

Please sign in to comment.