-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhomula_rir.m
More file actions
68 lines (50 loc) · 1.91 KB
/
Copy pathhomula_rir.m
File metadata and controls
68 lines (50 loc) · 1.91 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
% HOMULA-RIR sample code
% Author: Federico Miotello (Politecnico di Milano)
% Email: federico.miotello@polimi.it
% Date: April 2024
% Reference: F. Miotello et al., "HOMULA-RIR: A Room Impulse Response Dataset for Teleconferencing and Spatial Audio Applications Acquired through Higher-Order Microphones and Uniform Linear Microphone Arrays," 2024 IEEE International Conference on Acoustics, Speech, and Signal Processing Workshops (ICASSPW)
% doi: 10.1109/ICASSPW62465.2024.10626753.
clear;
close all;
clc;
%% Dataset root
base_dir = 'HOMULA-RIR'; % Update this path if needed.
source_id = 1;
array_id = 'R3-HOM2';
row_dir = 'row3';
ch = 1;
wav_file = fullfile(base_dir, 'hom', row_dir, sprintf('rir-S%d-%s.wav', source_id, array_id));
mic_pos_file = fullfile(base_dir, 'hom', row_dir, sprintf('pos-%s.csv', array_id));
source_pos_file = fullfile(base_dir, 'pos-sources.csv');
assert(isfolder(base_dir), 'Dataset folder not found: %s', base_dir);
%% Read one RIR
[rir, fs] = audioread(wav_file);
%% Plot one RIR channel
samples_to_plot = round(0.1 * fs);
time_ax = (0:size(rir, 1) - 1) / fs;
figure(1)
plot(time_ax(1:samples_to_plot), rir(1:samples_to_plot, ch));
xlabel('Time [s]');
ylabel('Amplitude');
title(sprintf('RIR from S%d to %s, channel %d', source_id, array_id, ch));
%% Plot source and microphone positions
sources_pos = table2array(readtable(source_pos_file));
mic_pos = table2array(readtable(mic_pos_file));
% Room dimensions
x_dim = [0 5.46];
y_dim = [0 14.52];
z_dim = [0 3.38];
figure(2)
hold on
axis equal
scatter3(mic_pos(:,1), mic_pos(:,2), mic_pos(:,3), 'blue')
scatter3(sources_pos(source_id,1), sources_pos(source_id,2), sources_pos(source_id,3), 'green')
hold off
xlim(x_dim);
ylim(y_dim);
zlim(z_dim);
xlabel('x axis');
ylabel('y axis');
zlabel('z axis');
set(gca,'XDir','reverse'); % Inverted axis to reproduce real room setup
legend('Microphone capsules', sprintf('Source S%d', source_id), 'Location', 'best');