{"id":18463704,"url":"https://github.com/alvii147/discretetimelib","last_synced_at":"2026-05-03T18:32:41.030Z","repository":{"id":134303770,"uuid":"416772308","full_name":"alvii147/DiscreteTimeLib","owner":"alvii147","description":"Python library for analysis of discrete time signals and systems","archived":false,"fork":false,"pushed_at":"2022-04-11T22:11:28.000Z","size":6682,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-02T20:38:29.660Z","etag":null,"topics":["numpy","pandas","scipy","signals-and-systems","sympy"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/alvii147.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":"2021-10-13T14:15:25.000Z","updated_at":"2022-01-08T01:28:33.000Z","dependencies_parsed_at":"2023-03-25T20:02:39.161Z","dependency_job_id":null,"html_url":"https://github.com/alvii147/DiscreteTimeLib","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/alvii147/DiscreteTimeLib","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alvii147%2FDiscreteTimeLib","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alvii147%2FDiscreteTimeLib/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alvii147%2FDiscreteTimeLib/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alvii147%2FDiscreteTimeLib/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/alvii147","download_url":"https://codeload.github.com/alvii147/DiscreteTimeLib/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alvii147%2FDiscreteTimeLib/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32579756,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-03T06:36:36.687Z","status":"ssl_error","status_checked_at":"2026-05-03T06:36:09.306Z","response_time":103,"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":["numpy","pandas","scipy","signals-and-systems","sympy"],"created_at":"2024-11-06T09:07:43.862Z","updated_at":"2026-05-03T18:32:41.008Z","avatar_url":"https://github.com/alvii147.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# DiscreteTimeLib\n\n**DiscreteTimeLib** is a Python library for the analysis of discrete-time signals and systems. See [documentation](https://alvii147.github.io/DiscreteTimeLib/build/html/index.html) for more information.\n\n## Overview\n\n### Discrete-Time Signals\n\nThe `DiscreteTimeSignal` class can be used to model a discrete-time signal:\n\n```python\n\u003e\u003e\u003e from DiscreteTimeLib import DiscreteTimeSignal\n\u003e\u003e\u003e import numpy as np\n\u003e\u003e\u003e import matplotlib.pyplot as plt\n```\n\n```python\n\u003e\u003e\u003e data = [\n...     (n, np.sin(x)) for n, x in enumerate(np.linspace(0, 2 * np.pi, num=100))\n... ]\n\u003e\u003e\u003e x_n = DiscreteTimeSignal(data)\n\u003e\u003e\u003e print(x_n)\n            x[n]\n0   0.000000e+00\n1   6.342392e-02\n2   1.265925e-01\n3   1.892512e-01\n4   2.511480e-01\n..           ...\n95 -2.511480e-01\n96 -1.892512e-01\n97 -1.265925e-01\n98 -6.342392e-02\n99 -2.449294e-16\n\n[100 rows x 1 columns]\n```\n\n```python\n\u003e\u003e\u003e markerline, stemlines, baseline = plt.stem(x_n.keys(), x_n.values())\n\u003e\u003e\u003e plt.setp(markerline, 'markerfacecolor', 'salmon')\n\u003e\u003e\u003e plt.setp(markerline, 'markeredgecolor', 'firebrick')\n\u003e\u003e\u003e plt.setp(stemlines, 'color', 'orangered')\n\u003e\u003e\u003e plt.setp(baseline, 'color', 'red')\n\u003e\u003e\u003e plt.show()\n```\n\n![Discrete Time Signal Plot](docs/img/discrete_time_signal_plot.png)\n\n### Convolution\n\n`DiscreteTimeSignal` supports various operations, including **convolution**:\n\n```python\n\u003e\u003e\u003e data = [\n...     (n, np.cos(x)) for n, x in enumerate(np.linspace(0, 2 * np.pi, num=100))\n... ]\n\u003e\u003e\u003e h_n = DiscreteTimeSignal(data)\n\u003e\u003e\u003e y_n = h_n * x_n\n\u003e\u003e\u003e print(y_n)\n             x[n]\n0    0.000000e+00\n1    6.342392e-02\n2    1.898887e-01\n3    3.785025e-01\n4    6.278700e-01\n..            ...\n194 -6.278700e-01\n195 -3.785025e-01\n196 -1.898887e-01\n197 -6.342392e-02\n198 -2.449294e-16\n\n[199 rows x 1 columns]\n```\n\n```python\n\u003e\u003e\u003e markerline, stemlines, baseline = plt.stem(y_n.keys(), y_n.values())\n\u003e\u003e\u003e plt.setp(markerline, 'markerfacecolor', 'lawngreen')\n\u003e\u003e\u003e plt.setp(markerline, 'markeredgecolor', 'olive')\n\u003e\u003e\u003e plt.setp(stemlines, 'color', 'palegreen')\n\u003e\u003e\u003e plt.setp(baseline, 'color', 'green')\n\u003e\u003e\u003e plt.show()\n```\n\n![Convolution Plot](docs/img/convolution_plot.png)\n\n### Filtering\n\nThe `DiscreteTimeSystem` class can be used to model a discrete-time system and apply the system filter on a signal:\n\n```python\n\u003e\u003e\u003e from DiscreteTimeLib import DiscreteTimeSystem\n```\n\n```python\n\u003e\u003e\u003e b = (1,)\n\u003e\u003e\u003e a = (1, -1)\n\u003e\u003e\u003e H = DiscreteTimeSystem(b, a)\n\u003e\u003e\u003e y_n = H.filter(x_n)\n\u003e\u003e\u003e print(y_n)\n            x[n]\n0   0.000000e+00\n1   6.342392e-02\n2   1.900164e-01\n3   3.792676e-01\n4   6.304156e-01\n..           ...\n95  3.792676e-01\n96  1.900164e-01\n97  6.342392e-02\n98  1.665335e-15\n99  1.420405e-15\n\n[100 rows x 1 columns]\n```\n\n```python\n\u003e\u003e\u003e markerline, stemlines, baseline = plt.stem(y_n.keys(), y_n.values())\n\u003e\u003e\u003e plt.setp(markerline, 'markerfacecolor', 'deepskyblue')\n\u003e\u003e\u003e plt.setp(markerline, 'markeredgecolor', 'teal')\n\u003e\u003e\u003e plt.setp(stemlines, 'color', 'turquoise')\n\u003e\u003e\u003e plt.setp(baseline, 'color', 'cyan')\n\u003e\u003e\u003e plt.show()\n```\n\n![Filtered Signal Plot](docs/img/filtered_signal_plot.png)\n\n### Inverse z-transforms\n\nThe `DiscreteTimeSystem` class can also compute the **inverse z-transform** in the form of a [Sympy](https://www.sympy.org/) expression:\n\n```python\n\u003e\u003e\u003e h_n, n = H.iztrans()\n\u003e\u003e\u003e print(h_n)\n1.0*Heaviside(n, 1)\n```\n\n## Installation\n\nClone the repository:\n\n```\ngit clone https://github.com/alvii147/DiscreteTimeLib.git\n```\n\nInstall dependencies:\n\n```\ncd DiscreteTimeLib/\npip3 install -r requirements.txt\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falvii147%2Fdiscretetimelib","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falvii147%2Fdiscretetimelib","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falvii147%2Fdiscretetimelib/lists"}