M=pmsm_estim_mex('real_mx.cfg');

ids = [1:size(M.EKFMz_mean,1)];
kftime=[ids-ids(1)]*0.000125;

figure(1);
subplot(2,1,1);
hold off
plot(kftime,M.EKFMz_mean(ids,3)/2/pi);
hold on
plot(kftime,M.EKF_mean(ids,3)/2/pi,'r');

subplot(2,1,2);
plot(kftime, M.EKFMz_mean(ids,5));

% ----- 

load ~/work/vs/Pohony/DATA_MERENI/DATA_MCU/data1.dat -ascii

subplot(2,1,1);
setime=[0:799]*0.004666; % fitted on currents
plot(setime,data13([0:799]+711,6),'--k','LineWidth',3);
plot(setime,data13([0:799]+711,11),'--g','LineWidth',3);
%plot(setime,2*pi*data1([0:799]+620,6),'--k','LineWidth',3);


