function [retval, s, errorb, tau] = allan_overlap(data,tau,name,verbose)
% ALLAN_OVERLAP Compute the overlapping Allan deviation for a set of
% time-domain frequency data
% [RETVAL, S, ERRORB, TAU] = ALLAN_OVERLAP(DATA,TAU,NAME,VERBOSE)
%
% Inputs:
% DATA should be a struct and have the following fields:
% DATA.freq or DATA.phase
% A vector of fractional frequency measurements (df/f) in
% DATA.freq *or* phase offset data (seconds) in DATA.phase
% If phase data is not present, it will be generated by
% integrating the fractional frequency data.
% If both fields are present, then DATA.phase will be used.
%
% DATA.rate or DATA.time
% The sampling rate in Hertz (DATA.rate) or a vector of
% timestamps for each measurement in seconds (DATA.time).
% DATA.rate is used if both fields are present.
% If DATA.rate == 0, then the timestamps are used.
%
% TAU is an array of tau values for computing Allan deviation.
% TAU values must be divisible by 1/DATA.rate (data points cannot be
% grouped in fractional quantities!). Invalid values are ignored.
% NAME is an optional label that is added to the plot titles.
% VERBOSE sets the level of status messages:
% 0 = silent & no data plots; 1 = status messages; 2 = all messages
%
% Outputs:
% RETVAL is the array of overlapping Allan deviation values at each TAU.
% S is an optional output of other statistical measures of the data (mean, std, etc).
% ERRORB is an optional output containing the error estimates for a 1-sigma
% confidence interval. Error bars are plotted as vertical lines at each point.
% TAU is an optional output containing the array of tau values used in the
% calculation (which may be a truncated subset of the input or default values).
%
% Example:
%
% To compute the overlapping Allan deviation for the data in the variable "lt":
% >> lt
% lt =
% freq: [1x86400 double]
% rate: 0.5
%
% Use:
%
% >> ado = allan_overlap(lt,[2 10 100],'lt data',1);
%
% The Allan deviation will be computed and plotted at tau = 2,10,100 seconds.
% 1-sigma confidence intervals will be indicated by vertical lines.
% You can also use the default settings, which are usually a good starting point:
%
% >> ado = allan_overlap(lt);
%
%
% Notes:
% This function calculates the overlapping Allan deviation (ADEV), *not* the
% standard ADEV. Use "allan.m" for standard ADEV.
% The calculation is performed using phase data. If only frequency data is
% provided, phase data is generated by integrating the frequency data.
% However, the timestamp-based calculation is performed using frequency
% data. Phase data is differentiated to generate frequency data if necessary.
% No pre-processing of the data is performed, except to remove any
% initial offset in the time record.
% For rate-based data, ADEV is computed only for tau values greater than the
% minimum time between samples and less than the half the total time. For
% time-stamped data, only tau values greater than the maximum gap between
% samples and less than half the total time are used.
% The calculation for fixed sample rate data is *much* faster than for
% time-stamp data. You may wish to run the rate-based calculation first,
% then compare with time-stamp-based. Often the differences are insignificant.
% The error bars at each point are calculated using the 1-sigma intervals
% based on the size of the data set. This is usually an overestimate for
% overlapping ADEV; a more accurate (and usually smaller uncertainty)
% value can be determined from chi-squared statistics, but that is not
% implemented in this version.
% You can choose between loglog and semilog plotting of results by
% commenting in/out the appropriate line. Search for "#PLOTLOG".
% This function has been validated using the test data from NBS Monograph
% 140, the 1000-point test data set given by Riley [1], and the example data
% given in IEEE standard 1139-1999, Annex C.
% The author welcomes other validation results, see contact info below.
%
%#ok<*AGROW>
versionstr = 'allan_overlap v2.24';
% defaults
if nargin < 4, verbose = 2; end
if nargin < 3, name=''; end
if nargin < 2 || isempty(tau), tau=2.^(-10:10); end
if isfield(data,'rate') && isempty(data.rate), data.rate=0; end % v2.1
% Formatting for plots
FontName = 'Arial';
FontSize = 14;
plotlinewidth=2;
% if verbose >= 1, fprintf(1,'allan_overlap: %s\n\n',versionstr); end
%% Data consistency checks v2.1
if ~(isfield(data,'phase') || isfield(data,'freq'))
error('Either ''phase'' or ''freq'' must be present in DATA. See help file for details. [con0]');
end
if isfield(data,'time')
if isfield(data,'phase') && (length(data.phase) ~= length(data.time))
if isfield(data,'freq') && (length(data.freq) ~= length(data.time))
error('The time and freq vectors are not the same length. See help for details. [con2]');
else
error('The time and phase vectors are not the same length. See help for details. [con1]');
end
end
if isfield(data,'phase') && (any(isnan(data.phase)) || any(isinf(data.phase)))
error('The phase vector contains invalid elements (NaN/Inf). [con3]');
end
if isfield(data,'freq') && (any(isnan(data.freq)) || any(isinf(data.freq)))
error('The freq vector contains invalid elements (NaN/Inf). [con4]');
end
if isfield(data,'time') && (any(isnan(data.time)) || any(isinf(data.time)))
error('The time vector contains invalid elements (NaN/Inf). [con5]');
end
end
% sort tau vector
tau=sort(tau);
%% Basic statistical tests on the data set
if ~isfield(data,'freq')
if isfield(data,'rate') && data.rate ~= 0
data.freq=diff(data.phase).*data.rate;
elseif isfield(data,'time')
data.freq=diff(data.phase)./diff(data.time);
end
if verbose >= 1, fprintf(1,'allan_overlap: Fractional frequency data generated from phase data (M=%g).\n',length(data.freq)); end
end
if size(data.freq,2) > size(data.freq,1), data.freq=data.freq'; end % ensure columns
s.numpoints=length(data.freq);
s.max=max(data.freq);
s.min=min(data.freq);
s.mean=mean(data.freq);
s.median=median(data.freq);
if isfield(data,'time')
if size(data.time,2) > size(data.time,1), data.time=data.time'; end % ensure columns
s.linear=polyfit(data.time(1:length(data.freq)),data.freq,1);
elseif isfield(data,'rate') && data.rate ~= 0;
s.linear=polyfit((1/data.rate:1/data.rate:length(data.freq)/data.rate)',data.freq,1);
else
error('Either "time" or "rate" must be present in DATA. Type "help allan_overlap" for details. [err1]');
end
s.std=std(data.freq);
if verbose >= 2
fprintf(1,'allan_overlap: fractional frequency data statistics:\n');
disp(s);
end
% scale to median for plotting
medianfreq=data.freq-s.median;
sm=[]; sme=[];
% Screen for outliers using 5x Median Absolute Deviation (MAD) criteria
MAD = median(abs(medianfreq)/0.6745);
if verbose >= 1 && any(abs(medianfreq) > 5*MAD)
odl = (abs(medianfreq) > 5*MAD);
outliers = data.freq(odl);
fprintf(1, 'allan_overlap: OUTLIERS: There appear to be %d outliers in the frequency data.\n', length(outliers));
% idl = (abs(medianfreq) < 5*MAD);
% data.freq = data.freq(idl);
s.outliers = length(outliers);
else
s.outliers = 0;
end
%%%%
% There are four cases, freq or phase data, using timestamps or rate:
%% Fixed Sample Rate Data
% If there is a regular interval between measurements, calculation is much
% easier/faster
if isfield(data,'rate') && data.rate > 0 % if data rate was given
if verbose >= 1
fprintf(1, 'allan_overlap: regular data ');
if isfield(data,'freq')
fprintf(1, '(%g freq data points @ %g Hz)\n',length(data.freq),data.rate);
elseif isfield(data,'phase')
fprintf(1, '(%g phase data points @ %g Hz)\n',length(dat
没有合适的资源?快使用搜索试试~ 我知道了~
基于Matlab卡尔曼滤波的IMU和GPS组合导航数据融合(源码+数据).rar
共63个文件
m:56个
mat:5个
md:1个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
5星 · 超过95%的资源 25 下载量 194 浏览量
2023-09-07
10:23:47
上传
评论 16
收藏 50.36MB RAR 举报
温馨提示
1、资源内容:基于Matlab卡尔曼滤波的IMU和GPS组合导航数据融合(源码+数据).rar 2、适用人群:计算机,电子信息工程、数学等专业的大学生课程设计、期末大作业或毕业设计中的部分功能,作为“参考资料”使用。 3、解压说明:本资源需要电脑端使用WinRAR、7zip等解压工具进行解压,没有解压工具的自行百度下载即可。 4、免责声明:本资源作为“参考资料”而不是“定制需求”,代码只能作为参考,不能完全复制照搬。不一定能够满足所有人的需求,需要有一定的基础能够看懂代码,能够自行调试代码并解决报错,能够自行添加功能修改代码。由于作者大厂工作较忙,不提供答疑服务,如不存在资源缺失问题概不负责,谢谢理解。
资源推荐
资源详情
资源评论
收起资源包目录
基于Matlab卡尔曼滤波的IMU和GPS组合导航数据融合(源码+数据).rar (63个子文件)
基于Matlab卡尔曼滤波的IMU和GPS组合导航数据融合(源码+数据)
dcm_update.m 473B
说明.md 252B
vel_update.m 701B
hd_update.m 846B
data-adquition
rtkpos_read.m 3KB
rinex_read.m 6KB
rtknavi_read.m 4KB
microstrain_read.m 9KB
conversions
qua2euler_m.m 874B
euler2dcm.m 601B
ned2ecef.m 672B
qua2dcm.m 518B
euler2qua.m 738B
qua2euler.m 403B
ecef2ned.m 674B
dcm2euler.m 368B
ecef2llh.m 1KB
skewm.m 252B
print_rmse.m 2KB
rmse.m 264B
gravity.m 432B
coriolis.m 354B
simulation
vel_gen.m 1KB
pllh2vned.m 1KB
noise_sbias.m 403B
gravity_b.m 283B
coriolis_b.m 459B
acc_nav2body.m 623B
gnss_gen.m 1KB
noise_dbias.m 850B
gyro_gen.m 2KB
acc_gen.m 2KB
gnss_err_profile.m 330B
gyro_gen_delta.m 501B
noise_rrw.m 458B
examples
alla-variance
stim300.mat 33.11MB
navego_allan_example.m 5KB
synthetic-data
ref.mat 1.33MB
navego_example.m 18KB
real-data
imu.mat 15.99MB
gnss.mat 253KB
ref.mat 110KB
navego_example_real.m 3KB
navego_example_real.kml 46KB
radius.m 678B
att_update.m 2KB
my_sgolayfilt.m 552B
navego_interpolation.m 4KB
ins_gnss.m 12KB
navego_rmse.m 3KB
allan-variance
dsplot.m 9KB
allan_get_rw.m 1KB
allan_overlap.m 20KB
allan_imu.m 6KB
allan_get_bdrift.m 602B
F_update.m 3KB
pos_update.m 715B
qua_update.m 724B
earthrate.m 380B
imu_si_errors.m 2KB
navego_plot.m 6KB
kalman.m 2KB
transportrate.m 692B
共 63 条
- 1
Matlab仿真实验室
- 粉丝: 2w+
- 资源: 2179
下载权益
C知道特权
VIP文章
课程特权
开通VIP
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- 二叉树7-1-1.cpp
- android 9.0 原生模拟器 签名文件
- 技术面试最后反问面试官的话 校招面试非技术问题有哪些 非技术问题如何回答.png
- NB-IOT-BC26全网通模块Altium+ CADENCE +PADS三种格式(原理图SCH+PCB封装库)文件.zip
- 基于微信小程序开发的校园失物招领系统源码毕业设计(优质项目源码).zip
- 词向量是一种将自然语言中的单词转换为数值向量的技术,它能够捕捉词义和上下文信息
- nmap与masscan的简单使用
- MyBatis动态SQL.pdf
- 基于stm32单片机protues仿真的温湿度控制系统设计(仿真图、源代码)
- 词向量:自然语言处理的基石
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
- 1
- 2
- 3
- 4
- 5
前往页