Skip to content

Commit

Permalink
2021-04-01
Browse files Browse the repository at this point in the history
  • Loading branch information
rodralez committed Apr 1, 2021
1 parent d47eac3 commit cb52f85
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 15 deletions.
32 changes: 18 additions & 14 deletions performance_analysis/imu_test_normality.m
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.
%
Expand All @@ -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
Expand All @@ -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

Expand All @@ -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

Expand All @@ -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
2 changes: 1 addition & 1 deletion performance_analysis/plot_histogram.m
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit cb52f85

Please sign in to comment.