{"_id":"kalmanjs","_rev":"8-71f1bc38409977e3105a270af3157017","name":"kalmanjs","description":"A small library implementing the principle of Kalman filters, without any dependencies, to filter out noise in 1D systems.","dist-tags":{"latest":"1.1.0","beta":"1.1.0"},"versions":{"1.0.0-beta":{"name":"kalmanjs","version":"1.0.0-beta","private":false,"devDependencies":{"babel-cli":"^6.2.0","babel-preset-es2015":"^6.1.18","eslint":"^1.10.3","eslint-config-airbnb":"^1.0.2","uglify-js":"^2.6.1"},"repository":{"type":"git","url":"git://github.com/wouterbulten/kalmanjs.git"},"description":"A small library implementing the principle of Kalman filters, without any dependencies, to filter out noise in 1D systems.","bugs":{"url":"https://github.com/wouterbulten/kalmanjs/issues"},"homepage":"https://github.com/wouterbulten/kalmanjs","main":"lib/kalman.js","scripts":{"compile":"babel --source-maps -d lib/ src/","minify":"uglifyjs lib/kalman.js --compress --preamble '//kalmanjs, LGPL-3.0, https://github.com/wouterbulten/kalmanjs' --source-map lib/kalman.min.js.map --in-source-map lib/kalman.js.map --mangle -o lib/kalman.min.js","prepublish":"npm run compile && npm run minify"},"keywords":["kalman","filter","math","noise","javascript"],"author":{"name":"Wouter Bulten","url":"https://wouterbulten.nl"},"license":"LGPL-3.0","gitHead":"440570ed67f1a605f73284554c22167fb8b9dc63","_id":"kalmanjs@1.0.0-beta","_shasum":"ee3de551ab7ef639615904aac2f5118764ffb882","_from":".","_npmVersion":"2.11.0","_nodeVersion":"0.10.32","_npmUser":{"name":"wouterbulten","email":"wouterbulten+npm@mai-ai.org"},"dist":{"shasum":"ee3de551ab7ef639615904aac2f5118764ffb882","tarball":"https://registry.npmjs.org/kalmanjs/-/kalmanjs-1.0.0-beta.tgz","integrity":"sha512-1rUgGCFH+jOioCKycYX5Of2tRAmAECEBFurxTBRFdyYXa4oHVSOpWIbvOyo4mmWlcE8k3vzzA9zGeDQ3i6KvHg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDNkfa0zQz/w8vERGCr7Eifk92RM3Bh7O/DpvvVJ9EhpAIhAL3hXs4nhon+F5nFVytDz1HLCGSz8G5/qhk+srxCv1x8"}]},"maintainers":[{"name":"wouterbulten","email":"wouterbulten+npm@mai-ai.org"}],"directories":{}},"1.1.0":{"name":"kalmanjs","version":"1.1.0","private":false,"devDependencies":{"@babel/cli":"^7.2.3","@babel/core":"^7.2.2","@babel/preset-env":"^7.2.3","rollup":"^1.1.0","rollup-plugin-babel":"^4.3.1","rollup-plugin-node-resolve":"^4.0.0","uglify-js":"^3.4.9"},"repository":{"type":"git","url":"git://github.com/wouterbulten/kalmanjs.git"},"description":"A small library implementing the principle of Kalman filters, without any dependencies, to filter out noise in 1D systems.","bugs":{"url":"https://github.com/wouterbulten/kalmanjs/issues"},"homepage":"https://github.com/wouterbulten/kalmanjs","main":"lib/kalman.js","scripts":{"compile":"npx babel src --source-maps --out-dir lib","minify":"npx uglifyjs dist/kalman.js --beautify \"beautify=false, preamble='/*kalmanjs, Wouter Bulten, MIT, https://github.com/wouterbulten/kalmanjs */'\" --compress --source-map \"content='dist/kalman.js.map'\" --mangle -o dist/kalman.min.js","build":"npx rollup -c","prepublishOnly":"npm run build"},"keywords":["kalman","filter","math","noise","javascript"],"author":{"name":"Wouter Bulten","url":"https://wouterbulten.nl"},"license":"MIT","readme":"# KalmanJS\n\nJavascript based Kalman filter for 1D data. Sometimes you need a simple noise filter without any dependencies; for those cases *Kalman.js* is perfect.\n\n![Kalman filter applied to a noisy dataset.](/resources/kalman-example.png?raw=true \"Kalman filter applied to a noisy dataset.\")\n\n## Background\n\nI wrote two blog posts on explaining Kalman filters in general and applying them on noisy data in particular:\n\n* [KalmanJS, Lightweight Javascript Library for Noise filtering](https://www.wouterbulten.nl/blog/tech/lightweight-javascript-library-for-noise-filtering/)\n* [Kalman filters explained: Removing noise from RSSI signals](https://www.wouterbulten.nl/blog/tech/kalman-filters-explained-removing-noise-from-rssi-signals/)\n\n## Questions?\n\nPlease see the blog post ([KalmanJS, Lightweight Javascript Library for Noise filtering](https://wouterbulten.nl/blog/tech/lightweight-javascript-library-for-noise-filtering/)) for more information about using this library. Any questions can be posted there as comments.\n\n## Installation\n\nThe 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.\n\n### In the browser\n\nInclude the `kalman.js` or `kalman.min.js` from the `dist` folder on your webpage, the filter can then be used directly.\n\n```html\n<script src=\"kalman.min.js\" type=\"text/javascript\"></script>\n<script type=\"text/javascript\">\n  var kf = new KalmanFilter();\n  console.log(kf.filter(3));\n  console.log(kf.filter(2));\n  console.log(kf.filter(1));\n</script>\n```\n\nShould output (with default settings):\n\n```\n3\n2.3333333333333335\n1.5000000000000002\n```\n\n### Node (es6)\n`npm install kalmanjs`\n\n```javascript\nimport KalmanFilter from 'kalmanjs';\n\nconst kf = new KalmanFilter();\nconsole.log(kf.filter(3));\nconsole.log(kf.filter(2));\nconsole.log(kf.filter(1));\n```\n\nShould output (with default settings):\n\n```\n3\n2.3333333333333335\n1.5000000000000002\n```\n\n### Node (es5)\n`npm install kalmanjs`\n\n```javascript\nvar KalmanFilter = require('kalmanjs');\n\nvar kf = new KalmanFilter();\nconsole.log(kf.filter(3));\nconsole.log(kf.filter(2));\nconsole.log(kf.filter(1));\n\n```\n\nShould output (with default settings):\n\n```\n3\n2.3333333333333335\n1.5000000000000002\n```\n\n## Applying the filter on a dataset\n\nUsing the filter is simple. First we create a simple dataset with random noise:\n\n```javascript\n//Generate a simple static dataset\nvar dataConstant = Array.apply(null, {length: dataSetSize}).map(function() {\n  return 4;\n});\n//Add noise to data\nvar noisyDataConstant = dataConstant.map(function(v) {\n  return v + randn(0, 3);\n});\n```\n\nThen we apply the filter iteratively on each data element:\n\n```javascript\n//Apply kalman filter\nvar kalmanFilter = new KalmanFilter({R: 0.01, Q: 3});\n\nvar dataConstantKalman = noisyDataConstant.map(function(v) {\n  return kalmanFilter.filter(v);\n});\n```\n\nSee [this blog post](https://wouterbulten.nl/blog/tech/lightweight-javascript-library-for-noise-filtering/) for screenshots and more examples.\n\n## Reference\n\nThis project was part of my research on indoor localization. Please see my [paper](http://ieeexplore.ieee.org/document/7471364) or this [presentation](https://www.wouterbulten.nl/blog/tech/iotdi-ic2e-conference-presentation-human-slam/) for more information. You can use the following reference if you want to cite my paper:\n\n> 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](http://ieeexplore.ieee.org/document/7471364)\n\nOr, if you prefer in BibTeX format:\n\n```tex\n@INPROCEEDINGS{7471364,\nauthor={W. Bulten and A. C. V. Rossum and W. F. G. Haselager},\nbooktitle={2016 IEEE First International Conference on Internet-of-Things Design and Implementation (IoTDI)},\ntitle={Human SLAM, Indoor Localisation of Devices and Users},\nyear={2016},\npages={211-222},\nkeywords={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},\ndoi={10.1109/IoTDI.2015.19},\nmonth={April},}\n```\n\n## Other languages\n\nKalman 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.\n\n## Copyright\n\nMIT License\n\nCopyright (c) 2018 Wouter Bulten\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","readmeFilename":"README.md","gitHead":"7650e87c77a1f05aba44e4726754b4f8c2e5ae34","_id":"kalmanjs@1.1.0","_npmVersion":"6.4.1","_nodeVersion":"10.15.0","_npmUser":{"name":"wouterbulten","email":"wouterbulten+npm@mai-ai.org"},"dist":{"integrity":"sha512-Gkm2DAKIX8geuDcEJ92e80EmQ6TyIzWBJk6AFk+aDLofQ4G/KoDe1RCY9WMuXFe0NQxsTi7HYh9BVQneOtlvkg==","shasum":"9554566a0a7ca72722d35a23ab05915c0ddba99e","tarball":"https://registry.npmjs.org/kalmanjs/-/kalmanjs-1.1.0.tgz","fileCount":5,"unpackedSize":16247,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcRIsZCRA9TVsSAnZWagAAkHoP/R0Fcf76Uv8OgNo0deG1\nUDBNTg1S/R/uQHZg95iXFxiaLuBKN7Sa0j1u07HDyyxgE0VRmr1Q+0B54yAf\nj4aTv0Q3iZOD8jSic14PCI9ybSH4VTRHQdUGWZ5hXR8OHs0J2EzURf6Mdj6Q\nT8WcIZ8mcOMe7EXaS0Oh4+CMDSVOjquhIUGCzsbxbCc3lEFK88kt7zcy1wlL\nAGnRdf2qOtyC5nT2nJmY/e3MmYLDP/9ySqjrKpCZ7JPFH0jENHo3P260zrLh\nLqPisQ01zFW6cY/70zTBAtfmCD6M97h6w3XBUdGFmIOkRFxtQau+ZDGTPhBE\nHTUNgLmIiD8nUxX9ixTp+kBEFqd583NgqPBOxZbfDZqmfpWNa3HSDQFtZHvx\nplzcvrKmKY1WtQPYtNDDwvoWan1BSUzxTOHlR/KpKx3qto4RqqaF9gcytvCy\nljASVAcjZ71kOsfyfc/joNKNdgPstbiAzFNH2FPGHDQ6G90BhS79/0QoRa+z\nGxoEW9XMzFMUqlKiYPredhtEN386lzcPJ3lVcQCyGgqgzl3eXKmPjRXT+tP3\n54rj7UoYIZ3HWrpZEJcgQuiHTKy1emfOQqkQXGmKhMJki0bsLyoOlrMFCtTY\npmM+ICSppjsDcc8+BWRV2WFo5/61lXpntfuVGedFu53Sd/+U+wgQ9aE5P6uW\n2bwo\r\n=TP30\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIClOR020fSwrpd3gf1uAgTpw/Gkbi0uakVbbdQiwwVvfAiEAxSv0YQL8T24pSJvPbgjFLRZTHqkFsszdKWlCIVL3/Yg="}]},"maintainers":[{"name":"wouterbulten","email":"wouterbulten+npm@mai-ai.org"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/kalmanjs_1.1.0_1547995928862_0.8393958296242083"},"_hasShrinkwrap":false}},"readme":"","maintainers":[{"name":"wouterbulten","email":"wouterbulten+npm@mai-ai.org"}],"time":{"modified":"2022-06-19T07:47:04.082Z","created":"2015-12-02T21:26:08.639Z","1.0.0-beta":"2015-12-02T21:26:08.639Z","1.1.0":"2019-01-20T14:52:09.005Z"},"homepage":"https://github.com/wouterbulten/kalmanjs","keywords":["kalman","filter","math","noise","javascript"],"repository":{"type":"git","url":"git://github.com/wouterbulten/kalmanjs.git"},"author":{"name":"Wouter Bulten","url":"https://wouterbulten.nl"},"bugs":{"url":"https://github.com/wouterbulten/kalmanjs/issues"},"license":"LGPL-3.0","readmeFilename":"","users":{"wkronmiller":true,"ramiroespada":true}}