diff --git a/applications/VirtualAcoustics/Raven/ita_raven_demo.m b/applications/VirtualAcoustics/Raven/ita_raven_demo.m index 7c37e3eb5bfa1abc1bb438aa0be6e0a806d478d4..b6e1da598c0e08f565820b7cbc8ee49be98af2b9 100644 --- a/applications/VirtualAcoustics/Raven/ita_raven_demo.m +++ b/applications/VirtualAcoustics/Raven/ita_raven_demo.m @@ -1,4 +1,4 @@ -% 1. Matlab Pfad einstellen!!!!! +% 1. set/check matlab paths % <ITA-Toolbox> @@ -7,70 +7,73 @@ % </ITA-Toolbox> %% Projektdatei einlesen -% project laden -rpf = itaRavenProject('..\RavenInput\Classroom\trilateration.rpf'); - +% load ita raven project +rpf = itaRavenProject('..\RavenInput\Classroom\Classroom.rpf'); %% Simulationsparameter einstellen -% spiegelquellen bis 2. ordnung +% Image sources up to second order rpf.setISOrder_PS(2); % 20000 ray tracing partikel -rpf.setNumParticles(20000); +rpf.setNumParticles(200); -% L�nge der Impulsantwort einstellen (sollte mindestens der Nachhallzeit entprechen!) +% set impulse response length in ms (at least length of reverberation time) rpf.setFilterLength(2800); %[ms] -% rpf.setFilterLengthToReverbTime(); % sch�tzt �ber Eyring die Nachhallzeit und passt die Filterl�nge an +% rpf.setFilterLengthToReverbTime(); % estimates reverberation time and +% sets rpf.filterLength to this value -% Raumtemperatur einstellen +% set room temperature rpf.setTemperature(21); %�C -%% Simulationsausgabe definieren -% befehle monaurale impulsantwort +%% Define simulation outputs +% create monaural room impulse response rpf.setGenerateRIR(1); -% befehle binaurale impulsantwort +% create binaural room impulse response rpf.setGenerateBRIR(1); -% histogramme berechnen +% create and export energy histograms rpf.setExportHistogram(1); % histogramme z.B. ben�tigt f�r schnelle Nachhallzeitauswertung (RavenProject.getT30) %% Quell- und Empf�ngerdaten -% quell position setzen +% set source positions rpf.setSourcePositions([9 1.7 -2.5]); rpf.setSourceViewVectors([-1 0 0]); rpf.setSourceUpVectors([0 1 0]); -% receiver position setzen +% set receiver positions rpf.setReceiverPositions([4.4500 1.0000 -3.9000]); -% quellnamen setzen +% set sound source names rpf.setSourceNames('Speaker Left'); -% directivity setzen +% set source directivity rpf.setSourceDirectivity('KH_O100_Oli_5x5_3rd_relativiert_auf_azi0_ele0.daff'); -%% Simulation starten -% simulation abfeuern +%% start simulation +% run simulation rpf.run; %% Ergebnisse abholen -% monaurale impulsantwort holen -mono_ir = rpf.getMonauralImpulseResponseItaAudio(); % oder rpf.getMonauralImpulseResponse() ohne ITA-Toolbox +% get room impulse responses +mono_ir = rpf.getMonauralImpulseResponseItaAudio(); % rpf.getMonauralImpulseResponse() without ITA-Toolbox binaural = rpf.getBinauralImpulseResponseItaAudio(); reverb_time = rpf.getT30(); %% ITA-Toolbox...... -mono_ir.plot_time; % plotte monaurale IR im Zeitbereich -binaural.plot_freq; % plotte binaurale IR im Frequenzbereich +mono_ir.plot_time; % plot monaural RIR in time domain +binaural.plot_freq; % plot binaural RIR in time domain -%% Beispiel: Lautsprecher einrechnen +%% Example: Include loudspeaer frequency response in RIR (for comparisons with measurements) ls_O100 = ita_read('..\RavenDatabase\FrequencyResponse\KH_O100_reference_holesclosed_final_at1V1m_fft14.ita'); ir_mit_lautsprecher = ita_convolve(mono_ir, ls_O100); %% Additional features -% model zeigen -% rpf.plotModel; +% show room model including sound sources + rpf.plotModel; + + % show absorption coefficients + rpf.plotMaterialsAbsorption;