ita_soundInsulationIndexAirborne.m 4.9 KB
Newer Older
1
2
3
4
5
6
7
8
function varargout = ita_soundInsulationIndexAirborne(varargin)
% ita_soundInsulationIndexAirborne - sound insulation acc. to ISO 717-1

% <ITA-Toolbox>
% This file is part of the application BuildingAcoustics for the ITA-Toolbox. All rights reserved.
% You can find the license for this m-file in the application folder.
% </ITA-Toolbox>

Markus Mueller-Trapet's avatar
Markus Mueller-Trapet committed
9
10
% re-implementation: Markus Mueller-Trapet (markus.mueller-trapet@nrc.ca)
% Date: June 2017
11
12

%% input parsing
13
sArgs = struct('pos1_data','anything','bandsperoctave',3,'freqVector',[],'createPlot',false,'type','ISO');
14
15
16
[data,sArgs] = ita_parse_arguments(sArgs,varargin);

%% reference curves
17
if strcmpi(sArgs.type,'iso') % Reference curve and frequencies according to ISO 717-1
18
    outputStr = 'R_w (C; C_{tr})';
19
20
21
22
23
    roundingFactor = 0.1;
    deficiencyLimit = Inf;
    if sArgs.bandsperoctave == 1
        freq = [125 250 500 1000 2000];
        refSurf = 10;
24
25
26
        refCurve = [36 45 52 55 56].'-52;
        Ccurve = [-21 -14 -8 -5 -4].';
        Ctrcurve = [-14 -10 -7 -4 -6].';
27
    elseif sArgs.bandsperoctave == 3
28
        freq = [100,125,160,200,250,315,400,500,630,800,1000,1250,1600,2000,2500,3150].';
29
        refSurf = 32;
30
31
32
        refCurve = [33 36 39 42 45 48 51 52 53 54 55 56 56 56 56 56].'-52;
        Ccurve = [-29 -26 -23 -21 -19 -17 -15 -13 -12 -11 -10 -9 -9 -9 -9 -9].';
        Ctrcurve = [-20 -20 -18 -16 -15 -14 -13 -12 -11 -9 -8 -9 -10 -11 -13 -15].';
33
34
35
36
37
38
39
40
    else
        error([upper(mfilename) ':wrong input for bandsperoctave']);
    end
elseif strcmpi(sArgs.type,'astm') % Reference curve and frequencies according to ASTM E413
    outputStr = 'STC';
    roundingFactor = 1;
    deficiencyLimit = 8;
    sArgs.bandsperoctave = 3;
41
42
    freq = [125,160,200,250,315,400,500,630,800,1000,1250,1600,2000,2500,3150,4000].';
    refCurve = [-16 -13 -10 -7 -4 -1 0 1 2 3 4 4 4 4 4 4].';
43
    refSurf = 32;
44
else
45
    error([upper(mfilename) ':wrong input for type']);
46
end
47
dbStep = 1;
48
49

%% prepare data
50
if ~isa(data,'itaSuper')
51
52
    freqVector = sArgs.freqVector;
    if ~isempty(freqVector)
53
        data = itaResult(10.^(data(:)./20),freqVector(:),'freq');
54
55
56
57
    else
        error([upper(mfilename) ':not enough input data']);
    end
end
58
freqVector = data.freqVector;
59
soundReduction = 20.*log10(interp1(freqVector,data.freqData(:,1),freq,'spline','extrap'));
60

61
62
if min(freqVector) > freq(1) || max(freqVector) < freq(end)
    warning([upper(mfilename) ': Sound insulation data will be extrapolated']);
63
64
65
end

%% sound insulation index
66
67
68
soundReduction = round(soundReduction/roundingFactor)*roundingFactor;
soundReductionIndex = min(floor(soundReduction-refCurve));
delta = max(0,refCurve + soundReductionIndex - soundReduction);
69
counter = 0; % stopping criterion
70
% shift reference curve until limits are reached
71

72
while sum(delta) <= refSurf && all(delta <= deficiencyLimit) && counter < 1e3
73
74
    soundReductionIndex = soundReductionIndex + dbStep;
    delta = max(0,refCurve + soundReductionIndex - soundReduction);
75
76
    counter = counter+1;
end
77
78
soundReductionIndex = soundReductionIndex - dbStep;
delta = max(0,refCurve + soundReductionIndex - soundReduction);
79
80
deficiencies = itaResult(delta,freq,'freq')*itaValue(1,'dB');
deficiencies.allowDBPlot = false;
81

82
83
84
85
86
87
88
89
90
%% adaptation terms for ISO
if strcmpi(sArgs.type,'iso')
    C = round(-10.*log10(sum(10.^((Ccurve - soundReduction)./10),1)) - soundReductionIndex);
    Ctr = round(-10.*log10(sum(10.^((Ctrcurve - soundReduction)./10),1)) - soundReductionIndex);
else
    C = 0;
    Ctr = 0;
end

91
92
%% output
if sArgs.createPlot
93
    fgh = ita_plot_freq(data);
94
95
    combinedFreq = unique([freq; freqVector]);
    plotResult = itaResult([[nan(sum(combinedFreq<min(freq)),1); 10.^((refCurve+soundReductionIndex)./20); nan(sum(combinedFreq > max(freq)),1)],[ones(sum(combinedFreq<=500),1)*10.^(soundReductionIndex./20); nan(sum(combinedFreq > 500),1)]],combinedFreq,'freq');
96
97
    ita_plot_freq(plotResult,'figure_handle',fgh,'axes_handle',gca,'hold');
    bar(gca,deficiencies.freqVector,deficiencies.freq,'hist');
98
    [maxDef,maxIdx] = max(deficiencies.freq);
99
100
101
102
103
104
    if strcmpi(sArgs.type,'iso')
        singleNumberString = [outputStr ' = ' num2str(soundReductionIndex) ' (' num2str(C) '; ' num2str(Ctr) ') dB'];
    else
        singleNumberString = [outputStr ' = ' num2str(soundReductionIndex) 'dB'];
    end
    legend({'Sound transmission loss','Shifted reference curve',singleNumberString,['Deficiencies (sum: ' num2str(sum(deficiencies.freq)) 'dB, max: ' num2str(maxDef) 'dB at ' num2str(deficiencies.freqVector(maxIdx)) 'Hz)']});
105
    xlim([min(combinedFreq) max(combinedFreq)]);
106
    ylim([0 max(max(soundReduction),max(refCurve)+soundReductionIndex)+15]);
107
108
end

109
varargout{1} = soundReductionIndex;
110
% reference curve specified at the freqVector specified by the input itaResult:
111
if nargout >= 2
112
113
    varargout{2} = interp1(freq, 10.^((refCurve+soundReductionIndex)./20), freqVector, 'linear');
    if nargout >= 3
114
        varargout{3} = deficiencies;
115
116
117
        if nargout >= 4
            varargout{4} = [C,Ctr];
        end
118
    end
119
end