Commit bcfa757b authored by Zapf's avatar Zapf
Browse files

Added Matlab Filter

parent a3cf0496
clear all
close all
d= importdata('test_sensordaten.log');
a=0.999;
b=1-a;
Gyro_Phi_p= d(:,1);
Acc_Phi=d(:,2);
Phi_korr=d(:,3);
T=length(Gyro_Phi_p)/200;
t=0.005:0.005:T;
Gyro_Phi(1)= Phi_korr(1);
Phi_korr_2(1)= Phi_korr(1);
for i=2:length(Gyro_Phi_p)
Gyro_Phi(i)=Gyro_Phi(i-1)+Gyro_Phi_p(i)/200;
Phi_korr_2(i)=a*(Phi_korr_2(i-1)+Gyro_Phi_p(i)/200) ...
+b*Acc_Phi(i);
end
%plot(t,Gyro_Phi_p);
plot(t,Gyro_Phi);
hold on
plot(t,Acc_Phi);
plot(t,Phi_korr);
plot(t,Phi_korr_2);
legend(...%'Gyro Winkelgeschwindigkeit',...
'Gyro Winkel',...
'Acc Winkel',...
'korrigierter Winkel',...
'korrigierter Winkel Matlab');
\ No newline at end of file
d= importdata('test_sensordaten.log');
Gyro_Phi_p= d(:,1);
Acc_Phi=d(:,2);
Phi_korr=d(:,3);
T=length(Gyro_Phi_p)/200;
t=0.005:0.005:T;
Gyro_Phi(1)= Phi_korr(1);
for i=2:length(Gyro_Phi_p)
Gyro_Phi(i)=Gyro_Phi(i-1)+Gyro_Phi_p(i-1)/200;
korr_Phi
end
%plot(t,Gyro_Phi_p);
plot(t,Gyro_Phi);
hold on
plot(t,Acc_Phi);
plot(t,Phi_korr);
legend(...%'Gyro Winkelgeschwindigkeit',...
'Gyro Winkel',...
'Acc Winkel',...
'korrigierter Winkel')
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment