{"id":43225118,"url":"https://github.com/otoolej/envelope_derivative_operator","last_synced_at":"2026-02-01T09:34:33.246Z","repository":{"id":71159294,"uuid":"206546230","full_name":"otoolej/envelope_derivative_operator","owner":"otoolej","description":"Implements a nonlinear energy operator, known as the Envelope Derivative Operator (EDO)","archived":false,"fork":false,"pushed_at":"2019-09-09T15:15:31.000Z","size":5181,"stargazers_count":16,"open_issues_count":0,"forks_count":3,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-01-29T16:55:55.283Z","etag":null,"topics":["energy","frequency-weighted-energy","instantaneous-energy","nleo","nonlinear","nonlinear-energy-operator","python","signal-energy","signal-processing","teager","teager-kaiser"],"latest_commit_sha":null,"homepage":null,"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/otoolej.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":"2019-09-05T11:21:20.000Z","updated_at":"2024-01-03T20:29:30.000Z","dependencies_parsed_at":"2023-02-22T13:15:41.342Z","dependency_job_id":null,"html_url":"https://github.com/otoolej/envelope_derivative_operator","commit_stats":{"total_commits":4,"total_committers":1,"mean_commits":4.0,"dds":0.0,"last_synced_commit":"1b3395f6f36f32084e65d37a2bba5323b18320c0"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/otoolej/envelope_derivative_operator","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/otoolej%2Fenvelope_derivative_operator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/otoolej%2Fenvelope_derivative_operator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/otoolej%2Fenvelope_derivative_operator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/otoolej%2Fenvelope_derivative_operator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/otoolej","download_url":"https://codeload.github.com/otoolej/envelope_derivative_operator/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/otoolej%2Fenvelope_derivative_operator/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28975260,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-01T08:16:14.655Z","status":"ssl_error","status_checked_at":"2026-02-01T08:06:51.373Z","response_time":56,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: 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":["energy","frequency-weighted-energy","instantaneous-energy","nleo","nonlinear","nonlinear-energy-operator","python","signal-energy","signal-processing","teager","teager-kaiser"],"created_at":"2026-02-01T09:34:32.019Z","updated_at":"2026-02-01T09:34:33.239Z","avatar_url":"https://github.com/otoolej.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Estimating Instantaneous Energy \n\nPython code to implement instantaneous energy measures, including the \"envelope derivative\noperator\", as described in [[1]](#references).  Requires the Python 3 with NumPy, Matplotlib,\nand Pandas packages.\n\nThis is Python implementation of the Matlab code, also on [github](https://github.com/otoolej/nonlinear-energy-operators).\n\n\n\n# overview\nImplements methods to estimate frequency-weighted instantaneous energy including the\nTeager–Kaiser operator (also referred to as the nonlinear energy operator) and a similar\nfrequency-weight operator proposed in reference [[1]](#references). The Teager–Kaiser operator is\nsimply defined, for discrete signal x(n), as\n```\nΨ[x(n)] = x²(n) - x(n+1)x(n-1)\n```  \nand the proposed energy measure—which we call the envelope derivative operator (EDO)—is defined as\n```\n Γ[x(n)] = y²(n) + H[y(n)]²\n```\nwhere y(n) is the derivative of x(n), estimated using the central-finite difference\nequation y(n)=[x(n+1)-x(n-1)]/2, and H[·] is the discrete Hilbert transform of x(n). \nReference [[1]](#references) contains more details.\n\n\n# quick start\nUse the `demo.py` to run a few examples from the command line:\n```bash\n$ python3 demo.py\n```\n\n# examples\n\nTest EDO with a random signal:\n```python\n\tfrom energy_operators import edo\n\n\tedo.test_edo_random()\n```\t\n\nGenerates the EDO and the Teager–Kaiser operator for a test signal, the sum of two sinusoidal signals:\n```python\n\timport numpy as np\n\tfrom matplotlib import pyplot as plt\n\n\tfrom energy_operators import general_nleo\n\tfrom energy_operators import edo\n\tfrom test_functions import gen_test_signals\n\tfrom test_functions import test_edo\n\n\n\t# 1. generate test signal composed of 2 sinusoidal signals\n\tN = 256\n\tn = np.arange(N)\n\tw = (np.pi / (N / 32), np.pi / (N / 8))\n\tph = (-np.pi + 2 * np.pi * np.random.rand(1),\n\t\t  -np.pi + 2 * np.pi * np.random.rand(1))\n\ta = (1.3, 3.1)\n\tx = a[0] * np.cos(w[0] * n + ph[0]) + a[1] * np.cos(w[1] * n + ph[1])\n\n\t# 2. estimate the EDO\n\tx_edo = edo.gen_edo(x, True)\n\n\t# 3. generate Teager--Kaiser operator for comparison:\n\tx_nleo = general_nleo.specific_nleo(x, type='teager')\n\n\t# 4. plot\n\tfig, ax = plt.subplots(nrows=2, ncols=1, num=1, clear=True)\n\tax[0].plot(x, '-', label='test signal')\n\tax[1].plot(x_edo, '-', label='EDO')\n\tax[1].plot(x_nleo, label='Teager-Kaiser')\n\tax[0].legend(loc='upper right')\n\tax[1].legend(loc='upper left')\n```\n\n\n## properties\nTo test the properties of the operators with some example signals, call\n`test_edo.compare_edo_test_signals(number)` with argument `number` either '0', '1', '2',\n'3', or '4'. \nFor example, \n```python\n   from test_functions import test_edo\n\n   test_edo.compare_edo_test_signals('3')\n```\ncalls the function with frequency modulated signal with instantaneous frequency law of\n0.1+0.3sin(tπ/N).\n\n\n# files\nDirectory structure as follows: \n```\n.\n├── data                        # csv files for testing with Matlab implementation\n├── docs                        # papers and docs. related to the package\n├── energy_operators            # PACKAGE: modules to generate the energy operators\n│   ├── edo.py             \n│   └── general_nleo.py\n├── LICENSE.md\n├── demo.py                     # script containing examples on how to use this package\n├── README.md\n├── requirements.txt\n└── test_functions              # PACKAGE: modules to generate test signals\n    ├── compare_matlab.py\n    ├── gen_test_signals.py\n    └── test_edo.py\n```\n\n\n# requirements\nDeveloped and tested with Python 3.7. Requires:\n- NumPy version 1.17.0\n- matplotlib version 3.1.1\n- pandas version 0.25.0\n\n---\n\n# licence\n\n```\nCopyright (c) 2019, John O' Toole, University College Cork\nAll rights reserved.\n\nRedistribution and use in source and binary forms, with or without modification,\nare permitted provided that the following conditions are met:\n\n  Redistributions of source code must retain the above copyright notice, this\n  list of conditions and the following disclaimer.\n\n  Redistributions in binary form must reproduce the above copyright notice, this\n  list of conditions and the following disclaimer in the documentation and/or\n  other materials provided with the distribution.\n\n  Neither the name of the University College Cork nor the names of its\n  contributors may be used to endorse or promote products derived from\n  this software without specific prior written permission.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND\nANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\nWARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\nDISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR\nANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\nLOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON\nANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\nSOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n```\n\n\n# references\n\n1. JM O' Toole and NJ Stevenson, “Assessing instantaneous energy in the EEG: a\nnon-negative, frequency-weighted energy operator”, IEEE Int. Conf. on Eng. in Medicine and\nBiology, EMBC’14, Chicago, USA, August 2014. [ [paper](docs/JMOToole_energy_EMBC14.pdf) |\n[poster](docs/EMBC_poster_Aug2014_NLEO.pdf) ]\n\n\n---\n\n# contact\n\nJohn M. O' Toole\n\nNeonatal Brain Research Group,  \nINFANT Research Centre ([INFANT](http://www.infantcentre.ie)),  \nDepartment of Paediatrics and Child Health,  \nUniversity College Cork,  \nCork, Ireland\n\nemail: jotoole -- AT -- ucc .-. DOT ._. ie\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fotoolej%2Fenvelope_derivative_operator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fotoolej%2Fenvelope_derivative_operator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fotoolej%2Fenvelope_derivative_operator/lists"}