All Projects → wouterbulten → Kalmanjs

wouterbulten / Kalmanjs

Licence: mit
Javascript based Kalman filter for 1D data

Programming Languages

javascript
184084 projects - #8 most used programming language
java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to Kalmanjs

Kalman Filter
Kalman Filter implementation in Python using Numpy only in 30 lines.
Stars: ✭ 161 (-45.97%)
Mutual labels:  kalman-filter, filter
Filterizr
✨ Filterizr is a JavaScript library that sorts, shuffles and filters responsive galleries using CSS3 transitions ✨
Stars: ✭ 546 (+83.22%)
Mutual labels:  filter, javascript-library
Kalmanfilter altimeter vario
Kalman filter to estimate altitude and climbrate(sinkrate) by fusing altitude and acceleration sensor data
Stars: ✭ 31 (-89.6%)
Mutual labels:  filter, kalman-filter
Easygrid
EasyGrid - VanillaJS Responsive Grid
Stars: ✭ 77 (-74.16%)
Mutual labels:  filter, javascript-library
Kalman.jl
Flexible filtering and smoothing in Julia
Stars: ✭ 62 (-79.19%)
Mutual labels:  filter, kalman-filter
robust-kalman
Robust Kalman filter with adaptive noise statistics estimation.
Stars: ✭ 89 (-70.13%)
Mutual labels:  noise, kalman-filter
Jschema
A simple, easy to use data modeling framework for JavaScript
Stars: ✭ 261 (-12.42%)
Mutual labels:  filter, javascript-library
Gps imu kalman filter
Fusing GPS, IMU and Encoder sensors for accurate state estimation.
Stars: ✭ 264 (-11.41%)
Mutual labels:  kalman-filter
Easycanvas
数据驱动、2D&3D、渐进式Canvas库,支持JSX,配备Chrome调试插件,支持微信小游戏、物理引擎等。
Stars: ✭ 281 (-5.7%)
Mutual labels:  javascript-library
Apify Js
Apify SDK — The scalable web scraping and crawling library for JavaScript/Node.js. Enables development of data extraction and web automation jobs (not only) with headless Chrome and Puppeteer.
Stars: ✭ 3,154 (+958.39%)
Mutual labels:  javascript-library
Typelighterjs
Take a stride into the world of dynamic and appealing typewriters. You can be sure that you will never even think of looking back.
Stars: ✭ 262 (-12.08%)
Mutual labels:  javascript-library
Hypermark
Markdown for Humans.
Stars: ✭ 266 (-10.74%)
Mutual labels:  filter
Menuspy
A JavaScript library to make navigation menus highlight the item based on currently in view section.
Stars: ✭ 283 (-5.03%)
Mutual labels:  javascript-library
Noice
A native Android app to relax, improve focus and boost productivity with minimal background noise.
Stars: ✭ 264 (-11.41%)
Mutual labels:  noise
Anychart
AnyChart is a lightweight and robust JavaScript charting solution with great API and documentation. The chart types and unique features are numerous, the library works easily with any development stack.
Stars: ✭ 288 (-3.36%)
Mutual labels:  javascript-library
Gridjs
Advanced table plugin
Stars: ✭ 3,231 (+984.23%)
Mutual labels:  filter
Sensitive
敏感词查找,验证,过滤和替换 🤓 FindAll, Validate, Filter and Replace words.
Stars: ✭ 292 (-2.01%)
Mutual labels:  filter
Panflute
An Pythonic alternative to John MacFarlane's pandocfilters, with extra helper functions
Stars: ✭ 286 (-4.03%)
Mutual labels:  filter
Kero
kero is a front-end model framework. - kero是一个前端模型框架,做为MVVM架构中Model层的增强,提供多维数据模型,解决企业应用中复杂的业务应用场景的开发问题。
Stars: ✭ 276 (-7.38%)
Mutual labels:  javascript-library
Oimophysics
A cross-platform 3D physics engine
Stars: ✭ 269 (-9.73%)
Mutual labels:  javascript-library

KalmanJS

Javascript based Kalman filter for 1D data. Sometimes you need a simple noise filter without any dependencies; for those cases KalmanJS is perfect.

I wrote two blog posts on explaining Kalman filters in general and applying them on noisy data in particular:

For other languages than Javascript, please see the note on the contrib folder.

Kalman filter applied to a noisy dataset.

Questions?

Please see the blog post (KalmanJS, Lightweight Javascript Library for Noise filtering) for more information about using this library. Any questions can be posted there as comments.

Examples

An collection of examples can be found here:

Installation

The KalmanJS library is a small javascript library and can easily be integrated in to your project manually. Alternatively, the library can be included using npm.

Try KalmanJS in the browser on Runkit

In the browser

Include the kalman.js or kalman.min.js from the dist folder on your webpage, the filter can then be used directly.

<script src="kalman.min.js" type="text/javascript"></script>
<script type="text/javascript">
  var kf = new KalmanFilter();
  console.log(kf.filter(3));
  console.log(kf.filter(2));
  console.log(kf.filter(1));
</script>

Should output (with default settings):

3
2.3333333333333335
1.5000000000000002

Node (es6)

npm install kalmanjs

import KalmanFilter from 'kalmanjs';

const kf = new KalmanFilter();
console.log(kf.filter(3));
console.log(kf.filter(2));
console.log(kf.filter(1));

Should output (with default settings):

3
2.3333333333333335
1.5000000000000002

Node (es5)

npm install kalmanjs

var KalmanFilter = require('kalmanjs')

var kf = new KalmanFilter();
console.log(kf.filter(3));
console.log(kf.filter(2));
console.log(kf.filter(1));

Should output (with default settings):

3
2.3333333333333335
1.5000000000000002

Applying the filter on a dataset

Using the filter is simple. First we create a simple dataset with random noise:

//Generate a simple static dataset
var dataConstant = Array.apply(null, {length: dataSetSize}).map(function() {
  return 4;
});
//Add noise to data
var noisyDataConstant = dataConstant.map(function(v) {
  return v + randn(0, 3);
});

Then we apply the filter iteratively on each data element:

//Apply kalman filter
var kalmanFilter = new KalmanFilter({R: 0.01, Q: 3});

var dataConstantKalman = noisyDataConstant.map(function(v) {
  return kalmanFilter.filter(v);
});

See this blog post for screenshots and more examples.

Reference

This project was part of my research on indoor localization. Please see my paper or this presentation for more information. You can use the following reference if you want to cite my paper:

W. Bulten, A. C. V. Rossum and W. F. G. Haselager, "Human SLAM, Indoor Localisation of Devices and Users," 2016 IEEE First International Conference on Internet-of-Things Design and Implementation (IoTDI), Berlin, 2016, pp. 211-222. doi: 10.1109/IoTDI.2015.19 URL

Or, if you prefer in BibTeX format:

@INPROCEEDINGS{7471364,
author={W. Bulten and A. C. V. Rossum and W. F. G. Haselager},
booktitle={2016 IEEE First International Conference on Internet-of-Things Design and Implementation (IoTDI)},
title={Human SLAM, Indoor Localisation of Devices and Users},
year={2016},
pages={211-222},
keywords={RSSI;data privacy;indoor environment;ubiquitous computing;FastSLAM;RSSI update;SLAC algorithm;device RSSI;device indoor localisation;device location;device position;environment noise;human SLAM;nontrivial environment;received signal strength indicator;simultaneous localisation and configuration;smart space;user indoor localisation;user motion data;user privacy;Estimation;Performance evaluation;Privacy;Simultaneous localization and mapping;Privacy;Simultaneous localization and mapping;Smart Homes;Ubiquitous computing;Wireless sensor networks},
doi={10.1109/IoTDI.2015.19},
month={April},}

Other languages

Kalman filters can be useful in a broad range of projects. Regularly I get questions whether KalmanJS is available in other languages than Javascript and sometimes another library is available. I would encourage searching for it if you require another implementation. For convenience, this repository contains a contrib folder with user-submitted implementations in other languages.

Copyright

MIT License

Copyright (c) 2018 Wouter Bulten

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].