Example_combAudioQual.m 1.76 KB
Newer Older
1
2
3
% EXAMPLE for the usage of the combined audio quality model that is described
% in Flener et al. (2019). It is a reference-based audio quality model and based on
% monaural (intensity and amplitude modulation) and binaural (interaural level and
dualberger's avatar
dualberger committed
4
% phase differences (ILDs, IPDs), interaural vector strength (IVS)) cues to predict subjective audio
5
% quality ratings. 
dualberger's avatar
dualberger committed
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
cur_dir=pwd;
addpath(genpath(cur_dir)); % include all folders from the current path
%% input signals

if verLessThan('matlab','8.0')
 % reference signal (clean)
[RefSig, fsRef] = wavread('Stimuli/guitar_ref.wav');
% test signal (processed)
[TestSig, fsTest] = wavread('Stimuli/guitar_midAnchor.wav');
else
 % reference signal (clean)
[RefSig, fsRef] = audioread('Stimuli/guitar_ref.wav');
% test signal (processed)
[TestSig, fsTest] = audioread('Stimuli/guitar_midAnchor.wav');
end

% compare sampling frequencies
if fsTest ~= fsRef,
    error('signals have different sampling frequencies')
else
    fs = fsTest;
end


dualberger's avatar
dualberger committed
31
%% monaural GPSMq
32
stOut = GPSMqBin(RefSig, TestSig, fs); % monaural model output
dualberger's avatar
dualberger committed
33
34
35
36
%% binaural BAM-Q
[binQ, ILDdiff, ITDdiff, IVSdiff] = BAMQpc(RefSig, TestSig, fs);
%% Combine outputs of BAMq and GPSMq
[obj_meas]=combine_binQ_OPM(stOut.out(:,1), binQ(:,1));
37

dualberger's avatar
dualberger committed
38

39
40
41
42
disp('***********************')
disp('****monaural measures**')
disp('***********************')
disp(stOut)
dualberger's avatar
dualberger committed
43
44
45
46
47
48
%     SNR_dc: 0.0179
%     SNR_ac: 0.0225
% SNR_dc_fix: 0.0179
% SNR_ac_fix: 0.0225
%        out: 132.6339
%     outFix: 132.7494
49
50
51
disp('***********************')
disp('***binaural measures***')
disp('***********************')
dualberger's avatar
dualberger committed
52
disp(['binQ: ',num2str(binQ)])
dualberger's avatar
dualberger committed
53
%     binQ: 100
dualberger's avatar
dualberger committed
54

55
56
57
disp('***********************')
disp('****overall measures***')
disp('***********************')
dualberger's avatar
dualberger committed
58
disp(['overall_measure: ',num2str(obj_meas)])
dualberger's avatar
dualberger committed
59
%     overall measure: 0.7800