{"id":15760622,"url":"https://github.com/flrs/hampelfilter","last_synced_at":"2025-10-20T06:04:32.753Z","repository":{"id":201602006,"uuid":"51632659","full_name":"flrs/HampelFilter","owner":"flrs","description":"Arduino library for identifying outliers with a Hampel filter","archived":false,"fork":false,"pushed_at":"2022-01-07T09:01:15.000Z","size":20,"stargazers_count":31,"open_issues_count":0,"forks_count":5,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-10-10T21:27:34.143Z","etag":null,"topics":["arduino","arduino-library","hampel-filter","outlier-detection"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/flrs.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2016-02-13T04:48:21.000Z","updated_at":"2025-05-23T03:52:09.000Z","dependencies_parsed_at":null,"dependency_job_id":"f1814daf-ae5f-4c25-8fb2-275236f6d6a9","html_url":"https://github.com/flrs/HampelFilter","commit_stats":null,"previous_names":["flrs/hampelfilter"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/flrs/HampelFilter","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flrs%2FHampelFilter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flrs%2FHampelFilter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flrs%2FHampelFilter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flrs%2FHampelFilter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/flrs","download_url":"https://codeload.github.com/flrs/HampelFilter/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flrs%2FHampelFilter/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279005657,"owners_count":26083942,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-10T02:00:06.843Z","response_time":62,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["arduino","arduino-library","hampel-filter","outlier-detection"],"created_at":"2024-10-04T10:59:17.735Z","updated_at":"2025-10-11T00:33:25.739Z","avatar_url":"https://github.com/flrs.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"Arduino Hampel Filter Library\n=============================\nThis library helps to identify outliers in data on Arduino.\n\nDescription\n-----------\nThe Hampel filter is a simple but effective filter to find outliers in data. It performs better than a median filter.\n\nThis filter is designed to be used as an Arduino library. As Arduino feeds data points into a buffer, the filter does the following:\n   1. Calculate the median of the values in the buffer\n   2. Determine the deviations of the values in the buffer from the median\n   3. Check what the median of these deviations is\n   4. Multiply this median of deviations with a user-defined threshold value\n   5. Check the threshold against user-defined query values to find out if values are outliers\n\nThe source code contains comments that help understand the behavior of the library further.\n\nUsage\n-----\nThe following code is a simple usage example:\n```arduino\nHampelFilter dataBuffer = HampelFilter(0.00, 3, 3.50);\n\nvoid loop() {\n    dataBuffer.write(24.39);\n    dataBuffer.write(-4.83);\n    dataBuffer.write(2.05);\n\n    if(dataBuffer.checkIfOutlier(6.23)) {\n        Serial.println(\"6.23 is an outlier!\");\n    }\n}\n\n```\n\nThe sample sketch `writeValuesAndFilter.ino` comes with the library and explains how to use it.\n\nDownload\n--------\nAn archive with the library can be downloaded from the [releases page](https://github.com/flrs/HampelFilter/releases).\n\nInstallation\n------------\nTo install the Arduino Hampel Filter library, unzip the downloaded file to the `./Arduino/libraries` folder, so that the path of the `HampelFilter.h` file is similar to `./Arduino/libraries/HampelFilter/HampelFilter.h`. It is important that the files of the library are placed in a folder named `HampelFilter`.\n\nContribution\n------------\nI am happy about any contribution or feedback. Please let me know about your comments via the Issues tab on [GitHub](https://github.com/flrs/HampelFilter/issues).\n\nAcknowledgements\n----------------\nThe initial but almost entirely reworked code for this library comes from improvements of the Arduino RunningMedian library by rkail on the [Arduino Forum](http://forum.arduino.cc/index.php?topic=53081.msg1160999#msg1160999).\n\nThe implementation of the comb sort algorithm was taken from this [Wikibooks article](https://en.wikibooks.org/w/index.php?title=Algorithm_Implementation/Sorting/Comb_sort\u0026oldid=3032443) (checked on 2016-02-11).\n\nThe following freely available documents contain useful information about Hampel filters:\n- http://dimacs.rutgers.edu/Workshops/DataCleaning/slides/pearson2.pdf\n    (checked on 2016-02-11)\n- https://www.seedtest.org/upload/cms/user/presentation2Remund2.pdf\n    (checked on 2016-02-11)\n\nLicense\n-------\nThe Arduino Hampel Filter Library is distributed under a [Simplified BSD License](https://github.com/flrs/HampelFilter/blob/master/LICENSE.md).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fflrs%2Fhampelfilter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fflrs%2Fhampelfilter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fflrs%2Fhampelfilter/lists"}