Skip to content
Snippets Groups Projects
Commit a0a83e56 authored by Matt Rich's avatar Matt Rich
Browse files

Added .autosave to the controls .gitignore, updated the IMU analysis functions...

Added .autosave to the controls .gitignore, updated the IMU analysis functions and scripts for gyroscope, added a rough draft of a IMU model
parent bc365c4a
No related branches found
No related tags found
No related merge requests found
*.asv *.asv
\ No newline at end of file *.autosave
\ No newline at end of file
...@@ -14,6 +14,11 @@ gz = data.gz; ...@@ -14,6 +14,11 @@ gz = data.gz;
% analyze the noise (deviation from mean) on each axis and compare the % analyze the noise (deviation from mean) on each axis and compare the
% emperical distribution to one generated from a quantized Gaussian % emperical distribution to one generated from a quantized Gaussian
% distrubtuion with the same variance. % distrubtuion with the same variance.
quantized_accel_noise_gauss_anal( ax , 'x-axis') quantized_noise_gauss_anal( ax , 'Accelerometer' , 'x-axis' , 'gs' )
quantized_accel_noise_gauss_anal( ay , 'y-axis') quantized_noise_gauss_anal( ay , 'Accelerometer' , 'y-axis', 'gs' )
quantized_accel_noise_gauss_anal( az , 'z-axis') quantized_noise_gauss_anal( az , 'Accelerometer' , 'z-axis', 'gs' )
\ No newline at end of file
quantized_noise_gauss_anal( gx , 'Gyroscope' , 'x-axis' , 'rad/s')
quantized_noise_gauss_anal( gy , 'Gyroscope' , 'y-axis' , 'rad/s' )
quantized_noise_gauss_anal( gz , 'Gyroscope' , 'z-axis' , 'rad/s' )
\ No newline at end of file
...@@ -88,7 +88,7 @@ stem(bins,h); ...@@ -88,7 +88,7 @@ stem(bins,h);
legend(['Quantized Gaussian Noise: N(0,',num2str(vx),')'],'Emperical Distribution') legend(['Quantized Gaussian Noise: N(0,',num2str(vx),')'],'Emperical Distribution')
quantized_accel_noise_gauss_anal( ax ) % quantized_accel_noise_gauss_anal( ax )
......
function varargout = quantized_accel_noise_gauss_anal( a , axis ) function varargout = quantized_noise_gauss_anal( a , sensor_name, axis , units )
% quantized_accel_noise_gauss_anal analysis for quantized acelerometer data % quantized_noise_gauss_anal analysis for quantized sensor data
% %
%SYNTAX %SYNTAX
% quantized_accel_noise_gauss_anal( a , axis ) % quantized_noise_gauss_anal(a , sensor_name, axis , units )
% %
%DESCRIPTION %DESCRIPTION
% ...to be written... % ...to be written...
% %
% %
%Inputs: %Inputs:
% a - vector of a single axis accelerometer reading % a - vector of a single axis accelerometer reading
% axis - string specifying the axis label % sensor_name - string specifying the axis label
% axis - string specifying the axis label
% units - string specifying the physical units on that axis
% %
%Options: %Options:
% none % none
...@@ -37,6 +39,10 @@ function varargout = quantized_accel_noise_gauss_anal( a , axis ) ...@@ -37,6 +39,10 @@ function varargout = quantized_accel_noise_gauss_anal( a , axis )
% Initial bare bones function. % Initial bare bones function.
% - Matt Rich 11-15-2016 % - Matt Rich 11-15-2016
% %
% Change funcdtion name and code to not specify what sensor it is for so it
% can be used for any sensor producing quantized output
% - Matt Rich 11-16-2016
%
mu = mean(a); mu = mean(a);
v = var(a); v = var(a);
...@@ -59,14 +65,14 @@ cgauss_left = normcdf(bins_left,mue,sigma); ...@@ -59,14 +65,14 @@ cgauss_left = normcdf(bins_left,mue,sigma);
emp_dist = length(ea)*(cgauss_right-cgauss_left); emp_dist = length(ea)*(cgauss_right-cgauss_left);
stairs(bins_left,emp_dist,'r','LineWidth',1) ; stairs(bins_left,emp_dist,'r','LineWidth',1) ;
xlabel('Error From Mean (gs)'); xlabel(['Error From Mean (',units,')']);
ylabel('Occurences'); ylabel('Occurences');
grid; grid;
hold on; hold on;
h = hist(ea,bins); h = hist(ea,bins);
stem(bins,h); stem(bins,h);
legend(['Quantized Gaussian Noise: N(',num2str(mue),',',num2str(v),')'],'Emperical Distribution'); legend(['Quantized Gaussian Noise: N(',num2str(mue),',',num2str(v),')'],'Emperical Distribution');
title(['Accelerometer deviation from mean on ',axis]); title([sensor_name,' deviation from mean on ',axis]);
end end
......
This diff is collapsed.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment