{"id":41714107,"url":"https://github.com/wouterbulten/kalmanjs","last_synced_at":"2026-02-03T23:34:02.253Z","repository":{"id":41526941,"uuid":"43093380","full_name":"wouterbulten/kalmanjs","owner":"wouterbulten","description":"Javascript based Kalman filter for 1D data","archived":false,"fork":false,"pushed_at":"2023-08-01T23:28:07.000Z","size":599,"stargazers_count":440,"open_issues_count":13,"forks_count":80,"subscribers_count":13,"default_branch":"master","last_synced_at":"2025-10-24T05:55:27.549Z","etag":null,"topics":["filter","javascript","javascript-library","kalman-filter","noise","noise-filtering"],"latest_commit_sha":null,"homepage":"https://www.wouterbulten.nl/blog/tech/lightweight-javascript-library-for-noise-filtering/","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/wouterbulten.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2015-09-24T21:13:05.000Z","updated_at":"2025-10-14T18:50:16.000Z","dependencies_parsed_at":"2024-06-18T13:44:44.666Z","dependency_job_id":null,"html_url":"https://github.com/wouterbulten/kalmanjs","commit_stats":{"total_commits":60,"total_committers":9,"mean_commits":6.666666666666667,"dds":0.2666666666666667,"last_synced_commit":"2095f842adbef180b07b92e72adc660fcd0c9310"},"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/wouterbulten/kalmanjs","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wouterbulten%2Fkalmanjs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wouterbulten%2Fkalmanjs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wouterbulten%2Fkalmanjs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wouterbulten%2Fkalmanjs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wouterbulten","download_url":"https://codeload.github.com/wouterbulten/kalmanjs/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wouterbulten%2Fkalmanjs/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29061644,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-03T23:14:54.203Z","status":"ssl_error","status_checked_at":"2026-02-03T23:14:50.873Z","response_time":96,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["filter","javascript","javascript-library","kalman-filter","noise","noise-filtering"],"created_at":"2026-01-24T22:00:33.659Z","updated_at":"2026-02-03T23:34:02.245Z","avatar_url":"https://github.com/wouterbulten.png","language":"Java","readme":"# KalmanJS\n\nJavascript based Kalman filter for 1D data. Sometimes you need a simple noise filter without any dependencies; for those cases *KalmanJS* is perfect.\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\nFor other languages than Javascript, please see the note on the [contrib folder](https://github.com/wouterbulten/kalmanjs#other-languages).\n\n![Kalman filter applied to a noisy dataset.](/resources/kalman-example.png?raw=true \"Kalman filter applied to a noisy dataset.\")\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## Examples\n\nAn collection of examples can be found here: \n\n- A [standalone demo of a simple system](https://benwinding.github.io/kalmanjs-examples/examples/demo1.html) modeled with the filter. ([source code](https://github.com/benwinding/kalmanjs-examples))\n- [Interactive demo](https://benwinding.github.io/kalmanjs-examples/examples/demo2-vue.html) created with VueJs that allows for experimenting with the different settings. ([source code](https://github.com/benwinding/kalmanjs-examples))\n- Please take a look at this [blog post](https://www.wouterbulten.nl/blog/tech/lightweight-javascript-library-for-noise-filtering/) for some examples and explanation of the variables.\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[Try KalmanJS in the browser on Runkit](https://runkit.com/embed/0kyrdew43pyw)\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\u003cscript src=\"kalman.min.js\" type=\"text/javascript\"\u003e\u003c/script\u003e\n\u003cscript type=\"text/javascript\"\u003e\n  var kf = new KalmanFilter();\n  console.log(kf.filter(3));\n  console.log(kf.filter(2));\n  console.log(kf.filter(1));\n\u003c/script\u003e\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\u003e 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](https://github.com/wouterbulten/kalmanjs/tree/master/contrib) 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","funding_links":[],"categories":["Java"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwouterbulten%2Fkalmanjs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwouterbulten%2Fkalmanjs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwouterbulten%2Fkalmanjs/lists"}