{"id":24587,"library":"signal-processing-algorithms","title":"Signal Processing Algorithms","description":"A library for signal processing algorithms, originally developed at MongoDB, including peak detection using the 'peak_shapes' algorithm and related utilities. Current version 2.1.6 requires Python <3.12,>=3.11. Maintained by MongoDB.","status":"active","version":"2.1.6","language":"python","source_language":"en","source_url":"https://github.com/mongodb/signal-processing-algorithms","tags":["signal-processing","peak-detection","mongodb"],"install":[{"cmd":"pip install signal-processing-algorithms","lang":"bash","label":"PyPI"}],"dependencies":[{"reason":"Core dependency for array operations","package":"numpy","optional":false},{"reason":"Optional dependency for signal processing","package":"scipy","optional":true}],"imports":[{"note":"peak_shapes is a submodule, not a top-level attribute","wrong":"from signal_processing_algorithms import peak_shapes","symbol":"peak_shapes","correct":"from signal_processing_algorithms.peak_shapes import peak_shapes"},{"note":"Signal class is inside the peak_shapes module","wrong":"import Signal from signal_processing_algorithms","symbol":"Signal","correct":"from signal_processing_algorithms.peak_shapes import Signal"}],"quickstart":{"code":"from signal_processing_algorithms.peak_shapes import peak_shapes\nfrom signal_processing_algorithms.peak_shapes import Signal\nimport numpy as np\n\nsignal = Signal(np.sin(np.linspace(0, 10, 1000)))\nresults = peak_shapes(signal, threshold=0.5)\nprint(results)","lang":"python","description":"Detect peaks in a sine wave using the peak_shapes algorithm."},"warnings":[{"fix":"Use `from signal_processing_algorithms.peak_shapes import peak_shapes`","message":"The import path uses underscores: `signal_processing_algorithms` not `signal-processing-algorithms`. The hyphenated name is only for pip install.","severity":"gotcha","affected_versions":"all"},{"fix":"Use `from signal_processing_algorithms.peak_shapes import find_peaks`","message":"The `peak_shapes` function has been renamed to `find_peaks` in version 2.0.0. The old name still works but may be removed in future.","severity":"deprecated","affected_versions":">=2.0.0"},{"fix":"Convert list to numpy array: `signal = Signal(np.array([...]))`","message":"The `Signal` class requires a numpy array. Passing a list will raise a TypeError.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Replace `import signal-processing-algorithms` with `import signal_processing_algorithms`","cause":"Installed with hyphenated name but imported with hyphen.","error":"ModuleNotFoundError: No module named 'signal_processing_algorithms'"},{"fix":"Use `from signal_processing_algorithms.peak_shapes import peak_shapes`","cause":"Trying to import peak_shapes as a top-level attribute instead of submodule.","error":"AttributeError: module 'signal_processing_algorithms' has no attribute 'peak_shapes'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}