diff --git a/calibration_plot.m b/calibration_plot.m index 5decba6..e6c06cf 100644 --- a/calibration_plot.m +++ b/calibration_plot.m @@ -2,7 +2,7 @@ figure(1); clf; hold on; desired_result = [60:30:1200, 120, 170, 200, 430, 1000, 1300:100:2000]; -mean_result = zeros(size(desired_result)); +median_result = zeros(size(desired_result)); diff_result = zeros(size(desired_result)); all_data = []; for i = 1:length(desired_result) @@ -26,14 +26,17 @@ for i = 1:length(desired_result) cdfplot(data(9, :)); - mean_result(i) = mean(data(9, :)); + median_result(i) = median(data(9, :)); all_data = [all_data, [data(9, :); dist * ones(1, length(data(9, :)))]]; - diff_result(i) = desired_result(i) - mean_result(i); + diff_result(i) = desired_result(i) - median_result(i); end figure(2); clf; scatter(all_data(1, :), all_data(2, :), '.'); params = polyfit(all_data(1, :), all_data(2, :), 1) fitted_data = params(1) * all_data(1, :) + params(2); +params2 = polyfit(median_result, desired_result, 1) +fitted_data2 = params2(1) * all_data(1, :) + params2(2); hold on; -plot(all_data(1, :), fitted_data, '-') \ No newline at end of file +plot(all_data(1, :), fitted_data, '-') +plot(all_data(1, :), fitted_data2, '-') \ No newline at end of file diff --git a/iw_parser.py b/iw_parser.py index 589a416..f6e64b0 100755 --- a/iw_parser.py +++ b/iw_parser.py @@ -40,7 +40,7 @@ def main(): p.add_argument( '--cali', nargs=2, - default=(0.9084, 526.8163), + default=(0.9234, 534.7103), type=float, help="calibrate final result" ) diff --git a/libMeasurement.py b/libMeasurement.py index 775f0cf..3c629fe 100755 --- a/libMeasurement.py +++ b/libMeasurement.py @@ -180,7 +180,7 @@ def main(): p.add_argument( '--cali', nargs=2, - default=(0.9084, 526.8163), + default=(0.9234, 534.7103), type=float, help="calibrate final result" )