Commit 53a9b523 authored by Markus Mueller-Trapet's avatar Markus Mueller-Trapet

bugfix for STC calculation

parent aff0604e
...@@ -65,19 +65,13 @@ delta = max(0,refCurve + soundInsulationIndex - soundInsulation); ...@@ -65,19 +65,13 @@ delta = max(0,refCurve + soundInsulationIndex - soundInsulation);
counter = 0; % stopping criterion counter = 0; % stopping criterion
% shift reference curve until limits are reached % shift reference curve until limits are reached
while sum(delta) < refSurf && counter < 1e3 while sum(delta) < refSurf && all(delta) < deficiencyLimit && counter < 1e3
if max(delta) >= deficiencyLimit soundInsulationIndex = soundInsulationIndex + dbStep;
break;
elseif sum(delta) < refSurf-1
soundInsulationIndex = soundInsulationIndex + dbStep;
else
soundInsulationIndex = soundInsulationIndex - dbStep;
end
delta = max(0,refCurve + soundInsulationIndex - soundInsulation); delta = max(0,refCurve + soundInsulationIndex - soundInsulation);
counter = counter+1; counter = counter+1;
end end
soundInsulationIndex = soundInsulationIndex - dbStep;
delta = max(0,refCurve + soundInsulationIndex - soundInsulation);
deficiencies = itaResult(delta,freq,'freq')*itaValue(1,'dB'); deficiencies = itaResult(delta,freq,'freq')*itaValue(1,'dB');
deficiencies.allowDBPlot = false; deficiencies.allowDBPlot = false;
......
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