帧同步的过程比较简单,第一步将已知的同步码与跟踪截断获得的导航电文进行互相关,相关值最大时即子帧的起始位置;第二步是奇偶校验过程,获取当前子帧的前两个字与上一个子帧的最后两个数据比特进行奇偶校验,校验通过则说明上一步骤中获得的子帧起始位置是正确的。
function [firstSubFrame, activeChnList] = findPreambles(trackResults, ...
settings)
%[firstSubFrame, activeChnList] = findPreambles(trackResults, settings)
%
% Inputs:
% trackResults - output from the tracking function
% settings - Receiver settings.
%
% Outputs:
% firstSubframe - the array contains positions of the first
% preamble in each channel. The position is ms count
% since start of tracking. Corresponding value will
% be set to 0 if no valid preambles were detected in
% the channel.
% activeChnList - list of channels containing valid preambles
%------------------------------------------------------