Skip to content

Commit cb52f85

Browse files
committed
2021-04-01
1 parent d47eac3 commit cb52f85

File tree

2 files changed

+19
-15
lines changed

2 files changed

+19
-15
lines changed

performance_analysis/imu_test_normality.m

Lines changed: 18 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
function pd = imu_test_normality(imu_sta, cdf)
1+
function pd = imu_test_normality(imu_sta, dec, cdf)
22
% imu_test_normality: performs normality analysis on static inertial
33
% measurements.
44
%
@@ -8,6 +8,7 @@
88
% wb: Nx3 turn rates [X Y Z] (rad/s).
99
% t: Nx1 time vector (s).
1010
%
11+
% dec, decimation factor (integer)
1112
% cdf, 'ON' or 'OFF' (string)
1213
%
1314
% OUTPUT
@@ -34,23 +35,26 @@
3435
% References:
3536
%
3637
%
37-
% Version: 001
38-
% Date: 2021/03/05
38+
% Version: 002
39+
% Date: 2021/04/01
3940
% Author: Rodrigo Gonzalez <[email protected]>
4041
% URL: https://github.com/rodralez/navego
4142

42-
if nargin < 2, cdf = 'OFF', end
43+
if nargin < 2, dec = 100; end
44+
45+
if nargin < 3, cdf = 'OFF'; end
46+
47+
fprintf('imu_test_normality: CDF test is %s.\n', cdf );
4348

4449
%% Test of normality for inertial sensors
4550
%%
4651

47-
% Decimation or downsampling
48-
DEC = 100;
52+
dec = floor(dec); % Force dec to be integer
4953

50-
fprintf('imu_test_normality: downsampling ratio is %d.\n', DEC );
54+
fprintf('imu_test_normality: downsampling ratio is %d.\n', dec );
5155

52-
imu_ds.fb = imu_sta.fb(1:DEC:end, :);
53-
imu_ds.wb = imu_sta.wb(1:DEC:end, :);
56+
imu_ds.fb = imu_sta.fb(1:dec:end, :);
57+
imu_ds.wb = imu_sta.wb(1:dec:end, :);
5458

5559
for i=1:3
5660

@@ -60,12 +64,12 @@
6064

6165
x_label = sprintf('FB %d SAMPLES', i);
6266
x_title = sprintf('FB %d HISTOGRAM', i);
63-
plot_histogram (data, pd, x_label, x_title);
67+
plot_histogram (data, pd(i), x_label, x_title);
6468

6569
if ( strcmp(cdf, 'ON') )
6670
x_label = sprintf('FB %d SAMPLES', i);
6771
x_title = sprintf('FB %d NORMAL CUMULATIVE DISTRIBUTION', i);
68-
plot_cdf (data, pd_imu_fb(i), x_label, x_title);
72+
plot_cdf (data, pd(i), x_label, x_title);
6973
end
7074
end
7175

@@ -77,11 +81,11 @@
7781

7882
x_label = sprintf('WB %d SAMPLES', i);
7983
x_title = sprintf('WB %d HISTOGRAM', i);
80-
plot_histogram (data, pd, x_label, x_title);
84+
plot_histogram (data, pd(i+3), x_label, x_title);
8185

8286
if ( strcmp(cdf, 'ON') )
83-
x_label = sprintf('FB %d SAMPLES', i);
87+
x_label = sprintf('WB %d SAMPLES', i);
8488
x_title = sprintf('WB %d NORMAL CUMULATIVE DISTRIBUTION', i);
85-
plot_cdf (data, pd_imu_wb(i), x_label, x_title);
89+
plot_cdf (data, pd(i+3), x_label, x_title);
8690
end
8791
end

performance_analysis/plot_histogram.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ function plot_histogram (samples, pd, x_label, x_title)
3636
% Version: 004
3737
% Date: 2021/03/02
3838
% Author: Rodrigo Gonzalez <[email protected]>
39-
% URL: https://github.com/rodralez/navego
39+
% URL: https://github.com/rodralez/navego`
4040

4141
N = length(samples);
4242

0 commit comments

Comments
 (0)