% This function is part of the NMSM Pipeline, see file for full license.
%
% This function calculates the scaled muscle excitations given the
% processed EMG signals
%
% (Array of num, 2D cell, Array of num, Array of num) -> (3D matrix of num)
% returns the muscle excitations with time padding
function muscleExcitations = calcMuscleExcitations(emgTime, ...
emgSplines, electromechanicalDelays, emgScaleFactors)
if length(electromechanicalDelays) == 1
timeDelayedEmg = calcEmgDataWithCommonTimeDelay(emgTime, ...
emgSplines, electromechanicalDelays / 10);
else
timeDelayedEmg = calcEmgDataWithMuscleSpecificTimeDelay(emgTime, ...
emgSplines, electromechanicalDelays / 10);
end
muscleExcitations = timeDelayedEmg .* emgScaleFactors;
end