www.pudn.com > GNSS_SDR.zip > calculatePseudoranges.m, change:2009-12-07,size:4271b


function [pseudoranges] = calculatePseudoranges(trackResults, ... 
                                                msOfTheSignal, ... 
                                                channelList, settings) 
%calculatePseudoranges finds relative pseudoranges for all satellites 
%listed in CHANNELLIST at the specified millisecond of the processed 
%signal. The pseudoranges contain unknown receiver clock offset. It can be 
%found by the least squares position search procedure.  
%计算各个通道的伪距。伪距包含接收机钟差,可以通过最小二乘法求出。 
%[pseudoranges] = calculatePseudoranges(trackResults, msOfTheSignal, ... 
%                                       channelList, settings) 
% 
%   Inputs: 
%       trackResults    - output from the tracking function 
%						- 跟踪输出 
%       msOfTheSignal   - pseudorange measurement point (millisecond) in 
%                       the trackResults structure 
%						- 伪距输出点 
%       channelList     - list of channels to be processed 
%						- 通道列表 
%       settings        - receiver settings 
%						- 接收机设置 
% 
%   Outputs: 
%       pseudoranges    - relative pseudoranges to the satellites.  
%						- 伪距 
 
%-------------------------------------------------------------------------- 
%                           SoftGNSS v3.0 
%  
% Copyright (C) Darius Plausinaitis 
% Written by Darius Plausinaitis 
% Based on Peter Rinder and Nicolaj Bertelsen 
% 注释翻译:苗剑峰 
%-------------------------------------------------------------------------- 
% 
%This program is free software; you can redistribute it and/or 
%modify it under the terms of the GNU General Public License 
%as published by the Free Software Foundation; either version 2 
%of the License, or (at your option) any later version. 
% 
%This program is distributed in the hope that it will be useful, 
%but WITHOUT ANY WARRANTY; without even the implied warranty of 
%MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the 
%GNU General Public License for more details. 
% 
%You should have received a copy of the GNU General Public License 
%along with this program; if not, write to the Free Software 
%Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, 
%USA. 
%程序为开源程序,请在开源协议规定范围内做改动 
%-------------------------------------------------------------------------- 
 
% CVS record: 
% $Id: calculatePseudoranges.m,v 1.1.2.18 2006/08/09 17:20:11 dpl Exp $ 
% 翻译时间:2009-05-13 
 
%--- Set initial travel time to infinity 初始电波延时设为无穷---------------- 
% Later in the code a shortest pseudorange will be selected. Therefore 
% pseudoranges from non-tracking channels must be the longest - e.g. 
% infinite.  
travelTime = inf(1, settings.numberOfChannels); 
 
% Find number of samples per spreading code 
% 每个码长对应的采样点数量 
samplesPerCode = round(settings.samplingFreq / ... 
                        (settings.codeFreqBasis / settings.codeLength)); 
 
%--- For all channels in the list ...  
%--- 对所有通道 ... 
for channelNr = channelList 
    codeFreq=settings.codeFreqBasis - trackResults(channelNr).dllDiscrFilt(msOfTheSignal(channelNr)); 
    codephasestep= codeFreq / settings.samplingFreq; 
 
    %--- Compute the travel times -----------------------------------------   
	%--- 计算延时 ---------------------------------------------------------- 
%     travelTime(channelNr) = ... 
%         trackResults(channelNr).absoluteSample(msOfTheSignal(channelNr)) / samplesPerCode; 
        travelTime(channelNr) = ... 
        (trackResults(channelNr).absoluteSample(msOfTheSignal(channelNr)) - (trackResults(channelNr).coderem(msOfTheSignal(channelNr))/codephasestep)) / samplesPerCode; 
 
end 
 
%--- Truncate the travelTime and compute pseudoranges --------------------- 
%--- 截断延时并计算伪距 ----------------------------------------------------- 
minimum         = floor(min(travelTime)); 
travelTime      = travelTime - minimum + settings.startOffset; 
 
%--- Convert travel time to a distance ------------------------------------ 
%--- 将延时变换为距离 ------------------------------------------------------ 
% The speed of light must be converted from meters per second to meters 
% per millisecond.  
pseudoranges    = travelTime * (settings.c / 1000);