Commit 5d855d2c authored by Ernesto Accolti's avatar Ernesto Accolti

Added STE and STL for stage support

parent 96a4b573
......@@ -14,7 +14,7 @@ function varargout = ita_roomacoustics_parameters(varargin)
% strCell = ita_roomacoustics_parameters('getAvailableParameters') % returns a cell with strings of all implemented parameters
% strCell = ita_roomacoustics_parameters('getAvailableParameters', 'Reverberation_Times') % only parameters of one category
%
% Currently available parameters: EDT, LDT, T10, T15, T20, T30, T40, T50, T60, C50, C80, D50, D80, Center_Time, PSNR_Lundeby, PSPNR_Lundeby, Intersection_Time_Lundeby
% Currently available parameters: EDT, LDT, T10, T15, T20, T30, T40, T50, T60, C50, C80, D50, D80, STE, STL Center_Time, PSNR_Lundeby, PSPNR_Lundeby, Intersection_Time_Lundeby
% Currently available categories: Reverberation_Times, Clarity_and_Definition, Others
%
%
......@@ -38,7 +38,7 @@ function varargout = ita_roomacoustics_parameters(varargin)
%%
defaultPar = struct( 'Reverberation_Times', struct('EDT', true, 'LDT', false,'T10', false, 'T15', false, 'T20', true, 'T25', false, 'T30', true, 'T40', false, 'T50', false, 'T60', false, 'T_Huszty', false, 'T_Lundeby', false),...
'Clarity_and_Definition', struct('C50', false, 'C80',false, 'D50', false ,'D80', false, 'Center_Time', false ), ...
'Clarity_and_Definition', struct('C50', false, 'C80',false, 'D50', false ,'D80', false, 'STE', false, 'STL', false, 'Center_Time', false ), ...
'Others', struct( 'PSNR_Lundeby', false, 'PSPNR_Lundeby', false, 'Intersection_Time_Lundeby', false, 'EDC', false ));
if nargin == 1 && strcmpi('getDefaultStruct',varargin{1} ) % return default struct
......
......@@ -28,13 +28,24 @@ function output = ita_roomacoustics_energy_parameters(varargin)
%% Initialization
sArgs = struct('pos1_edc','itaAudioTime', 'freqRange', ita_preferences('freqRange'), 'bandsPerOctave', ita_preferences('bandsPerOctave'), 'centerTimeMat',[], 'C50', false, 'C80', false, 'D50', false, 'D80', false, 'Center_Time', false);
sArgs = struct('pos1_edc','itaAudioTime', 'freqRange', ita_preferences('freqRange'), 'bandsPerOctave', ita_preferences('bandsPerOctave'), 'centerTimeMat',[], 'C50', false, 'C80', false, 'D50', false, 'D80', false, 'STE', false, 'STL', false, 'Center_Time', false);
[edc,sArgs] = ita_parse_arguments(sArgs,varargin);
%% Calculate Energy Parameters from EDC
nChannels = edc.nChannels;
if sArgs.STE || sArgs.STL
idx10ms = edc.time2index(0.01);
idx100ms = edc.time2index(0.1);
end
if sArgs.STE
idx20ms = edc.time2index(0.02);
end
if sArgs.STL
idx1000ms = edc.time2index(1);
end
if sArgs.C50 || sArgs.D50
idx50ms = edc.time2index(0.05);
end
......@@ -93,7 +104,23 @@ if sArgs.Center_Time
output.Center_Time.channelUnits = repmat({'s'}, 1, nChannels);
end
%% stage support
% early stage support
if sArgs.STE
output.STE = resultTemplate;
output.STE.freqData = 10*log10( (edc.timeData(idx20ms,:).' - edc.timeData(idx100ms,:).')./(1-edc.timeData(idx10ms,:).'));
output.STE.comment = [edc.comment ' -> STE (dB)' ];
output.STE.plotAxesProperties = {'ylabel' 'ST_{Early} (in dB)'};
end
% late stage support
if sArgs.STL
output.STL = resultTemplate;
output.STL.freqData = 10*log10( (edc.timeData(idx100ms,:).' - edc.timeData(idx1000ms,:).')./(1-edc.timeData(idx10ms,:).'));
output.STL.comment = [edc.comment ' -> STL (dB)' ];
output.STL.plotAxesProperties = {'ylabel' 'ST_{Late} (in dB)'};
end
%end function
end
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