├── FtmPE ├── KfFtmclass.m ├── PlotFtmPeResults.m ├── ReadFtmMeasFile.m ├── RunFtmPE.m ├── WiFi Location Core PE and Measurements Database.pdf ├── data │ ├── Office1_80MHz │ │ ├── Office1_80MHz.csv │ │ ├── Office1_80MHz_RSP_LIST.csv │ │ ├── Office1_80MHz_VenueFile.mat │ │ └── Office1_80MHz_noisySynthRanges.csv │ ├── Office2_80MHz │ │ ├── Office2_80MHz.csv │ │ ├── Office2_80MHz_RSP_LIST.csv │ │ ├── Office2_80MHz_VenueFile.mat │ │ └── Office2_80MHz_noisySynthRanges.csv │ ├── Office3_80MHz │ │ ├── Office3_80MHz.csv │ │ ├── Office3_80MHz_RSP_LIST.csv │ │ ├── Office3_80MHz_VenueFile.mat │ │ └── Office3_80MHz_noisySynthRanges.csv │ ├── Office4_80MHz │ │ ├── Office4_80MHz.csv │ │ ├── Office4_80MHz_RSP_LIST.csv │ │ ├── Office4_80MHz_VenueFile.mat │ │ └── Office4_80MHz_noisySynthRanges.csv │ ├── Office5_80MHz │ │ ├── Office5_80MHz.csv │ │ ├── Office5_80MHz_RSP_LIST.csv │ │ ├── Office5_80MHz_VenueFile.mat │ │ └── Office5_80MHz_noisySynthRanges.csv │ └── Office6_40MHz │ │ ├── Office6_40MHz.csv │ │ ├── Office6_40MHz_RSP_LIST.csv │ │ ├── Office6_40MHz_VenueFile.mat │ │ └── Office6_40MHz_noisySynthRanges.csv ├── mainFtmPE.m └── testFtmPeConfig.m ├── LICENSE.md └── README.md /FtmPE/KfFtmclass.m: -------------------------------------------------------------------------------- 1 | % KFclass definition & methods 2 | 3 | % For questions/comments contact: 4 | % leor.banin@intel.com, 5 | % ofer.bar-shalom@intel.com, 6 | % nir.dvorecki@intel.com, 7 | % yuval.amizur@intel.com 8 | 9 | % Copyright (C) 2018 Intel Corporation 10 | % SPDX-License-Identifier: BSD-3-Clause 11 | 12 | classdef KfFtmclass < handle 13 | 14 | properties 15 | P % KF Covariance Matrix 16 | X % KF State vector 17 | sysNoisePos % System noise variance vector for position states 18 | rangeMeasNoiseVar 19 | zMeasNoiseVar 20 | knownZ 21 | t % KF time (client time) 22 | Pe % copy of KF Pe to allow ellipsoid plot 23 | scaleSigmaForBigRange 24 | outlierFilterEnable 25 | OutlierRangeFilter 26 | Innovation 27 | InnovationMean 28 | InnovationStd 29 | Nstep 30 | gainLimit 31 | init 32 | type 33 | end 34 | 35 | methods 36 | 37 | function obj = KfFtmclass(cfg) 38 | 39 | obj.sysNoisePos = [cfg.posLatStd... 40 | cfg.posLatStd... 41 | cfg.heightStd... 42 | cfg.biasStd].^2; % [m^2] 43 | obj.rangeMeasNoiseVar = cfg.rangeMeasNoiseStd^2; 44 | obj.zMeasNoiseVar = cfg.zMeasNoiseStd^2; 45 | obj.knownZ = cfg.knownZ; 46 | 47 | obj.init.posLatStd = cfg.init.posLatStd; 48 | obj.init.heightStd = cfg.init.heightStd; 49 | obj.init.biasStd = cfg.init.biasStd; 50 | 51 | obj.scaleSigmaForBigRange = cfg.scaleSigmaForBigRange; % 52 | obj.outlierFilterEnable = cfg.outlierFilterEnable; % 53 | obj.OutlierRangeFilter = cfg.OutlierRangeFilter; 54 | obj.gainLimit = cfg.gainLimit; 55 | 56 | obj.type.MEAS_RANG = cfg.MEAS_RANG; 57 | obj.type.MEAS_CONST_Z = cfg.MEAS_CONST_Z; 58 | end 59 | 60 | % KF Prediction 61 | function predictKF(obj,F,Q) 62 | obj.X = F * obj.X; % calculate X n/n-1 63 | obj.P = F * obj.P * F' + Q; % calculate P n/n-1 64 | end 65 | 66 | % KF Update 67 | function updateKF(obj,y,H,R,hi) 68 | K = obj.P * H' / (H * obj.P * H' + R); % calculate K - filter gain 69 | obj.X = obj.X + K*(y - hi); % calculate X - Update states 70 | obj.P = obj.P - K * H * obj.P; % calculate P - Update states covariance 71 | end 72 | 73 | function obj = initKF(obj,initTs,initPos) 74 | obj.t = initTs; % Init. EKF time 75 | 76 | Xinit = [initPos;0]; % Initialize EKF client position states 77 | 78 | Pinit = diag([ 79 | obj.init.posLatStd 80 | obj.init.posLatStd 81 | obj.init.heightStd 82 | obj.init.biasStd].^2);% 83 | 84 | % init KF: 85 | obj.X = Xinit; % Init state vector 86 | obj.P = Pinit; % Init state covariance matrix 87 | 88 | obj.Nstep = 0; 89 | obj.Innovation = 0; 90 | obj.InnovationMean = 0; 91 | obj.InnovationStd = 0; 92 | 93 | end 94 | 95 | function F = CreateF(~) 96 | F = eye(4); 97 | end 98 | 99 | function Q = CreateQ(obj, dt) 100 | Q = diag( dt * obj.sysNoisePos ); 101 | end 102 | 103 | function H = CreateH(obj, type, x_n_n, wifiAPpos) 104 | 105 | switch type 106 | case obj.type.MEAS_RANG 107 | H = (x_n_n(1:3)' - wifiAPpos.pos') / norm (x_n_n(1:3)' - wifiAPpos.pos'); 108 | H = [H,1]; % adding bias 109 | case obj.type.MEAS_CONST_Z % or E.MEAS_POSZ) 110 | H = [0, 0, 1, 0]; 111 | otherwise 112 | H = nan; 113 | end 114 | end 115 | 116 | function hi = CreateHx(obj, type, x_n_n, wifiAPpos) 117 | switch type 118 | case obj.type.MEAS_RANG 119 | hi = norm (x_n_n(1:3)' - wifiAPpos.pos') + x_n_n(4); 120 | case obj.type.MEAS_CONST_Z 121 | hi = x_n_n(3); 122 | otherwise 123 | hi = nan; 124 | end 125 | end 126 | 127 | function [R,gain] = CreateR(obj, range, expRange,H,inov,P) 128 | 129 | R = obj.rangeMeasNoiseVar; 130 | minSigma = sqrt(obj.rangeMeasNoiseVar); 131 | if obj.scaleSigmaForBigRange 132 | R = ( max(minSigma,0.4*range-2) ) ^ 2; 133 | end 134 | 135 | if obj.outlierFilterEnable % modify R if the range is too far from current solution 136 | tmp = svd(obj.P); 137 | latErrPredict = sqrt(sum(tmp(1:3))); 138 | %filter also negative outliers 139 | d = abs(range - expRange) - latErrPredict - minSigma; 140 | if (d > 0) || (range > obj.OutlierRangeFilter)% outlier 141 | R = 20 ^ 2; 142 | end 143 | end 144 | inovCov = H*P*H' + R; 145 | gain = inov/sqrt(inovCov); 146 | end % CreateR 147 | 148 | % ---------------------------------------------- 149 | function [posEst,updateDone,bias,latErrPredict,latErrUpdate,KFtime] = Run(obj,y,t,Rsp) 150 | dt = max(0,t - obj.t); % time difference from last update 151 | obj.t = (obj.t + dt); % update current KF time 152 | KFtime = obj.t; 153 | F = obj.CreateF(); % generate the states transition matrix 154 | Q = obj.CreateQ(dt); % generate the system noise covariance matrix 155 | obj.predictKF(F,Q); % Do KF prediction 156 | tmp = svd(obj.P); 157 | latErrPredict = sqrt(sum(tmp(1:3))); 158 | 159 | obj.Nstep = obj.Nstep + 1; 160 | H = obj.CreateH(obj.type.MEAS_RANG, obj.X, Rsp); 161 | hi = obj.CreateHx(obj.type.MEAS_RANG, obj.X, Rsp); 162 | 163 | obj.Innovation = y - hi; 164 | obj.InnovationMean = (obj.InnovationMean + obj.Innovation)/obj.Nstep; 165 | obj.InnovationStd = (obj.Innovation - obj.InnovationMean)/obj.Nstep; 166 | 167 | [R,gain] = obj.CreateR(y, hi,H,obj.Innovation,obj.P); 168 | if abs(gain) < obj.gainLimit 169 | obj.updateKF(y,H,R,hi); % Do KF update 170 | updateDone = 1; 171 | else 172 | updateDone = 0; 173 | end 174 | Hz = obj.CreateH(obj.type.MEAS_CONST_Z, obj.X, Rsp); 175 | obj.updateKF(obj.knownZ,Hz,obj.zMeasNoiseVar,obj.X(3)); % Do KF update 176 | 177 | posEst = obj.X(1:3); % updated current position estimation vector 178 | 179 | bias = obj.X(4); 180 | 181 | tmp = svd(obj.P); 182 | latErrUpdate = sqrt(sum(tmp(1:3))); 183 | end % function Run 184 | 185 | end % methods 186 | end % classdef 187 | 188 | 189 | 190 | 191 | -------------------------------------------------------------------------------- /FtmPE/PlotFtmPeResults.m: -------------------------------------------------------------------------------- 1 | % PlotResults displays estimated and reference trajectories on venue map. 2 | % In addition, it plots the empirical cumulative distribution function 3 | % Usage: PlotResults(cfg,posMat,bPos,refPos) 4 | 5 | % For questions/comments contact: 6 | % leor.banin@intel.com, 7 | % ofer.bar-shalom@intel.com, 8 | % nir.dvorecki@intel.com, 9 | % yuval.amizur@intel.com 10 | 11 | % Copyright (C) 2018 Intel Corporation 12 | % SPDX-License-Identifier: BSD-3-Clause 13 | 14 | function PlotFtmPeResults(cfg,posMat,rPos,refPos,bias, latErrPredict, latErrUpdate, venueParams,timeVec) 15 | 16 | figure; 17 | hAxes=gca; 18 | cfg.name(cfg.name=='_')=' '; 19 | 20 | if ~isempty(hAxes) 21 | imagesc(venueParams.cfgVenue.xMinMax,venueParams.cfgVenue.yMinMax,venueParams.cfgVenue.I,'parent',hAxes) 22 | set(hAxes,'ydir','normal'); 23 | axis(hAxes,'equal'); 24 | hold(hAxes,'on'); 25 | plot(refPos(:,1),refPos(:,2),'r.') 26 | plot(posMat(:,1),posMat(:,2),'b.') 27 | plot(rPos(:,2),rPos(:,3),'m^','MarkerFaceColor','m') 28 | leg1 = legend('$\mathbf{p}$','$\hat{\mathbf{p}}$','RSP','Location','southwest'); 29 | set(leg1,'Interpreter','latex'); 30 | for k = 1:size(rPos,1) 31 | text(rPos(k,2)+1,rPos(k,3),['\bf', num2str(rPos(k,1))],'FontSize',16,'Color','r'); 32 | end 33 | end 34 | xlabel('[m]') 35 | ylabel('[m]') 36 | axis equal 37 | axis([-45 7 -5 25]) 38 | title(cfg.name) 39 | 40 | tmp = (posMat-refPos); 41 | product = tmp.*tmp; 42 | error = sqrt(squeeze(sum(product,2))); 43 | 44 | figure 45 | subplot 321 46 | plot(timeVec-timeVec(1),posMat(:,3),'b','LineWidth',1) 47 | xlabel('time [sec]') 48 | ylabel('z height[m]') 49 | grid on; box on; 50 | subplot 323 51 | plot(timeVec-timeVec(1),bias,'k','LineWidth',1) 52 | xlabel('time [sec]') 53 | ylabel('Bias [m]') 54 | grid on; box on; 55 | subplot 325 56 | plot(timeVec-timeVec(1),error./latErrPredict,'m','LineWidth',1) 57 | 58 | xlabel('time [sec]') 59 | ylabel('\sigma') 60 | grid on; box on; 61 | subplot(3,2,[2,4,6]) 62 | [X1,Y1] = CalcEcdf(error./latErrPredict); 63 | plot(X1,Y1,'r-','LineWidth',2) 64 | ylabel('CDF[%]') 65 | xlabel('\sigma') 66 | grid on 67 | 68 | text('VerticalAlignment','top',... 69 | 'HorizontalAlignment','center',... 70 | 'FontWeight','bold',... 71 | 'String',cfg.name,... 72 | 'Position',[-0.46 107.4 0],... 73 | 'Visible','on'); 74 | 75 | [X,Y] = CalcEcdf(error); 76 | figure 77 | plot(X,Y,'-','LineWidth',2) 78 | xlabel('Position Error [m]') 79 | ylabel('CDF [%]') 80 | title(cfg.name) 81 | grid on 82 | box on 83 | end 84 | 85 | % ----------------------------------------------------- 86 | function [X,Y] = CalcEcdf(in) 87 | N = length(in); 88 | in_s = sort(in); 89 | Y = (1:N)/N*100; 90 | X=in_s(:);Y=Y(:); 91 | end 92 | 93 | -------------------------------------------------------------------------------- /FtmPE/ReadFtmMeasFile.m: -------------------------------------------------------------------------------- 1 | % ReadFtmMeasFile - extracts FTM measurement file. 2 | % usage: [measTableOut,refPosMat,rPos] = ReadFtmMeasFile(cfg) 3 | 4 | % For questions/comments contact: 5 | % leor.banin@intel.com, 6 | % ofer.bar-shalom@intel.com, 7 | % nir.dvorecki@intel.com, 8 | % yuval.amizur@intel.com 9 | 10 | % Copyright (C) 2018 Intel Corporation 11 | % SPDX-License-Identifier: BSD-3-Clause 12 | 13 | % function [measTableOut,rPos,refPosMat] = ReadFtmMeasFile(cfg) 14 | function [measTableOut,refPosMat,rPos,VenueParams] = ReadFtmMeasFile(cfg) 15 | 16 | 17 | measTable = load(fullfile(pwd,'\data\',cfg.sessionFolder,cfg.measFile)); 18 | rPos = load(fullfile(pwd,'\data\',cfg.sessionFolder,cfg.rPosFile)); 19 | VenueParams = load(fullfile(pwd,'\data\',cfg.sessionFolder,cfg.VenueFile)); 20 | 21 | Nrsp = length(rPos(:,1)); 22 | % remove RSPs --------------------------------------------------- 23 | for k = 1:length(cfg.Rsp2remove) 24 | id = cfg.Rsp2remove(k); 25 | if(id <= Nrsp) 26 | z = measTable(:,9)==id; 27 | measTable(z,:)=[]; 28 | end 29 | end 30 | rPos(cfg.Rsp2remove,:) = []; 31 | % ---------------------------------------------------------------- 32 | % extract reference trajectory - ground truth of client position 33 | refPosMat = measTable(:,2:4); 34 | 35 | % prepare input to PE 36 | measTableOut = measTable; -------------------------------------------------------------------------------- /FtmPE/RunFtmPE.m: -------------------------------------------------------------------------------- 1 | % RunFtmPE - main positioning engine loop. 2 | % usage:[posEst,pValid] = RunFtmPE(cfg, measTable) 3 | 4 | % For questions/comments contact: 5 | % leor.banin@intel.com, 6 | % ofer.bar-shalom@intel.com, 7 | % nir.dvorecki@intel.com, 8 | % yuval.amizur@intel.com 9 | 10 | % Copyright (C) 2018 Intel Corporation 11 | % SPDX-License-Identifier: BSD-3-Clause 12 | 13 | function [posEst,pValid,bias,latErrPredict,latErrUpdate,KFtime] = RunFtmPE(cfg, measTable) 14 | 15 | measN = size(measTable,1); 16 | KF = KfFtmclass(cfg); % Kalman Filter Constructor 17 | % KF = CalcPositionClass(cfg); % Kalman Filter Constructor 18 | INIT_KF = 1; % KF Initialization flag 19 | 20 | posEst = nan(3,measN); 21 | pValid = false(measN,1); 22 | updateDone = false(measN,1); 23 | bias = nan(measN,1); 24 | latErrPredict = nan(measN,1); 25 | latErrUpdate = nan(measN,1); 26 | KFtime = nan(measN,1); 27 | 28 | k = 1; 29 | while (k <= measN) 30 | if INIT_KF 31 | timestamp = measTable(1,1); 32 | EstPos = measTable(1,2:4)'; % init. value to ground-truth 33 | KF.initKF(timestamp,EstPos); 34 | INIT_KF = 0; % Reset flag 35 | continue; 36 | else 37 | [timestamp,measRange,Rsp] = ParseMeasLine(measTable(k,:)); 38 | % Run KF 39 | if(measRange <= cfg.MaxRangeFilter) 40 | [posEst(:,k),updateDone(k),bias(k),latErrPredict(k),latErrUpdate(k),KFtime(k)] = ... 41 | KF.Run(measRange,timestamp,Rsp); 42 | pValid(k) = true; 43 | else 44 | pValid(k) = false; 45 | end 46 | end % INIT_KF 47 | k = k + 1; 48 | end % while 49 | end % function 50 | 51 | % ------------------------------------------------------------------------ 52 | function [timestamp,measRange,Rsp] = ParseMeasLine(measLine) 53 | 54 | % line Format: timestamp,rspId,measRange,rangeSigma,rspPosX,rspPosY,rspPosZ 55 | timestamp = measLine(1); 56 | % refPos = measLine(2:4)'; 57 | measRange = measLine(5); 58 | %---------------------------------------------------------- 59 | Rsp.pos = measLine(6:8)'; % Transmitting responder position 60 | Rsp.index = measLine(9); % Responder ID 61 | %---------------------------------------------------------- 62 | end 63 | 64 | -------------------------------------------------------------------------------- /FtmPE/WiFi Location Core PE and Measurements Database.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/intel/WiFi-Location-Core-PE-and-Measurement-Database/9f9bc00fa2016f255c7daaf31d42602abf36000f/FtmPE/WiFi Location Core PE and Measurements Database.pdf -------------------------------------------------------------------------------- /FtmPE/data/Office1_80MHz/Office1_80MHz_RSP_LIST.csv: -------------------------------------------------------------------------------- 1 | 1, -11.00421349, 21.95210285, 2.20000000 2 | 2, -42.69821485, 15.36275814, 2.20000000 3 | 3, -19.00387679, 21.94544867, 2.20000000 4 | 4, -18.07288542, 11.16384917, 2.20000000 5 | 5, -27.34572141, 22.47347309, 2.20000000 6 | 6, -4.88818655, 20.30251762, 2.20000000 7 | 7, 4.78864500, 2.34228746, 2.20000000 8 | 8, 3.33823145, 10.26461751, 2.20000000 9 | 9, -43.30614754, 21.85768382, 2.20000000 10 | 10, -5.63984836, 6.03318238, 2.20000000 11 | -------------------------------------------------------------------------------- /FtmPE/data/Office1_80MHz/Office1_80MHz_VenueFile.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/intel/WiFi-Location-Core-PE-and-Measurement-Database/9f9bc00fa2016f255c7daaf31d42602abf36000f/FtmPE/data/Office1_80MHz/Office1_80MHz_VenueFile.mat -------------------------------------------------------------------------------- /FtmPE/data/Office2_80MHz/Office2_80MHz_RSP_LIST.csv: -------------------------------------------------------------------------------- 1 | 1, -11.00421349, 21.95210285, 2.20000000 2 | 2, -42.69821485, 15.36275814, 2.20000000 3 | 3, -19.00387679, 21.94544867, 2.20000000 4 | 4, -18.07288542, 11.16384917, 2.20000000 5 | 5, -27.34572141, 22.47347309, 2.20000000 6 | 6, -4.88818655, 20.30251762, 2.20000000 7 | 7, 4.78864500, 2.34228746, 2.20000000 8 | 8, 3.33823145, 10.26461751, 2.20000000 9 | 9, -43.30614754, 21.85768382, 2.20000000 10 | 10, -5.63984836, 6.03318238, 2.20000000 11 | -------------------------------------------------------------------------------- /FtmPE/data/Office2_80MHz/Office2_80MHz_VenueFile.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/intel/WiFi-Location-Core-PE-and-Measurement-Database/9f9bc00fa2016f255c7daaf31d42602abf36000f/FtmPE/data/Office2_80MHz/Office2_80MHz_VenueFile.mat -------------------------------------------------------------------------------- /FtmPE/data/Office3_80MHz/Office3_80MHz_RSP_LIST.csv: -------------------------------------------------------------------------------- 1 | 1, -11.00421349, 21.95210285, 2.20000000 2 | 2, -42.69821485, 15.36275814, 2.20000000 3 | 3, -19.00387679, 21.94544867, 2.20000000 4 | 4, -18.07288542, 11.16384917, 2.20000000 5 | 5, -27.34572141, 22.47347309, 2.20000000 6 | 6, -4.88818655, 20.30251762, 2.20000000 7 | 7, 4.78864500, 2.34228746, 2.20000000 8 | 8, 3.33823145, 10.26461751, 2.20000000 9 | 9, -43.30614754, 21.85768382, 2.20000000 10 | 10, -5.63984836, 6.03318238, 2.20000000 11 | -------------------------------------------------------------------------------- /FtmPE/data/Office3_80MHz/Office3_80MHz_VenueFile.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/intel/WiFi-Location-Core-PE-and-Measurement-Database/9f9bc00fa2016f255c7daaf31d42602abf36000f/FtmPE/data/Office3_80MHz/Office3_80MHz_VenueFile.mat -------------------------------------------------------------------------------- /FtmPE/data/Office4_80MHz/Office4_80MHz_RSP_LIST.csv: -------------------------------------------------------------------------------- 1 | 1, -11.00421349, 21.95210285, 2.20000000 2 | 2, -42.69821485, 15.36275814, 2.20000000 3 | 3, -19.00387679, 21.94544867, 2.20000000 4 | 4, -18.07288542, 11.16384917, 2.20000000 5 | 5, -27.34572141, 22.47347309, 2.20000000 6 | 6, -4.88818655, 20.30251762, 2.20000000 7 | 7, 4.78864500, 2.34228746, 2.20000000 8 | 8, 3.33823145, 10.26461751, 2.20000000 9 | 9, -43.30614754, 21.85768382, 2.20000000 10 | 10, -5.63984836, 6.03318238, 2.20000000 11 | -------------------------------------------------------------------------------- /FtmPE/data/Office4_80MHz/Office4_80MHz_VenueFile.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/intel/WiFi-Location-Core-PE-and-Measurement-Database/9f9bc00fa2016f255c7daaf31d42602abf36000f/FtmPE/data/Office4_80MHz/Office4_80MHz_VenueFile.mat -------------------------------------------------------------------------------- /FtmPE/data/Office5_80MHz/Office5_80MHz_RSP_LIST.csv: -------------------------------------------------------------------------------- 1 | 1, -11.00421349, 21.95210285, 2.20000000 2 | 2, -42.69821485, 15.36275814, 2.20000000 3 | 3, -19.00387679, 21.94544867, 2.20000000 4 | 4, -18.07288542, 11.16384917, 2.20000000 5 | 5, -27.34572141, 22.47347309, 2.20000000 6 | 6, -4.88818655, 20.30251762, 2.20000000 7 | 7, 4.78864500, 2.34228746, 2.20000000 8 | 8, 3.33823145, 10.26461751, 2.20000000 9 | 9, -43.30614754, 21.85768382, 2.20000000 10 | 10, -5.63984836, 6.03318238, 2.20000000 11 | -------------------------------------------------------------------------------- /FtmPE/data/Office5_80MHz/Office5_80MHz_VenueFile.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/intel/WiFi-Location-Core-PE-and-Measurement-Database/9f9bc00fa2016f255c7daaf31d42602abf36000f/FtmPE/data/Office5_80MHz/Office5_80MHz_VenueFile.mat -------------------------------------------------------------------------------- /FtmPE/data/Office6_40MHz/Office6_40MHz_RSP_LIST.csv: -------------------------------------------------------------------------------- 1 | 1, -34.98112896, -3.25698293, 2.20000000 2 | 2, -28.88404558, 22.27976485, 2.20000000 3 | 3, -0.20600114, 23.55317604, 2.20000000 4 | 4, -1.80895501, -0.06281021, 2.20000000 5 | 5, -27.54410322, 1.83826912, 2.20000000 6 | 6, 5.49812924, 1.85147001, 2.20000000 7 | 7, -42.94897026, 22.31220395, 2.20000000 8 | 8, -29.88460635, 10.67314712, 2.20000000 9 | 9, -2.83660097, 13.12237457, 2.20000000 10 | 10, -18.81679206, -3.20493499, 2.20000000 11 | 11, -13.72374201, 22.40109642, 2.20000000 12 | -------------------------------------------------------------------------------- /FtmPE/data/Office6_40MHz/Office6_40MHz_VenueFile.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/intel/WiFi-Location-Core-PE-and-Measurement-Database/9f9bc00fa2016f255c7daaf31d42602abf36000f/FtmPE/data/Office6_40MHz/Office6_40MHz_VenueFile.mat -------------------------------------------------------------------------------- /FtmPE/mainFtmPE.m: -------------------------------------------------------------------------------- 1 | % mainPE - main function for simulation. 2 | % usage: mainPE(configMfile) 3 | 4 | % For questions/comments contact: 5 | % leor.banin@intel.com, 6 | % ofer.bar-shalom@intel.com, 7 | % nir.dvorecki@intel.com, 8 | % yuval.amizur@intel.com 9 | 10 | % Copyright (C) 2018 Intel Corporation 11 | % SPDX-License-Identifier: BSD-3-Clause 12 | 13 | function mainFtmPE(sessionFolder) 14 | 15 | if exist('sessionFolder','var') 16 | cfg = testFtmPeConfig(sessionFolder); 17 | else 18 | cfg = testFtmPeConfig(); 19 | end 20 | 21 | [measTable,refPos,rPos,venueParams] = ReadFtmMeasFile(cfg); % Read measurements file 22 | [posEst,pValid,bias,latErrPredict,latErrUpdate,timeVec] = RunFtmPE(cfg,measTable); % Run PE 23 | 24 | % pValid - designates the entries produced for every measurement received by the client 25 | 26 | posMat = posEst(:,pValid)'; 27 | refPosMat = refPos(pValid,:); 28 | bias = bias(pValid,:); 29 | latErrPredict = latErrPredict(pValid,:); 30 | latErrUpdate = latErrUpdate(pValid,:); 31 | timeVec = timeVec(pValid,:); 32 | PlotFtmPeResults(cfg,posMat,rPos,refPosMat,bias, latErrPredict, latErrUpdate, venueParams, timeVec) % plot results 33 | 34 | end 35 | -------------------------------------------------------------------------------- /FtmPE/testFtmPeConfig.m: -------------------------------------------------------------------------------- 1 | % For questions/comments contact: 2 | % leor.banin@intel.com, 3 | % ofer.bar-shalom@intel.com, 4 | % nir.dvorecki@intel.com, 5 | % yuval.amizur@intel.com 6 | % Copyright (C) 2018 Intel Corporation 7 | % SPDX-License-Identifier: BSD-3-Clause 8 | 9 | function cfg = testFtmPeConfig(sessionFolder) 10 | if ~nargin 11 | cfg.sessionFolder = 'Office1_80MHz'; 12 | else 13 | cfg.sessionFolder = sessionFolder; 14 | end 15 | cfg.name = cfg.sessionFolder; 16 | cfg.measFile = [cfg.name,'.csv']; 17 | cfg.rPosFile = [cfg.name,'_RSP_LIST.csv']; 18 | cfg.VenueFile = [cfg.name,'_VenueFile.mat']; 19 | %************************************************************************* 20 | cfg.UseSyntheticMeas = 0; % 1 = Use synthetic measurements 21 | % 0 = Use real measured data 22 | if cfg.UseSyntheticMeas 23 | cfg.measFile = [cfg.name,'_noisySynthRanges.csv']; 24 | cfg.name = cfg.measFile(1:end-4); 25 | end 26 | %************************************************************************* 27 | cfg.Rsp2remove = [];% set e.g., cfg.Rsp2remove = [1,6] to remove RSPs {1,6} 28 | cfg.scaleSigmaForBigRange = 1; % 1 = Enable STD scaling for range, otherwise set to 0 29 | cfg.outlierFilterEnable = 1; % 1 = Enable Outlier Filtering, otherwise set to 0 30 | cfg.MaxRangeFilter = 50; % filter out ranges above this threshold 31 | cfg.OutlierRangeFilter = 30; % enable outlier range filtering above this threshold 32 | cfg.gainLimit = 3; % EKF gain limit 33 | %************************************************************************* 34 | 35 | cfg.knownZ = 1.4; % Known client height [meter] 36 | cfg.rangeMeasNoiseStd = 1.0; % Range measurement noise Std [meter]. 37 | cfg.zMeasNoiseStd = 0.1; % Height measurement noise Std [meter]. 38 | 39 | cfg.posLatStd = 1.0; % Q - sys. noise [meter per second]; 40 | cfg.heightStd = 0.1; % Q - sys. noise [meter per second]; 41 | cfg.biasStd = 0.01;% Q - sys. noise [meter per second]; 42 | cfg.init.posLatStd = 1; % P - state cov. [meter] 43 | cfg.init.heightStd = 0.2; % P - state cov. [meter] 44 | cfg.init.biasStd = 0.5; % P - state cov. [meter] 45 | 46 | % measurement type defines 47 | cfg.MEAS_RANG = 1; 48 | cfg.MEAS_CONST_Z = 2; 49 | 50 | 51 | end -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | Copyright (c) 2018 Intel Corporation. All rights reserved. 2 | 3 | Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 4 | 5 | 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 6 | 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 7 | 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. 8 | 9 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 10 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 11 | IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, 12 | OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 13 | OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 14 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | DISCONTINUATION OF PROJECT. 2 | 3 | This project will no longer be maintained by Intel. 4 | 5 | Intel has ceased development and contributions including, but not limited to, maintenance, bug fixes, new releases, or updates, to this project. 6 | 7 | Intel no longer accepts patches to this project. 8 | 9 | If you have an ongoing need to use this project, are interested in independently developing it, or would like to maintain patches for the open source software community, please create your own fork of this project. 10 | # wifi-location-core-pe-and-measurement-database 11 | 12 | refer to WiFi Location Core PE and Measurements Database.pdf 13 | 14 | # For questions/comments contact: 15 | # leor.banin@intel.com, 16 | # ofer.bar-shalom@intel.com, 17 | # nir.dvorecki@intel.com, 18 | # yuval.amizur@intel.com 19 | 20 | # Copyright (C) 2018 Intel Corporation 21 | # SPDX-License-Identifier: BSD-3-Clause --------------------------------------------------------------------------------