📄 sprslog.m
字号:
%% -----------------------------------------------------------------------------
%% Title : prslog.m
%% Project : GPS & Galieo receiver realization
%% Laboratoire de communication et d'int間ration
%% de la micro閘ectronique (LACIME)
%% 蒫ole de Technologie Sup閞ieure (蒚S)
%% Montr閍l, Qu閎ec
%%
%% Author : Bruno Sauriol
%% Date : 08/05/2007
%%
%% Description :
%%
%% The purpose of this script is to extract the data
%% from a binary pseudorange/relative speed log. The data is returned
%% in 3 NxM arrays, where M is the total number of receiver's
%% channel and N is the number of samples.
%% The arrays returned are as follow:
%% [t,pr,adr,pv] = prslog(filename)
%% t Local clock (bias to GPS time always < 1 sec.)
%% pr Satellites' pseudorange (meters)
%% pv Satellites to user relative speed (meters/sec)
%% adr Satellites' accumulated Doppler range (meters)
%%
%% -----------------------------------------------------------------------------
%% modification history :
%% -----------------------------------------------------------------------------
%% Version Mod. Date Author and description
%%
%% -----------------------------------------------------------------------------
function [t,pr,pv,adr,spr] = sprslog(filename)
fid = fopen(filename,'r') ; % Opens log file
fseek(fid,0,'eof'); % Gets file length
len = ftell(fid); %
fseek(fid,0,'bof'); % Returns to file beginning
n = fread(fid,1,'uint32'); % Reads number of channels
len = (len-4)/(8*(4*n+1)) - mod(len-4,8*(4*n+1));
data = zeros(len,4*n+1);
for i = 1:len
data(i,:)=fread(fid,4*n+1,'double');
end
fclose(fid);
t = data(:,1);
pr = zeros(len,n);
pv = zeros(len,n);
adr = zeros(len,n);
spr = zeros(len,n);
for i = 0:n-1
pr(:,i+1) = data(:,2+i*4);
pv(:,i+1) = data(:,3+i*4);
adr(:,i+1) = data(:,4+i*4);
spr(:,i+1) = data(:,5+i*4);
end
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -