function trackResults = trackingInitTrackingStruct( msToProcess, prn )

%==============================================================================%
%                                                                              %
%   trackResults = initTrackingStruct( msToProcess, prn )                      %
%                                                                              %
%   Initialize the tracking results structure                                  %
%   David S. De Lorenzo                                                        %
%   23 November 2005                                                           %
%                                                                              %
%==============================================================================%
%                       GPS Software Receiver in Matlab                        %
%     Copyright (c) 2003-2017 David S. De Lorenzo / 2018-2023 Trimble Inc.     %
%==============================================================================%

%--- PRN number of the tracked satellite ---------------------------------------
trackResults.prn                = prn;

%--- Number of milliseconds since tracking was initiated -----------------------
trackResults.msCount            = 0;

%--- Code and carrier parameters -----------------------------------------------
%    Integrated carrier-phase is the carrier-phase value
%    at the first sample of the millisecond.
%    Carrier-phase is the integrated carrier-phase modulo 2*pi.
trackResults.codePhase          = zeros(1, msToProcess);
trackResults.carrierPhase       = zeros(1, msToProcess);
trackResults.carrierPhaseInt    = zeros(1, msToProcess);
trackResults.codeFreq           = zeros(1, msToProcess);
trackResults.carrierFreq        = zeros(1, msToProcess);
trackResults.codePhaseFinal     = 0;

%--- Doppler frequency of the tracked satellite --------------------------------
%    This is the difference between the (instantaneous)
%    carrierFreq and the intermediateFreq.
trackResults.dopplerFreq        = zeros(1, msToProcess);

%--- Index of the navigation data bit transition boundary ----------------------
trackResults.navStartBit        = 0;

%--- Navigation data bit values ------------------------------------------------
trackResults.navDataBits        = zeros(1, msToProcess);

%--- C/No estimate -------------------------------------------------------------
trackResults.CNo                = zeros(1, msToProcess);
trackResults.CNoFinal           = 0;

%--- Outputs from the in-phase and quadrature code correlators -----------------
trackResults.I_early            = zeros(1, msToProcess);
trackResults.Q_early            = zeros(1, msToProcess);
trackResults.I_prompt           = zeros(1, msToProcess);
trackResults.Q_prompt           = zeros(1, msToProcess);
trackResults.I_late             = zeros(1, msToProcess);
trackResults.Q_late             = zeros(1, msToProcess);

%--- Loop discriminators -------------------------------------------------------
trackResults.DLL_discr           = zeros(1, msToProcess);
trackResults.DLL_discrIntegrated = zeros(1, msToProcess);
trackResults.PLL_discr           = zeros(1, msToProcess);
trackResults.PLL_discrIntegrated = zeros(1, msToProcess);

return
%===============================================================================