Commit 383c1b1e authored by fpa's avatar fpa

Merge branch 'master' of https://git.rwth-aachen.de/ita/toolbox

parents eba7a51d 946242cc
......@@ -21,16 +21,19 @@ classdef itaRavenProject < handle
%
% Example:
% rpf = itaRavenProject();
% rpf.SetModel('cave.ac')
% rpf.run()
% rpf.getReverbTime()
% rpf.SetModel('cave.ac');
% rpf.getEquationBasedReverbTime(); returns reverb time based on
% sabine equation
% rpf.run(); run simulation
% rpf.getT30(); get T30 based on simulation
%
%
% Author: Soenke Pelzer (spe@akustik.rwth-aachen.de)
% Lukas Aspck (las@akustik.rwth-aachen.de)
%
% Version: 0.1
% First release: 01.11.10
% Last revision: 12.09.16
% Last revision: 27.03.18
% Copyright: Institute of Technical Acoustics, RWTH Aachen University
%
......@@ -2810,8 +2813,8 @@ classdef itaRavenProject < handle
end
%------------------------------------------------------------------
function RT = getReverbTime(obj, eyring, roomID)
%RT = getReverbTime(eyring, roomID)
function RT = getEquationBasedReverbTime(obj, eyring, roomID)
%RT = getEquationBasedReverbTime(eyring, roomID)
%
% returns the estimated reverberation time of the current room.
%
......@@ -2843,21 +2846,21 @@ classdef itaRavenProject < handle
% get reverberation time
if (eyring == 1)
airAbsorption = determineAirAbsorptionParameter(obj.getTemperature, obj.getPressure, obj.getHumidity);
RT = roommodel.getReverbTime(obj.pathMaterials, 'eyring', airAbsorption);
RT = roommodel.getEquationBasedReverbTime(obj.pathMaterials, 'eyring', airAbsorption);
else
airAbsorption = determineAirAbsorptionParameter(obj.getTemperature, obj.getPressure, obj.getHumidity);
RT = roommodel.getReverbTime(obj.pathMaterials, 'sabine', airAbsorption);
RT = roommodel.getEquationBasedReverbTime(obj.pathMaterials, 'sabine', airAbsorption);
end
end
%------------------------------------------------------------------
function RT = getReverbTime_Sabine(obj)
RT = obj.getReverbTime(0);
RT = obj.getEquationBasedReverbTime(0);
end
%------------------------------------------------------------------
function RT = getReverbTime_Eyring(obj)
RT = obj.getReverbTime(1);
RT = obj.getEquationBasedReverbTime(1);
end
%------------------------------------------------------------------
......
......@@ -69,6 +69,7 @@ classdef load_ac3d
mat_rows = find(strcmp(ac3d,'MATERIAL')==1); % Zeilenindizes der Materialien
MatNames = ac3d(mat_rows,2); % Cell der Material Namen
MatNames = strrep(MatNames,'"',''); % make sure that no quotation marks are in the material
MatColors = str2double(ac3d(mat_rows,4:6)); % Matrix der RGB Material Farben
......
......@@ -5,6 +5,8 @@ classdef DAFF < handle
end
methods
function obj = DAFF( filepath )
%% Create DAFF class and load from file
% filepath Path to DAFF file
if( nargin > 0 )
open( filepath )
end
......@@ -12,14 +14,56 @@ classdef DAFF < handle
function open( obj, filepath )
obj.daffhandle = DAFFv17( 'open', filepath );
end
function close( obj )
end
function set_data_view( obj )
obj.view = 'data';
end
function set_object_view( obj )
obj.view = 'object';
end
function metadata = get_metadata(obj)
%% Returns the metadata of an opened DAFF file
metadata = DAFFv17('getMetadata', obj.daffhandle);
end
function metadata = get_record_metadata( obj, index )
%% Returns the record metadata of an opened DAFF file
metadata = DAFFv17('getRecordMetadata', obj.daffhandle, index);
end
function props = get_properties( obj )
%% Returns the properties of an opened DAFF file
props = DAFFv17( 'getProperties', obj.daffhandle );
function coords = get_record_coords( obj, index )
%% Returns the coordinates of a grid point
coords = DAFFv17( 'getRecordCoords', obj.daffhandle, obj.view, index );
end
function idx = get_nearest_neighbour_index( obj, azi_deg, ele_deg )
idx = DAFFv17( obj.daffhandle, 'getNearestNeighbourIndex', obj.view, azi_deg, ele_deg );
%% Returns the data at the nearest neighbour grid point to the given direction
idx = DAFFv17( 'getNearestNeighbourIndex', obj.daffhandle, obj.view, azi_deg, ele_deg );
end
function data = get_nearest_neighbour_record( obj, azi_deg, ele_deg )
%% Returns the data at the nearest neighbour grid point to the given direction
data = DAFFv17( 'getNearestNeighbourRecord', obj.daffhandle, obj.view, azi_deg, ele_deg );
end
function rec = get_record_by_index( obj, idx )
%% Returns the data at a grid of the given index
rec = DAFFv17( 'getRecordByIndex', obj.daffhandle, idx );
end
function data = get_cell_records( obj, azi_deg, ele_deg )
%% Returns the data of all four records of the surrounding cell to the given direction
data = DAFFv17('getCellRecords', obj.daffhandle, obj.view, azi_deg, ele_deg );
end
function idx = get_cell( obj, azi_deg, ele_deg )
%% Returns the data at the nearest neighbour grid point to the given direction
idx = DAFFv17( 'getCell', obj.daffhandle, obj.view, azi_deg, ele_deg );
end
function get_version( obj )
%% Returns the OpenDAFF version
DAFFv17('getVersion')
end
function help( obj )
DAFFv17('help');
end
end
end
h = DAFFv17( 'open', 'FABIAN_HATO_5x5x5_256_44100Hz.v17.ir.daff' );
sound_sample = ita_read('Bongos.wav');
[ hrir_left_raw, ~ ] = DAFFv17( 'getNearestNeighbourRecord', h , 'object', 0, 0 );
% for i = 1:17
% a = 2*i - 1;
% b = 2*i;
% hrir_left_hato_0 = itaAudio;
% hrir_left_hato_0.timeData = hrir_left_raw( a:b, : )';
%
% binaural_demosound = ita_convolve( sound_sample, hrir_left_hato_0 );
% binaural_demosound.play
% end
[ hrir_left_raw, ~ ] = DAFFv17( h, 'getNearestNeighbourRecord', 'object', 90, 0 );
hrir_left_hato_0 = itaAudio;
hrir_left_hato_0.timeData = hrir_left_raw( 1:2, : )';
binaural_demosound = ita_convolve( ita_demosound, hrir_left_hato_0 );
binaural_demosound.play
binaural_demosound_hato_0 = ita_convolve( sound_sample, hrir_left_hato_0 );
binaural_demosound_hato_0.play
hrir_left_hato_320 = itaAudio;
hrir_left_hato_320.timeData = hrir_left_raw( 3:4, : )';
binaural_demosound_hato_320 = ita_convolve( sound_sample, hrir_left_hato_320 );
binaural_demosound_hato_320.play
hrir_left_hato_40 = itaAudio;
hrir_left_hato_40.timeData = hrir_left_raw( 33:34, : )';
binaural_demosound_hato_40 = ita_convolve( sound_sample, hrir_left_hato_40 );
binaural_demosound_hato_40.play
% [ hrir_left_raw, ~ ] = DAFFv17( 'getNearestNeighbourRecord', h , 'object', 90, -40 );
%
% hrir_left_hato_0 = itaAudio;
% hrir_left_hato_0.timeData = hrir_left_raw( 1:2, : )';
%
% binaural_demosound = ita_convolve( sound_sample, hrir_left_hato_0 );
% binaural_demosound.play
%
%
% [ hrir_left_raw, ~ ] = DAFFv17( 'getNearestNeighbourRecord', h , 'object', 90, 40 );
%
% hrir_left_hato_0 = itaAudio;
% hrir_left_hato_0.timeData = hrir_left_raw( 1:2, : )';
%
% binaural_demosound = ita_convolve( sound_sample, hrir_left_hato_0 );
% binaural_demosound.play
% for i = 1:4
% [ hrir_left_raw, ~ ] = DAFFv17( 'getNearestNeighbourRecord', h , 'object', 90, (-50 + i*10) );
%
% hrir_left_hato_0 = itaAudio;
% hrir_left_hato_0.timeData = hrir_left_raw( 1:2, : )';
%
% binaural_demosound = ita_convolve( sound_sample, hrir_left_hato_0 );
% binaural_demosound.play
% end
%
% for i = 1:4
% [ hrir_left_raw, ~ ] = DAFFv17( 'getNearestNeighbourRecord', h , 'object', 90, i*10 );
%
% hrir_left_hato_0 = itaAudio;
% hrir_left_hato_0.timeData = hrir_left_raw( 1:2, : )';
%
% binaural_demosound = ita_convolve( sound_sample, hrir_left_hato_0 );
% binaural_demosound.play
% end
\ No newline at end of file
Markdown is supported
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