{ "info": { "author": "Igor Gotlibovych", "author_email": "igor.gotlibovych@gmail.com", "bugtrack_url": null, "classifiers": [ "Intended Audience :: Developers", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.6" ], "description": "[![Build Status](https://travis-ci.com/ig248/pyampd.svg?branch=master)](https://travis-ci.com/ig248/pyampd)\n[![Coverage Status](https://codecov.io/gh/ig248/pyampd/branch/master/graph/badge.svg)](https://codecov.io/gh/ig248/pyampdgit)\n\n# AMPD algorithm in Python\nImplements a function `find_peaks` based on the Automatic Multi-scale\nPeak Detection algorithm proposed by Felix Scholkmann et al. in\n\"An Efficient Algorithm for Automatic Peak Detection in\nNoisy Periodic and Quasi-Periodic Signals\", Algorithms 2012,\n 5, 588-603\n\n![Peak finding](https://raw.githubusercontent.com/ig248/pyampd/master/ass_ampd.png)\n\n## Usage\nInstall from PyPI:\n\n```\npip install pyampd\n```\n\nOr install from source:\n\n```\npip install git+https://github.com/ig248/pyampd\n```\n\nImport function:\n\n```python\nfrom pyampd.ampd import find_peaks\n```\n\nSee `notebooks/ampd.ipynb` for usage examples.\n\n### Specifying maximum scale\nTo improve run-time on large time-series, it is possible to specify the maximum scale to consider:\n```python\npeaks = find_peaks(x, scale=100)\n```\nwill only consider windows up to +-100 point either side of peak candidates.\n\n### Adaptive Scale Selection\nIf the characteristic scale of the signal changes over time, a new algorithm called\nAdaptive Scale Selection can track the changes in optimal scales and detect peaks accordingly:\n```python\npeaks = find_peaks_adaptive(x, window=200)\n```\nwill select the optimal scale at each point using a 200-point running window.\n\n\n### Original implementation\n`find_peaks` is not identical to the algorithm proposed in the original paper (especially near start and end of time series).\n A performance-optimized version of the original implementation is provided in `find_peaks_original`.\n\n\n## Tests\nRun\n```bash\npytest\n```\n\n## Other implementations\n- R: https://cran.r-project.org/web/packages/ampd/index.html\n- MATLAB: https://github.com/mathouse/AMPD-algorithm\n- Python: https://github.com/LucaCerina/ampdLib\n\n## Improvements\nThis Python implementation provides significant speed-ups in two areas:\n1. Efficient tracking of local minima without using random numbers\n2. Introduction of maximum window size, reducing algorithm run-time from\nquadratic to linear in the number of samples.\n3. Better handling of peaks near start/end of the series\n4. Addition of new Adaptive Scale Selection \n\n## ToDo\n- It may be possible to avoid repeated comparisons, and reduce worst-case\nruntime from `O(n^2)` to `O(n log(n))`.\n- `find_peaks_adaptive` could benefit from specifying both `window` and `max_scale`\n\n## References\nOriginal paper: https://doi.org/10.1109/ICRERA.2016.7884365\n\n\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/ig248/pyampd", "keywords": "", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "pyampd", "package_url": "https://pypi.org/project/pyampd/", "platform": "", "project_url": "https://pypi.org/project/pyampd/", "project_urls": { "Homepage": "https://github.com/ig248/pyampd" }, "release_url": "https://pypi.org/project/pyampd/0.0.1/", "requires_dist": [ "numpy", "scipy" ], "requires_python": "", "summary": "Peak detection using AMPD and ASS-AMPD algorithms", "version": "0.0.1" }, "last_serial": 4634033, "releases": { "0.0.1": [ { "comment_text": "", "digests": { "md5": "89da3b6ba286573eec3062f713b83c6b", "sha256": "d923a4372308d447b98cd80f935a059e29323777dd26c0ac131945ad84f5f89c" }, "downloads": -1, "filename": "pyampd-0.0.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "89da3b6ba286573eec3062f713b83c6b", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 5106, "upload_time": "2018-12-25T20:25:49", "url": "https://files.pythonhosted.org/packages/53/b5/587d52d43aa803c20743fd23e2bcbb454a06694c5645de741311678c8750/pyampd-0.0.1-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "48da763e6ab7df22347212859589d051", "sha256": "e333d00b61d2844b0ed0383b010394e0a0cb384a036dd83960cdc647cf71a755" }, "downloads": -1, "filename": "pyampd-0.0.1.tar.gz", "has_sig": false, "md5_digest": "48da763e6ab7df22347212859589d051", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4612, "upload_time": "2018-12-25T20:25:52", "url": "https://files.pythonhosted.org/packages/51/97/6a56d7ed7d1ed5cb25c4643cb327a1903438587991fe364ac6042c2b837d/pyampd-0.0.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "89da3b6ba286573eec3062f713b83c6b", "sha256": "d923a4372308d447b98cd80f935a059e29323777dd26c0ac131945ad84f5f89c" }, "downloads": -1, "filename": "pyampd-0.0.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "89da3b6ba286573eec3062f713b83c6b", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 5106, "upload_time": "2018-12-25T20:25:49", "url": "https://files.pythonhosted.org/packages/53/b5/587d52d43aa803c20743fd23e2bcbb454a06694c5645de741311678c8750/pyampd-0.0.1-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "48da763e6ab7df22347212859589d051", "sha256": "e333d00b61d2844b0ed0383b010394e0a0cb384a036dd83960cdc647cf71a755" }, "downloads": -1, "filename": "pyampd-0.0.1.tar.gz", "has_sig": false, "md5_digest": "48da763e6ab7df22347212859589d051", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4612, "upload_time": "2018-12-25T20:25:52", "url": "https://files.pythonhosted.org/packages/51/97/6a56d7ed7d1ed5cb25c4643cb327a1903438587991fe364ac6042c2b837d/pyampd-0.0.1.tar.gz" } ] }