saftig


Namesaftig JSON
Version 0.1.1 PyPI version JSON
download
home_pageNone
SummaryImplementations of different static and adaptive filtering techniques for the prediction of a correlated signal component from witness signals.
upload_time2025-07-27 20:58:28
maintainerNone
docs_urlNone
authorNone
requires_pythonNone
licenseNone
keywords prediction filtering wiener filter leastmeansquares noise cancellation
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # saftig – Static & Adaptive Filtering Techniques In Gravitational-wave-research

![Test status](https://github.com/timbk/saftig/actions/workflows/testing.yml/badge.svg)
![Linting status](https://github.com/timbk/saftig/actions/workflows/pylint.yml/badge.svg)
![Static type check status](https://github.com/timbk/saftig/actions/workflows/mypy.yml/badge.svg)

Python implementations of different static and adaptive filtering techniques for the prediction of a correlated signal component from witness signals.
The main goal is to provide a unified interface for the different filtering techniques.

## Features

Static:
* Wiener Filter (WF)

Adaptive
* Updating Wiener Fitler (UWF)
* Least-Mean-Squares Filter (LMS)

Non-Linear:
* Experimental non-linear LMS Filter variant (PolynomialLMS)

## Minimal example

```python
>>> import saftig as sg
>>>
>>> # generate data
>>> n_channel = 2
>>> witness, target = sg.TestDataGenerator([0.1]*n_channel).generate(int(1e5))
>>>
>>> # instantiate the filter and apply it
>>> filt = sg.LMSFilter(n_filter=128, idx_target=0, n_channel=n_channel)
>>> filt.condition(witness, target)
>>> prediction = filt.apply(witness, target) # check on the data used for conditioning
>>>
>>> # success
>>> sg.RMS(target-prediction) / sg.RMS(prediction)
0.08221177645361015
```

## Terminology

* Witness signal w: One or multiple sensors that are used to make a prediction
* Target signal s: The goal for the prediction

## Useful commands
```bash
make # run linter, testing and generate documentation
make test # run just the tests
make view # build and open documentation
make coverage # report test coverage in terminal
make cweb # full test coverage report with html

make ie # install as editable package
make testpublish # build and push to test pypi

# run an individual test
python -m unittest testing.test_wf
```


            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "saftig",
    "maintainer": null,
    "docs_url": null,
    "requires_python": null,
    "maintainer_email": null,
    "keywords": "prediction, filtering, Wiener filter, LeastMeanSquares, noise cancellation",
    "author": null,
    "author_email": "Tim Kuhlbusch <kuhlbusch@physik.rwth-aachen.de>",
    "download_url": "https://files.pythonhosted.org/packages/91/d2/75b7ab10c5ca1993e0ff89f17430a15a406b8fcce9ad0d38d0a6301dd3cf/saftig-0.1.1.tar.gz",
    "platform": null,
    "description": "# saftig \u2013 Static & Adaptive Filtering Techniques In Gravitational-wave-research\n\n![Test status](https://github.com/timbk/saftig/actions/workflows/testing.yml/badge.svg)\n![Linting status](https://github.com/timbk/saftig/actions/workflows/pylint.yml/badge.svg)\n![Static type check status](https://github.com/timbk/saftig/actions/workflows/mypy.yml/badge.svg)\n\nPython implementations of different static and adaptive filtering techniques for the prediction of a correlated signal component from witness signals.\nThe main goal is to provide a unified interface for the different filtering techniques.\n\n## Features\n\nStatic:\n* Wiener Filter (WF)\n\nAdaptive\n* Updating Wiener Fitler (UWF)\n* Least-Mean-Squares Filter (LMS)\n\nNon-Linear:\n* Experimental non-linear LMS Filter variant (PolynomialLMS)\n\n## Minimal example\n\n```python\n>>> import saftig as sg\n>>>\n>>> # generate data\n>>> n_channel = 2\n>>> witness, target = sg.TestDataGenerator([0.1]*n_channel).generate(int(1e5))\n>>>\n>>> # instantiate the filter and apply it\n>>> filt = sg.LMSFilter(n_filter=128, idx_target=0, n_channel=n_channel)\n>>> filt.condition(witness, target)\n>>> prediction = filt.apply(witness, target) # check on the data used for conditioning\n>>>\n>>> # success\n>>> sg.RMS(target-prediction) / sg.RMS(prediction)\n0.08221177645361015\n```\n\n## Terminology\n\n* Witness signal w: One or multiple sensors that are used to make a prediction\n* Target signal s: The goal for the prediction\n\n## Useful commands\n```bash\nmake # run linter, testing and generate documentation\nmake test # run just the tests\nmake view # build and open documentation\nmake coverage # report test coverage in terminal\nmake cweb # full test coverage report with html\n\nmake ie # install as editable package\nmake testpublish # build and push to test pypi\n\n# run an individual test\npython -m unittest testing.test_wf\n```\n\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "Implementations of different static and adaptive filtering techniques for the prediction of a correlated signal component from witness signals.",
    "version": "0.1.1",
    "project_urls": {
        "Repository": "https://github.com/timbk/saftig"
    },
    "split_keywords": [
        "prediction",
        " filtering",
        " wiener filter",
        " leastmeansquares",
        " noise cancellation"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "91d275b7ab10c5ca1993e0ff89f17430a15a406b8fcce9ad0d38d0a6301dd3cf",
                "md5": "420eda15ad46eb2dcf8e66e799de2989",
                "sha256": "415b07e3a8661148149bdea327aeb18fcd42d42494d3e342710d6a1cc9b47cd6"
            },
            "downloads": -1,
            "filename": "saftig-0.1.1.tar.gz",
            "has_sig": false,
            "md5_digest": "420eda15ad46eb2dcf8e66e799de2989",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 38838,
            "upload_time": "2025-07-27T20:58:28",
            "upload_time_iso_8601": "2025-07-27T20:58:28.124303Z",
            "url": "https://files.pythonhosted.org/packages/91/d2/75b7ab10c5ca1993e0ff89f17430a15a406b8fcce9ad0d38d0a6301dd3cf/saftig-0.1.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-07-27 20:58:28",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "timbk",
    "github_project": "saftig",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "saftig"
}
        
Elapsed time: 0.40798s