Commit eecb9902 authored by Lukas Aspöck's avatar Lukas Aspöck
Browse files

Adjusted RAVEN example scripts for full-sphere simulation using the VA's...

Adjusted RAVEN example scripts for full-sphere simulation using the VA's binaural freefield renderer
parent 91f7af7f
...@@ -12,7 +12,7 @@ function [ data, samplerate, metadata ] = dfRavenBinauralVA( alpha, beta, rpf ) ...@@ -12,7 +12,7 @@ function [ data, samplerate, metadata ] = dfRavenBinauralVA( alpha, beta, rpf )
rpf.setReceiverUpVectors( ita_matlab2openGL( up.cart ) ); rpf.setReceiverUpVectors( ita_matlab2openGL( up.cart ) );
rpf.run(); rpf.run();
brir = rpf.getBinauralImpulseResponseItaAudio; brir = rpf.getBinauralImpulseResponseImageSourcesItaAudio; % only early reflections are requested, use rpf.getBinauralImpulseResponseItaAudio if you want to get the full impulse response (and adjust the filter length in your rpf accordingly)
n_residual = mod( brir.nSamples, 4 ); n_residual = mod( brir.nSamples, 4 );
data = [ brir.timeData', zeros( brir.nChannels, n_residual ) ]; data = [ brir.timeData', zeros( brir.nChannels, n_residual ) ];
......
...@@ -1917,7 +1917,8 @@ classdef itaRavenProject < handle ...@@ -1917,7 +1917,8 @@ classdef itaRavenProject < handle
end end
%------------------------------------------------------------------ %------------------------------------------------------------------
function setFilterLength(obj, filter_length) % filter length parameter needed in [ms] function setFilterLength(obj, filter_length)
% set filter length in ms
if filter_length < 3 if filter_length < 3
filter_length = filter_length * 1000; filter_length = filter_length * 1000;
filter_length = fix(filter_length); filter_length = fix(filter_length);
......
...@@ -54,6 +54,8 @@ if( simulate_room ) ...@@ -54,6 +54,8 @@ if( simulate_room )
rpf.setSourceViewVectors([-1 0 0]); rpf.setSourceViewVectors([-1 0 0]);
rpf.setSourceUpVectors([0 1 0]); rpf.setSourceUpVectors([0 1 0]);
rpf.setFilterLength(1100); rpf.setFilterLength(1100);
rpf.setSimulationTypeIS(1);
rpf.setSimulationTypeRT(1);
%------------------------Create receiver orientations---------------------- %------------------------Create receiver orientations----------------------
......
%% RAVEN head rotiation simulation & Auralization with VirtualAcoustics %% RAVEN head rotiation simulation & Auralization with VirtualAcoustics
% %
% Author: Henry Andrew / Lukas Aspck % Author: Henry Andrew / Lukas Aspck / Jonas Stienen
% Contact: las@akustik.rwth-aachen.de % Contact: las@akustik.rwth-aachen.de
% date: 2019/06/19 % date: 2019/06/19
% %
% Example to simulate head rotation in a classroom and store it in a DAFF file % Example to simulate head rotation in a classroom and store it in a DAFF
% file (in this example file, only early reflections)
% For auralization, use VA's binaural free field renderer and set the HRIR database % For auralization, use VA's binaural free field renderer and set the HRIR database
% to the simulated BRIR database % to the simulated BRIR database
% %
...@@ -17,12 +18,12 @@ ...@@ -17,12 +18,12 @@
%--------------------------------User Settings----------------------------- %--------------------------------User Settings-----------------------------
% Modify path if RAVEN was not installed in the default location % Modify path if RAVEN was not installed in the default location
ravenBasePath = 'D:\Users\stienen\dev\ITASuite\RAVEN\RavenProjects\TestShoeboxRoom\'; ravenBasePath = 'C:\ITASoftware\Raven\';
raven_project_filename = [ ravenBasePath 'TestShoeboxRoom.rpf'];%'Shoebox_room.rpf'; %raven project file of room raven_project_filename = [ ravenBasePath 'RavenInput\Classroom\Classroom.rpf'];%'Shoebox_room.rpf'; %raven project file of room
source_directivity_filename = [ ravenBasePath 'SourceDirectivity/Cardioid.v17.ms.daff']; %path to raven database emtries source_directivity_filename = [ ravenBasePath 'RavenDatabase\DirectivityDatabase\Singer_2011_FWE_TLE_norm.daff']; %path to raven database emtries
receiver_directivity_filename = [ ravenBasePath 'HRTF\ITA_Artificial_Head_5x5_44kHz_192_win15_shifted90.v17.ir.daff']; receiver_directivity_filename = [ ravenBasePath 'RavenDatabase\HRTF\2017_FABIAN_HATO-0_HRIR_LAS_D170_1x1_128_norm_sampleShift10.v15.daff'];
out_file_prefix = 'TestShoebox'; out_file_prefix = 'Classroom';
source_position = [7.0000 1.7000 -4.0000]; %NOTE, make sure these are inside the room! source_position = [7.0000 1.7000 -4.0000]; %NOTE, make sure these are inside the room!
receiver_position = [3 1.7 -4]; %NOTE: in openGL coordinated (used by RAVEN) the "up/down" direction is the second element, and the third element is different from matlab coordinates by a factor of -1 receiver_position = [3 1.7 -4]; %NOTE: in openGL coordinated (used by RAVEN) the "up/down" direction is the second element, and the third element is different from matlab coordinates by a factor of -1
...@@ -38,7 +39,7 @@ automatic_rotate_sim = true; %set to true to automatically rotate the room, or f ...@@ -38,7 +39,7 @@ automatic_rotate_sim = true; %set to true to automatically rotate the room, or f
%loads data from a raven project. Incudes lots of methods to calculate things/ extract data etc %loads data from a raven project. Incudes lots of methods to calculate things/ extract data etc
rpf = itaRavenProject(raven_project_filename); rpf = itaRavenProject(raven_project_filename);
rpf.setModel([ ravenBasePath 'RoomModels\TestShoebox.ac']); rpf.setModel([ ravenBasePath 'RavenModels\Classroom\Classroom_empty.ac']);
DAFF17FileName = [out_file_prefix '_' num2str(azimuthResolution) 'x' num2str(elevationResolution) '.v17.ir.daff']; DAFF17FileName = [out_file_prefix '_' num2str(azimuthResolution) 'x' num2str(elevationResolution) '.v17.ir.daff'];
...@@ -55,7 +56,9 @@ if( simulate_room ) ...@@ -55,7 +56,9 @@ if( simulate_room )
rpf.setSourceDirectivity(source_directivity_filename); rpf.setSourceDirectivity(source_directivity_filename);
rpf.setSourceViewVectors([-1 0 0]); rpf.setSourceViewVectors([-1 0 0]);
rpf.setSourceUpVectors([0 1 0]); rpf.setSourceUpVectors([0 1 0]);
rpf.setFilterLength(1100); rpf.setFilterLength(100); % early reflections only
rpf.setSimulationTypeIS(1);
rpf.setSimulationTypeRT(0);
additional_metadata = daffv17_add_metadata( [], 'Web resource', 'String', 'http://www.opendaff.org' ); additional_metadata = daffv17_add_metadata( [], 'Web resource', 'String', 'http://www.opendaff.org' );
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment