function [toa] = atGivenTimesteps(pToa, pTimesteps, pStartOffset, pDrift) %CALCULATETOAATTIMESTEP Calculates the TOA at the given timestep. % Calculates the new TOA at the given timestep. % % Parameters: % pToa (double): The start TOA. % pStartTimestep (double): The starting timestep. % pStartOffset (double): The start offset of the soundsource. % pDrift (double): The drift of the soundsource in seconds per day. %% Prepare variables offsetAtTimesteps = pDrift * pTimesteps; %% Calculate new toa toa = pToa + pStartOffset + offsetAtTimesteps; end