-
-
Notifications
You must be signed in to change notification settings - Fork 214
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
19 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
function pd = imu_test_normality(imu_sta, cdf) | ||
function pd = imu_test_normality(imu_sta, dec, cdf) | ||
% imu_test_normality: performs normality analysis on static inertial | ||
% measurements. | ||
% | ||
|
@@ -8,6 +8,7 @@ | |
% wb: Nx3 turn rates [X Y Z] (rad/s). | ||
% t: Nx1 time vector (s). | ||
% | ||
% dec, decimation factor (integer) | ||
% cdf, 'ON' or 'OFF' (string) | ||
% | ||
% OUTPUT | ||
|
@@ -34,23 +35,26 @@ | |
% References: | ||
% | ||
% | ||
% Version: 001 | ||
% Date: 2021/03/05 | ||
% Version: 002 | ||
% Date: 2021/04/01 | ||
% Author: Rodrigo Gonzalez <[email protected]> | ||
% URL: https://github.com/rodralez/navego | ||
|
||
if nargin < 2, cdf = 'OFF', end | ||
if nargin < 2, dec = 100; end | ||
|
||
if nargin < 3, cdf = 'OFF'; end | ||
|
||
fprintf('imu_test_normality: CDF test is %s.\n', cdf ); | ||
|
||
%% Test of normality for inertial sensors | ||
%% | ||
|
||
% Decimation or downsampling | ||
DEC = 100; | ||
dec = floor(dec); % Force dec to be integer | ||
|
||
fprintf('imu_test_normality: downsampling ratio is %d.\n', DEC ); | ||
fprintf('imu_test_normality: downsampling ratio is %d.\n', dec ); | ||
|
||
imu_ds.fb = imu_sta.fb(1:DEC:end, :); | ||
imu_ds.wb = imu_sta.wb(1:DEC:end, :); | ||
imu_ds.fb = imu_sta.fb(1:dec:end, :); | ||
imu_ds.wb = imu_sta.wb(1:dec:end, :); | ||
|
||
for i=1:3 | ||
|
||
|
@@ -60,12 +64,12 @@ | |
|
||
x_label = sprintf('FB %d SAMPLES', i); | ||
x_title = sprintf('FB %d HISTOGRAM', i); | ||
plot_histogram (data, pd, x_label, x_title); | ||
plot_histogram (data, pd(i), x_label, x_title); | ||
|
||
if ( strcmp(cdf, 'ON') ) | ||
x_label = sprintf('FB %d SAMPLES', i); | ||
x_title = sprintf('FB %d NORMAL CUMULATIVE DISTRIBUTION', i); | ||
plot_cdf (data, pd_imu_fb(i), x_label, x_title); | ||
plot_cdf (data, pd(i), x_label, x_title); | ||
end | ||
end | ||
|
||
|
@@ -77,11 +81,11 @@ | |
|
||
x_label = sprintf('WB %d SAMPLES', i); | ||
x_title = sprintf('WB %d HISTOGRAM', i); | ||
plot_histogram (data, pd, x_label, x_title); | ||
plot_histogram (data, pd(i+3), x_label, x_title); | ||
|
||
if ( strcmp(cdf, 'ON') ) | ||
x_label = sprintf('FB %d SAMPLES', i); | ||
x_label = sprintf('WB %d SAMPLES', i); | ||
x_title = sprintf('WB %d NORMAL CUMULATIVE DISTRIBUTION', i); | ||
plot_cdf (data, pd_imu_wb(i), x_label, x_title); | ||
plot_cdf (data, pd(i+3), x_label, x_title); | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -36,7 +36,7 @@ function plot_histogram (samples, pd, x_label, x_title) | |
% Version: 004 | ||
% Date: 2021/03/02 | ||
% Author: Rodrigo Gonzalez <[email protected]> | ||
% URL: https://github.com/rodralez/navego | ||
% URL: https://github.com/rodralez/navego` | ||
|
||
N = length(samples); | ||
|
||
|