{"id":30623384,"url":"https://github.com/snhobbs/pulse_transitions","last_synced_at":"2025-08-30T16:14:23.445Z","repository":{"id":293866321,"uuid":"985357080","full_name":"snhobbs/pulse_transitions","owner":"snhobbs","description":"Python implementation of the Matlab Pulse Transitions Library. Useful for step responses, control systems analysis, risetime, overshoot, undershoot, settling time, etc.","archived":false,"fork":false,"pushed_at":"2025-07-28T18:26:49.000Z","size":271,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-08-29T08:24:51.190Z","etag":null,"topics":["control","matlab","octave","pulse","python","signal-processing","signals-and-systems","step-functions","step-response"],"latest_commit_sha":null,"homepage":"https://maskset.net/blog/2025/07/26/pulse-transitions-library/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"lgpl-2.1","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/snhobbs.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,"zenodo":null}},"created_at":"2025-05-17T15:37:37.000Z","updated_at":"2025-07-28T18:53:34.000Z","dependencies_parsed_at":"2025-07-25T01:14:48.484Z","dependency_job_id":"58e58d42-c614-4702-b7a2-ce4d171cd89d","html_url":"https://github.com/snhobbs/pulse_transitions","commit_stats":null,"previous_names":["snhobbs/pulse_transitions"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/snhobbs/pulse_transitions","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/snhobbs%2Fpulse_transitions","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/snhobbs%2Fpulse_transitions/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/snhobbs%2Fpulse_transitions/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/snhobbs%2Fpulse_transitions/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/snhobbs","download_url":"https://codeload.github.com/snhobbs/pulse_transitions/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/snhobbs%2Fpulse_transitions/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":272873547,"owners_count":25007563,"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-08-30T02:00:09.474Z","response_time":77,"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":["control","matlab","octave","pulse","python","signal-processing","signals-and-systems","step-functions","step-response"],"created_at":"2025-08-30T16:14:22.848Z","updated_at":"2025-08-30T16:14:23.437Z","avatar_url":"https://github.com/snhobbs.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# pulse_transitions\nThis library implements a python version of the [Pulse and Transition Metrics function category](https://www.mathworks.com/help/signal/pulse-and-transition-metrics.html?s_tid=CRUX_lftnav) in Matlab.\n\n## Example Use Case\n![Second Order System](second-order.png)\n\nFor the full example see [examples/second_order_system.py](https://github.com/snhobbs/pulse_transitions/examples/second_order_system.py).\n\n```python\nimport numpy as np\nfrom scipy.signal import lsim\nfrom scipy.signal import lti\n\nfrom pulse_transitions import detect_edges\nfrom pulse_transitions import detect_signal_levels\nfrom pulse_transitions import get_edge_metrics\n\n\n# Example: synthetic underdamped step response\ndef generate_step_response(t, damping=0.2, freq=10):\n    # Second-order system parameters\n    wn = freq          # Natural frequency (rad/s)\n    zeta = damping        # Damping ratio\n\n    # Transfer function: H(s) = wn^2 / (s^2 + 2*zeta*wn*s + wn^2)\n    num = [wn**2]\n    den = [1, 2*zeta*wn, wn**2]\n\n    # Create the system\n    system = lti(num, den)\n\n    u = [0]*len(t[t\u003c0]) + [1]*len(t[t\u003e=0])\n    t_shift = t-min(t)\n    t_out, y_out, _ = lsim(system, U=u, T=t_shift)\n\n    return t, y_out\n\n# Generate data\nt = np.linspace(-0.25, 1, 1000)\nt_out, y = generate_step_response(t, freq=25/(max(t)))\n\nthreshold_fractions=(0.1, 0.9)\n\n# Estimate levels (e.g. using histogram or endpoints)\nlevels = detect_signal_levels(x=t, y=y, method=\"histogram\")\nlow, high = levels\n\n# Detect edges\nedge = detect_edges(t, y, levels=levels, thresholds=threshold_fractions)[0]\n\n# Compute overshoot / undershoot\nmetrics = get_edge_metrics(x=t, y=y, thresholds=threshold_fractions, levels=levels)\n```\n\n\n## Installation\n### pypi\n```bash\npip install pulse_transitions\n```\n\n### GitHub Release\n```bash\npip install https://github.com/snhobbs/pulse_transitions/archive/refs/tags/\u003cTAGNAME\u003e.zip\n```\n\n### From Source\n```bash\ngit clone https://github.com/snhobbs/pulse_transitions/\npip install .\n```\n\n\n## Matpulse Functions\n\n| Function                                                                    | Description                                                       |                  | Implemented?\n| --------------------------------------------------------------------------- | ----------------------------------------------------------------- | ---------------- |---------\n| [midcross](https://www.mathworks.com/help/signal/ref/midcross.html)         | Mid-reference level crossing for bilevel waveform                 |                  | ☑️\n| [statelevels](https://www.mathworks.com/help/signal/ref/statelevels.html)   | State-level estimation for bilevel waveform with histogram method |                  | ☑️\n| [falltime](https://www.mathworks.com/help/signal/ref/falltime.html)         | Fall time of negative-going bilevel waveform transitions          |                  | ☑️\n| [overshoot](https://www.mathworks.com/help/signal/ref/overshoot.html)       | Overshoot metrics of bilevel waveform transitions                 |                  | ☑️\n| [risetime](https://www.mathworks.com/help/signal/ref/risetime.html)         | Rise time of positive-going bilevel waveform transitions          |                  | ☑️\n| [settlingtime](https://www.mathworks.com/help/signal/ref/settlingtime.html) | Settling time for bilevel waveform                                |                  | ☑️\n| [slewrate](https://www.mathworks.com/help/signal/ref/slewrate.html)         | Slew rate of bilevel waveform                                     |                  | ☑️\n| [undershoot](https://www.mathworks.com/help/signal/ref/undershoot.html)     | Undershoot metrics of bilevel waveform transitions                |                  | ☑️\n| [dutycycle](https://www.mathworks.com/help/signal/ref/dutycycle.html)       | Duty cycle of pulse waveform                                      |                  | ❌\n| [pulseperiod](https://www.mathworks.com/help/signal/ref/pulseperiod.html)   | Period of bilevel pulse                                           |                  | ❌\n| [pulsesep](https://www.mathworks.com/help/signal/ref/pulsesep.html)         | Separation between bilevel waveform pulses                        |                  | ❌\n| [pulsewidth](https://www.mathworks.com/help/signal/ref/pulsewidth.html)     | Bilevel waveform pulse width                                      |                  | ❌\n\n\n\n## Background \u0026 Resources\n### HP Journal\nThere's an excellent description of the algorithms used by HP [here](https://hparchive.com/Journals/HPJ-1996-12.pdf).\n\n### Control Library\n+ [GitHub](https://github.com/python-control/python-control)\n+ [Docs](https://python-control.readthedocs.io)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsnhobbs%2Fpulse_transitions","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsnhobbs%2Fpulse_transitions","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsnhobbs%2Fpulse_transitions/lists"}