Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
VAMatlab
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Iterations
Merge Requests
0
Merge Requests
0
Requirements
Requirements
List
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Operations
Operations
Incidents
Analytics
Analytics
Code Review
Insights
Issue
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Institute of Technical Acoustics (ITA)
VAMatlab
Commits
5b6720ad
Commit
5b6720ad
authored
Aug 22, 2019
by
Dipl.-Ing. Jonas Stienen
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'develop' of
https://git.rwth-aachen.de/ita/VAMatlab
into develop
parents
197bf887
38ade209
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
71 additions
and
7 deletions
+71
-7
matlab/VA_example_ppa.m
matlab/VA_example_ppa.m
+69
-5
matlab/ppa_run_analysis.m
matlab/ppa_run_analysis.m
+2
-2
No files found.
matlab/VA_example_ppa.m
View file @
5b6720ad
...
...
@@ -6,7 +6,8 @@
% Requires ITA-Toolbox, obtain from http://www.ita-toolbox.org
output_folder
=
fullfile
(
'C:\Users\jonas\sciebo\Thesis stuff\auralization\resources'
,
'example_ppa/s1_r1'
);
%output_folder = fullfile( 'C:\Users\jonas\sciebo\Thesis stuff\auralization\resources', 'example_ppa/s1_r1' );
output_folder
=
fullfile
(
'D:\Users\stienen\Sciebo\Thesis stuff\auralization\resources'
,
'example_ppa/s1_r1'
);
frame_rate
=
128
/
44100
;
% block length / sampling frequency
sort_by_date
=
false
;
...
...
@@ -17,11 +18,11 @@ S = 1;
R
=
1
;
ppa_example_mode
=
questdlg
(
'Please select'
,
'VA example ppa mode selection'
,
...
'simulation'
,
'auralization'
,
'
both
'
,
'auralization'
);
'simulation'
,
'auralization'
,
'
all
'
,
'auralization'
);
ppa_example_mode
=
'postprocessing'
%% Prepare run data
if
any
(
strcmpi
(
ppa_example_mode
,
{
'simulation'
,
'
both
'
}
)
)
if
any
(
strcmpi
(
ppa_example_mode
,
{
'simulation'
,
'
all
'
}
)
)
if
~
exist
(
output_folder
,
'dir'
)
mkdir
(
output_folder
)
...
...
@@ -184,8 +185,67 @@ if any( strcmpi( ppa_example_mode, { 'simulation', 'both' } ) )
end
%% Run postprocessing
postproc_all_paths
=
struct
();
if
any
(
strcmpi
(
ppa_example_mode
,
{
'postprocessing'
,
'all'
}
)
)
% Load data
file_listing
=
dir
(
strcat
(
output_folder
,
'/frame*data.mat'
)
);
N
=
numel
(
file_listing
);
fprintf
(
'Found data on %i frames in folder
''
%s
''
\n'
,
N
,
output_folder
)
if
sort_by_date
frame_datenums
=
zeros
(
N
,
1
);
for
n
=
1
:
N
frame_datenums
(
n
)
=
file_listing
(
n
)
.
datenum
;
end
[
~
,
idx
]
=
sort
(
frame_datenums
);
else
idx
=
1
:
N
;
end
h
=
waitbar
(
0
,
'Hold on, running postprocessing on generated data'
);
% Run postprocessing over frames from front and back
for
n
=
1
:
N
idx_current_front
=
idx
(
n
);
load
(
fullfile
(
output_folder
,
file_listing
(
idx_current_front
)
.
name
),
'-mat'
);
pathnames
=
fieldnames
(
paths_update
);
for
p
=
1
:
numel
(
pathnames
)
path_id
=
pathnames
{
p
};
if
~
isfield
(
postproc_all_paths
,
path_id
)
||
~
isfield
(
postproc_all_paths
.
(
path_id
),
'first_frame'
)
postproc_all_paths
.
(
path_id
)
.
first_frame
=
n
;
end
end
idx_current_back
=
idx
(
N
+
1
-
n
);
load
(
fullfile
(
output_folder
,
file_listing
(
idx_current_back
)
.
name
),
'-mat'
);
pathnames
=
fieldnames
(
paths_update
);
for
p
=
1
:
numel
(
pathnames
)
path_id
=
pathnames
{
p
};
if
~
isfield
(
postproc_all_paths
,
path_id
)
||
~
isfield
(
postproc_all_paths
.
(
path_id
),
'last_frame'
)
postproc_all_paths
.
(
path_id
)
.
last_frame
=
N
+
1
-
n
;
end
end
waitbar
(
n
/
N
)
end
save
(
fullfile
(
output_folder
,
'postprocessing_data.mat'
),
'postproc_all_paths'
)
close
(
h
)
end
%% Run auralization
if
any
(
strcmpi
(
ppa_example_mode
,
{
'auralization'
,
'
both
'
}
)
)
if
any
(
strcmpi
(
ppa_example_mode
,
{
'auralization'
,
'
all
'
}
)
)
% Load data
...
...
@@ -246,6 +306,8 @@ if any( strcmpi( ppa_example_mode, { 'auralization', 'both' } ) )
source_pos_OpenGL
=
ita_matlab2openGL
(
source_pos
(
1
:
3
)
'
);
receiver_pos_OpenGL
=
ita_matlab2openGL
(
receiver_pos
(
1
:
3
)
'
);
va
.
lock_update
% Update receiver (last anchor)
va
.
set_sound_source_position
(
S
,
source_pos_OpenGL
);
va
.
set_sound_receiver_position
(
R
,
receiver_pos_OpenGL
);
...
...
@@ -257,6 +319,8 @@ if any( strcmpi( ppa_example_mode, { 'auralization', 'both' } ) )
else
disp
(
'not found, skipping update'
)
end
va
.
unlock_update
% Increment core clock
manual_clock
=
manual_clock
+
frame_rate
;
...
...
matlab/ppa_run_analysis.m
View file @
5b6720ad
%% Input conditions
target_path
=
'path_
50df740f16865a987b4b69ff1bb12c2f
'
;
%path to follow through simulation
target_path
=
'path_
003ca6d3a74540310873574908219251
'
;
%path to follow through simulation
%target_path = 'diffracted_path';
input_folder
=
'example_ppa\s1_r1'
;
input_folder
=
fullfile
(
'D:\Users\stienen\Sciebo\Thesis stuff\auralization\resources'
,
'example_ppa/s1_r1'
)
;
out_filename
=
'Path_evolution.gif'
;
out_filename_freq
=
'Path_evolution_freq.gif'
;
plot_single_path_freq
=
true
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment