www.pudn.com > GNSS_SDR.zip > plotTracking.m, change:2009-07-26,size:6931b


function plotTracking(channelList, trackResults, settings) 
%This function plots the tracking results for the given channel list. 
%绘制跟踪结果 
%plotTracking(channelList, trackResults, settings) 
% 
%   Inputs: 
%       channelList     - list of channels to be plotted. 
%                       - 通道 
%       trackResults	- tracking results from the tracking function. 
%                       - 跟踪结果 
%       settings        - receiver settings. 
%                       - 设置 
 
%-------------------------------------------------------------------------- 
%                           SoftGNSS v3.0 
%  
% Copyright (C) Darius Plausinaitis 
% Written by Darius Plausinaitis 
% 注释翻译:文立 
%-------------------------------------------------------------------------- 
%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: plotTracking.m,v 1.5.2.23 2006/08/14 14:45:14 dpl Exp $ 
%翻译时间:2009-05-13 
 
% Protection - if the list contains incorrect channel numbers 
% 保护,以防存在错误通道情况 
channelList = intersect(channelList, 1:settings.numberOfChannels); 
 
%=== For all listed channels 所有的通道 ==================================== 
for channelNr = channelList 
 
%% Select (or create) and clear the figure 打开绘图 ======================== 
    % The number 200 is added just for more convenient handling of the open 
    % figure windows, when many figures are closed and reopened. 
    % Figures drawn or opened by the user, will not be "overwritten" by 
    % this function. 
    % 保证绘图不会被覆盖 
 
    figure(channelNr +200); 
    clf(channelNr +200); 
    set(channelNr +200, 'Name', ['通道 ', num2str(channelNr), ... 
                                 '(卫星PRN ', ... 
                                 num2str(trackResults(channelNr).PRN), ... 
                                 ')的结果']); 
 
%% Draw axes 坐标轴========================================================= 
        % Row 1 
        handles(1, 1) = subplot(3, 3, 1); 
        handles(1, 2) = subplot(3, 3, [2 3]); 
        % Row 2 
        handles(2, 1) = subplot(3, 3, 4); 
        handles(2, 2) = subplot(3, 3, [5 6]); 
        % Row 3 
        handles(3, 1) = subplot(3, 3, 7); 
        handles(3, 2) = subplot(3, 3, 8); 
        handles(3, 3) = subplot(3, 3, 9); 
 
%% Plot all figures 绘图=================================================== 
 
        timeAxisInSeconds = (1:settings.msToProcess)/1000; 
 
        %----- Discrete-Time Scatter Plot 散点图---------------------------- 
        plot(handles(1, 1), trackResults(channelNr).I_P,... 
                            trackResults(channelNr).Q_P, ... 
                            '.'); 
 
        grid  (handles(1, 1)); 
        axis  (handles(1, 1), 'equal'); 
        title (handles(1, 1), 'I Q 散点图'); 
        xlabel(handles(1, 1), 'I通道'); 
        ylabel(handles(1, 1), 'Q通道'); 
 
        %----- Nav bits 导航电电文------------------------------------------ 
        plot  (handles(1, 2), timeAxisInSeconds, ... 
                              trackResults(channelNr).I_P); 
 
        grid  (handles(1, 2)); 
        title (handles(1, 2), '导航电文'); 
        xlabel(handles(1, 2), '时间 (s)'); 
        axis  (handles(1, 2), 'tight'); 
 
        %----- PLL discriminator unfiltered 载波环检相器输出 --------------- 
        plot  (handles(2, 1), timeAxisInSeconds, ... 
                              trackResults(channelNr).pllDiscr, 'r');       
 
        grid  (handles(2, 1)); 
        axis  (handles(2, 1), 'tight'); 
        xlabel(handles(2, 1), '时间 (s)'); 
        ylabel(handles(2, 1), '幅值 (周)'); 
        title (handles(2, 1), '载波环检相器输出'); 
 
        %----- Correlation 相关结果----------------------------------------- 
        plot(handles(2, 2), timeAxisInSeconds, ... 
                            [sqrt(trackResults(channelNr).I_E.^2 + ... 
                                  trackResults(channelNr).Q_E.^2)', ... 
                             sqrt(trackResults(channelNr).I_P.^2 + ... 
                                  trackResults(channelNr).Q_P.^2)', ... 
                             sqrt(trackResults(channelNr).I_L.^2 + ... 
                                  trackResults(channelNr).Q_L.^2)'], ... 
                            '-*'); 
 
        grid  (handles(2, 2)); 
        title (handles(2, 2), '相关结果'); 
        xlabel(handles(2, 2), '时间 (s)'); 
        axis  (handles(2, 2), 'tight'); 
         
        hLegend = legend(handles(2, 2), '$\sqrt{I_{E}^2 + Q_{E}^2}$', ... 
                                        '$\sqrt{I_{P}^2 + Q_{P}^2}$', ... 
                                        '$\sqrt{I_{L}^2 + Q_{L}^2}$'); 
                           
        % set interpreter from tex to latex. This will draw \sqrt correctly 
        % 绘制根号 
        set(hLegend, 'Interpreter', 'Latex'); 
 
        %----- PLL discriminator filtered 载波环滤波器输出 ----------------- 
        plot  (handles(3, 1), timeAxisInSeconds, ... 
                              trackResults(channelNr).pllDiscrFilt, 'b');       
 
        grid  (handles(3, 1)); 
        axis  (handles(3, 1), 'tight'); 
        xlabel(handles(3, 1), '时间 (s)'); 
        ylabel(handles(3, 1), '频率 (Hz)'); 
        title (handles(3, 1), '本地载波频率'); 
 
        %----- DLL discriminator unfiltered 码环检相器输出 ----------------- 
        plot  (handles(3, 2), timeAxisInSeconds, ... 
                              trackResults(channelNr).dllDiscr, 'r');       
 
        grid  (handles(3, 2)); 
        axis  (handles(3, 2), 'tight'); 
        xlabel(handles(3, 2), '时间 (s)'); 
        ylabel(handles(3, 2), '幅值 (码片)'); 
        title (handles(3, 2), '码环检相器输出'); 
 
        %----- DLL discriminator filtered 码环滤波器输出--------------------- 
        plot  (handles(3, 3), timeAxisInSeconds, ... 
                              trackResults(channelNr).dllDiscrFilt, 'b');       
 
        grid  (handles(3, 3)); 
        axis  (handles(3, 3), 'tight'); 
        xlabel(handles(3, 3), '时间 (s)'); 
        ylabel(handles(3, 3), '幅值 (Hz)'); 
        title (handles(3, 3), '码环滤波器输出'); 
 
end % for channelNr = channelList