├── .nojekyll ├── docs ├── .nojekyll ├── html │ ├── .nojekyll │ ├── _sources │ │ ├── filter.rst.txt │ │ ├── misc.rst.txt │ │ ├── linalg.rst.txt │ │ ├── plt.rst.txt │ │ ├── features.rst.txt │ │ ├── fft.rst.txt │ │ ├── signal.rst.txt │ │ ├── bearing.rst.txt │ │ ├── acoustics.rst.txt │ │ ├── diagnose.rst.txt │ │ ├── stats.rst.txt │ │ ├── particlefilter.rst.txt │ │ ├── index.rst.txt │ │ ├── publications.rst.txt │ │ └── gettingstarted.rst.txt │ ├── objects.inv │ ├── _static │ │ ├── file.png │ │ ├── minus.png │ │ ├── plus.png │ │ ├── css │ │ │ ├── fonts │ │ │ │ ├── lato-bold.woff │ │ │ │ ├── lato-bold.woff2 │ │ │ │ ├── lato-normal.woff │ │ │ │ ├── lato-normal.woff2 │ │ │ │ ├── Roboto-Slab-Bold.woff │ │ │ │ ├── Roboto-Slab-Bold.woff2 │ │ │ │ ├── lato-bold-italic.woff │ │ │ │ ├── lato-bold-italic.woff2 │ │ │ │ ├── Roboto-Slab-Regular.woff │ │ │ │ ├── Roboto-Slab-Regular.woff2 │ │ │ │ ├── fontawesome-webfont.eot │ │ │ │ ├── fontawesome-webfont.ttf │ │ │ │ ├── fontawesome-webfont.woff │ │ │ │ ├── fontawesome-webfont.woff2 │ │ │ │ ├── lato-normal-italic.woff │ │ │ │ └── lato-normal-italic.woff2 │ │ │ └── badge_only.css │ │ ├── documentation_options.js │ │ ├── js │ │ │ ├── badge_only.js │ │ │ ├── html5shiv.min.js │ │ │ ├── html5shiv-printshiv.min.js │ │ │ └── theme.js │ │ ├── pygments.css │ │ ├── doctools.js │ │ └── language_data.js │ ├── .buildinfo │ ├── search.html │ ├── misc.html │ ├── acoustics.html │ ├── linalg.html │ ├── index.html │ ├── py-modindex.html │ ├── fft.html │ └── publications.html ├── CNAME ├── _config.yml ├── filter.rst ├── misc.rst ├── fft.rst ├── linalg.rst ├── plt.rst ├── bearing.rst ├── features.rst ├── signal.rst ├── diagnose.rst ├── stats.rst ├── acoustics.rst ├── particlefilter.rst ├── doctrees │ ├── fft.doctree │ ├── plt.doctree │ ├── filter.doctree │ ├── index.doctree │ ├── linalg.doctree │ ├── misc.doctree │ ├── signal.doctree │ ├── stats.doctree │ ├── bearing.doctree │ ├── diagnose.doctree │ ├── features.doctree │ ├── acoustics.doctree │ ├── environment.pickle │ ├── publications.doctree │ ├── gettingstarted.doctree │ └── particlefilter.doctree ├── index.html ├── requirements.txt ├── thesis.bib ├── index.rst ├── datasets.bib ├── Makefile ├── make.bat ├── publications.rst ├── gettingstarted.rst ├── publications.bib └── conf.py ├── CNAME ├── .gitignore ├── requirements.txt ├── README.md ├── pyvib ├── acoustics.py ├── __init__.py ├── misc.py ├── linalg.py ├── fft.py ├── bearing.py ├── stats.py ├── diagnose.py ├── ParticleFilter.py └── filter.py ├── setup.py ├── LICENSE ├── .github └── workflows │ └── default.yml └── examples └── diagnosis.py /.nojekyll: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /docs/.nojekyll: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /docs/html/.nojekyll: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /CNAME: -------------------------------------------------------------------------------- 1 | vibpy.motiontech.no -------------------------------------------------------------------------------- /docs/CNAME: -------------------------------------------------------------------------------- 1 | vibpy.motiontech.no -------------------------------------------------------------------------------- /docs/_config.yml: -------------------------------------------------------------------------------- 1 | theme: jekyll-theme-cayman -------------------------------------------------------------------------------- /docs/filter.rst: -------------------------------------------------------------------------------- 1 | Filters 2 | ======= 3 | 4 | .. automodule:: pyvib.filter 5 | :members: 6 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .vscode/* 2 | __pycache__/* 3 | pyvib/__pycache__* 4 | *.nc 5 | build* 6 | pyvib.egg-info* -------------------------------------------------------------------------------- /docs/misc.rst: -------------------------------------------------------------------------------- 1 | Miscellaneous 2 | ============= 3 | 4 | .. automodule:: pyvib.misc 5 | :members: 6 | -------------------------------------------------------------------------------- /docs/fft.rst: -------------------------------------------------------------------------------- 1 | Fourier transforms 2 | ================== 3 | 4 | .. automodule:: pyvib.fft 5 | :members: 6 | -------------------------------------------------------------------------------- /docs/html/_sources/filter.rst.txt: -------------------------------------------------------------------------------- 1 | Filters 2 | ======= 3 | 4 | .. automodule:: pyvib.filter 5 | :members: 6 | -------------------------------------------------------------------------------- /docs/linalg.rst: -------------------------------------------------------------------------------- 1 | Linear algebra 2 | ============== 3 | 4 | .. automodule:: pyvib.linalg 5 | :members: 6 | -------------------------------------------------------------------------------- /docs/plt.rst: -------------------------------------------------------------------------------- 1 | Plotting funtions 2 | ================= 3 | 4 | .. automodule:: pyvib.plt 5 | :members: 6 | -------------------------------------------------------------------------------- /docs/bearing.rst: -------------------------------------------------------------------------------- 1 | Bearing functions 2 | ================= 3 | 4 | .. automodule:: pyvib.bearing 5 | :members: 6 | -------------------------------------------------------------------------------- /docs/features.rst: -------------------------------------------------------------------------------- 1 | Signal features 2 | =============== 3 | 4 | .. automodule:: pyvib.features 5 | :members: 6 | -------------------------------------------------------------------------------- /docs/signal.rst: -------------------------------------------------------------------------------- 1 | Signal processing 2 | ================= 3 | 4 | .. automodule:: pyvib.signal 5 | :members: 6 | -------------------------------------------------------------------------------- /docs/diagnose.rst: -------------------------------------------------------------------------------- 1 | Diagnose functions 2 | ================== 3 | 4 | .. automodule:: pyvib.diagnose 5 | :members: 6 | -------------------------------------------------------------------------------- /docs/html/_sources/misc.rst.txt: -------------------------------------------------------------------------------- 1 | Miscellaneous 2 | ============= 3 | 4 | .. automodule:: pyvib.misc 5 | :members: 6 | -------------------------------------------------------------------------------- /docs/stats.rst: -------------------------------------------------------------------------------- 1 | Statistical functions 2 | ===================== 3 | 4 | .. automodule:: pyvib.stats 5 | :members: 6 | -------------------------------------------------------------------------------- /docs/acoustics.rst: -------------------------------------------------------------------------------- 1 | Acoustics functions 2 | =================== 3 | 4 | .. automodule:: pyvib.acoustics 5 | :members: 6 | -------------------------------------------------------------------------------- /docs/html/_sources/linalg.rst.txt: -------------------------------------------------------------------------------- 1 | Linear algebra 2 | ============== 3 | 4 | .. automodule:: pyvib.linalg 5 | :members: 6 | -------------------------------------------------------------------------------- /docs/html/_sources/plt.rst.txt: -------------------------------------------------------------------------------- 1 | Plotting funtions 2 | ================= 3 | 4 | .. automodule:: pyvib.plt 5 | :members: 6 | -------------------------------------------------------------------------------- /docs/html/objects.inv: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andrek10/bearing-vibration-diagnostics-toolbox/HEAD/docs/html/objects.inv -------------------------------------------------------------------------------- /docs/particlefilter.rst: -------------------------------------------------------------------------------- 1 | Particle filter 2 | =============== 3 | 4 | .. automodule:: pyvib.ParticleFilter 5 | :members: 6 | -------------------------------------------------------------------------------- /docs/doctrees/fft.doctree: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andrek10/bearing-vibration-diagnostics-toolbox/HEAD/docs/doctrees/fft.doctree -------------------------------------------------------------------------------- /docs/doctrees/plt.doctree: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andrek10/bearing-vibration-diagnostics-toolbox/HEAD/docs/doctrees/plt.doctree -------------------------------------------------------------------------------- /docs/html/_sources/features.rst.txt: -------------------------------------------------------------------------------- 1 | Signal features 2 | =============== 3 | 4 | .. automodule:: pyvib.features 5 | :members: 6 | -------------------------------------------------------------------------------- /docs/html/_sources/fft.rst.txt: -------------------------------------------------------------------------------- 1 | Fourier transforms 2 | ================== 3 | 4 | .. automodule:: pyvib.fft 5 | :members: 6 | -------------------------------------------------------------------------------- /docs/html/_sources/signal.rst.txt: -------------------------------------------------------------------------------- 1 | Signal processing 2 | ================= 3 | 4 | .. automodule:: pyvib.signal 5 | :members: 6 | -------------------------------------------------------------------------------- /docs/doctrees/filter.doctree: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andrek10/bearing-vibration-diagnostics-toolbox/HEAD/docs/doctrees/filter.doctree -------------------------------------------------------------------------------- /docs/doctrees/index.doctree: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andrek10/bearing-vibration-diagnostics-toolbox/HEAD/docs/doctrees/index.doctree -------------------------------------------------------------------------------- /docs/doctrees/linalg.doctree: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andrek10/bearing-vibration-diagnostics-toolbox/HEAD/docs/doctrees/linalg.doctree -------------------------------------------------------------------------------- /docs/doctrees/misc.doctree: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andrek10/bearing-vibration-diagnostics-toolbox/HEAD/docs/doctrees/misc.doctree -------------------------------------------------------------------------------- /docs/doctrees/signal.doctree: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andrek10/bearing-vibration-diagnostics-toolbox/HEAD/docs/doctrees/signal.doctree -------------------------------------------------------------------------------- /docs/doctrees/stats.doctree: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andrek10/bearing-vibration-diagnostics-toolbox/HEAD/docs/doctrees/stats.doctree -------------------------------------------------------------------------------- /docs/html/_sources/bearing.rst.txt: -------------------------------------------------------------------------------- 1 | Bearing functions 2 | ================= 3 | 4 | .. automodule:: pyvib.bearing 5 | :members: 6 | -------------------------------------------------------------------------------- /docs/html/_static/file.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andrek10/bearing-vibration-diagnostics-toolbox/HEAD/docs/html/_static/file.png -------------------------------------------------------------------------------- /docs/html/_static/minus.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andrek10/bearing-vibration-diagnostics-toolbox/HEAD/docs/html/_static/minus.png -------------------------------------------------------------------------------- /docs/html/_static/plus.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andrek10/bearing-vibration-diagnostics-toolbox/HEAD/docs/html/_static/plus.png -------------------------------------------------------------------------------- /docs/doctrees/bearing.doctree: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andrek10/bearing-vibration-diagnostics-toolbox/HEAD/docs/doctrees/bearing.doctree -------------------------------------------------------------------------------- /docs/doctrees/diagnose.doctree: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andrek10/bearing-vibration-diagnostics-toolbox/HEAD/docs/doctrees/diagnose.doctree -------------------------------------------------------------------------------- /docs/doctrees/features.doctree: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andrek10/bearing-vibration-diagnostics-toolbox/HEAD/docs/doctrees/features.doctree -------------------------------------------------------------------------------- /docs/html/_sources/acoustics.rst.txt: -------------------------------------------------------------------------------- 1 | Acoustics functions 2 | =================== 3 | 4 | .. automodule:: pyvib.acoustics 5 | :members: 6 | -------------------------------------------------------------------------------- /docs/html/_sources/diagnose.rst.txt: -------------------------------------------------------------------------------- 1 | Diagnose functions 2 | ================== 3 | 4 | .. automodule:: pyvib.diagnose 5 | :members: 6 | -------------------------------------------------------------------------------- /docs/html/_sources/stats.rst.txt: -------------------------------------------------------------------------------- 1 | Statistical functions 2 | ===================== 3 | 4 | .. automodule:: pyvib.stats 5 | :members: 6 | -------------------------------------------------------------------------------- /docs/index.html: -------------------------------------------------------------------------------- 1 | 2 |
3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /docs/doctrees/acoustics.doctree: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andrek10/bearing-vibration-diagnostics-toolbox/HEAD/docs/doctrees/acoustics.doctree -------------------------------------------------------------------------------- /docs/doctrees/environment.pickle: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andrek10/bearing-vibration-diagnostics-toolbox/HEAD/docs/doctrees/environment.pickle -------------------------------------------------------------------------------- /docs/html/_sources/particlefilter.rst.txt: -------------------------------------------------------------------------------- 1 | Particle filter 2 | =============== 3 | 4 | .. automodule:: pyvib.ParticleFilter 5 | :members: 6 | -------------------------------------------------------------------------------- /docs/doctrees/publications.doctree: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andrek10/bearing-vibration-diagnostics-toolbox/HEAD/docs/doctrees/publications.doctree -------------------------------------------------------------------------------- /docs/doctrees/gettingstarted.doctree: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andrek10/bearing-vibration-diagnostics-toolbox/HEAD/docs/doctrees/gettingstarted.doctree -------------------------------------------------------------------------------- /docs/doctrees/particlefilter.doctree: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andrek10/bearing-vibration-diagnostics-toolbox/HEAD/docs/doctrees/particlefilter.doctree -------------------------------------------------------------------------------- /docs/html/_static/css/fonts/lato-bold.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andrek10/bearing-vibration-diagnostics-toolbox/HEAD/docs/html/_static/css/fonts/lato-bold.woff -------------------------------------------------------------------------------- /docs/html/_static/css/fonts/lato-bold.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andrek10/bearing-vibration-diagnostics-toolbox/HEAD/docs/html/_static/css/fonts/lato-bold.woff2 -------------------------------------------------------------------------------- /docs/html/_static/css/fonts/lato-normal.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andrek10/bearing-vibration-diagnostics-toolbox/HEAD/docs/html/_static/css/fonts/lato-normal.woff -------------------------------------------------------------------------------- /docs/html/_static/css/fonts/lato-normal.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andrek10/bearing-vibration-diagnostics-toolbox/HEAD/docs/html/_static/css/fonts/lato-normal.woff2 -------------------------------------------------------------------------------- /docs/html/_static/css/fonts/Roboto-Slab-Bold.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andrek10/bearing-vibration-diagnostics-toolbox/HEAD/docs/html/_static/css/fonts/Roboto-Slab-Bold.woff -------------------------------------------------------------------------------- /docs/html/_static/css/fonts/Roboto-Slab-Bold.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andrek10/bearing-vibration-diagnostics-toolbox/HEAD/docs/html/_static/css/fonts/Roboto-Slab-Bold.woff2 -------------------------------------------------------------------------------- /docs/html/_static/css/fonts/lato-bold-italic.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andrek10/bearing-vibration-diagnostics-toolbox/HEAD/docs/html/_static/css/fonts/lato-bold-italic.woff -------------------------------------------------------------------------------- /docs/html/_static/css/fonts/lato-bold-italic.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andrek10/bearing-vibration-diagnostics-toolbox/HEAD/docs/html/_static/css/fonts/lato-bold-italic.woff2 -------------------------------------------------------------------------------- /docs/html/_static/css/fonts/Roboto-Slab-Regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andrek10/bearing-vibration-diagnostics-toolbox/HEAD/docs/html/_static/css/fonts/Roboto-Slab-Regular.woff -------------------------------------------------------------------------------- /docs/html/_static/css/fonts/Roboto-Slab-Regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andrek10/bearing-vibration-diagnostics-toolbox/HEAD/docs/html/_static/css/fonts/Roboto-Slab-Regular.woff2 -------------------------------------------------------------------------------- /docs/html/_static/css/fonts/fontawesome-webfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andrek10/bearing-vibration-diagnostics-toolbox/HEAD/docs/html/_static/css/fonts/fontawesome-webfont.eot -------------------------------------------------------------------------------- /docs/html/_static/css/fonts/fontawesome-webfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andrek10/bearing-vibration-diagnostics-toolbox/HEAD/docs/html/_static/css/fonts/fontawesome-webfont.ttf -------------------------------------------------------------------------------- /docs/html/_static/css/fonts/fontawesome-webfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andrek10/bearing-vibration-diagnostics-toolbox/HEAD/docs/html/_static/css/fonts/fontawesome-webfont.woff -------------------------------------------------------------------------------- /docs/html/_static/css/fonts/fontawesome-webfont.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andrek10/bearing-vibration-diagnostics-toolbox/HEAD/docs/html/_static/css/fonts/fontawesome-webfont.woff2 -------------------------------------------------------------------------------- /docs/html/_static/css/fonts/lato-normal-italic.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andrek10/bearing-vibration-diagnostics-toolbox/HEAD/docs/html/_static/css/fonts/lato-normal-italic.woff -------------------------------------------------------------------------------- /docs/html/_static/css/fonts/lato-normal-italic.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andrek10/bearing-vibration-diagnostics-toolbox/HEAD/docs/html/_static/css/fonts/lato-normal-italic.woff2 -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- 1 | numpy>=1.17.0 2 | pyfftw>=0.12.0 3 | numba>=0.54.1 4 | scipy>=1.7.3 5 | scikit-learn>=1.0.1 6 | pandas>=1.3.4 7 | matplotlib>=3.5.0 8 | psutil>=5.8.0 9 | netcdf4>=1.5.8 10 | -------------------------------------------------------------------------------- /docs/html/.buildinfo: -------------------------------------------------------------------------------- 1 | # Sphinx build info version 1 2 | # This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done. 3 | config: 58de792574db530f7a0c38bc26179d4d 4 | tags: 645f666f9bcd5a90fca523b33c5a78b7 5 | -------------------------------------------------------------------------------- /docs/requirements.txt: -------------------------------------------------------------------------------- 1 | numpy 2 | pyfftw 3 | numba 4 | scipy 5 | scikit-learn 6 | pandas 7 | matplotlib 8 | psutil 9 | recommonmark 10 | sphinx>=4.5.0 11 | sphinx-rtd-theme 12 | sphinxcontrib-bibtex 13 | sphinx-autobuild 14 | rstcheck 15 | sphinx-autodoc-typehints 16 | numpydoc 17 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # VibPy 2 | 3 | Vibration analysis toolbox in Python for bearing fault diagnostics. 4 | 5 | VibPy is a Python module created during my PhD in Mechatronics at the University of Agder in Grimstad, Norway. 6 | 7 | The documentation for installation and usage are [here: vibpy.motiontech.no](https://vibpy.motiontech.no). 8 | -------------------------------------------------------------------------------- /docs/thesis.bib: -------------------------------------------------------------------------------- 1 | @article{andreas2019condition, 2 | author = {Klausen, Andreas}, 3 | title = {{Condition monitoring of rolling element bearings during low and variable speed conditions}}, 4 | journal = {Ph. D. thesis, University of Agder}, 5 | year = {2019}, 6 | publisher = {University of Agder}, 7 | keywords={thesis} 8 | } -------------------------------------------------------------------------------- /docs/html/_static/documentation_options.js: -------------------------------------------------------------------------------- 1 | var DOCUMENTATION_OPTIONS = { 2 | URL_ROOT: document.getElementById("documentation_options").getAttribute('data-url_root'), 3 | VERSION: '1.0', 4 | LANGUAGE: 'None', 5 | COLLAPSE_INDEX: false, 6 | BUILDER: 'html', 7 | FILE_SUFFIX: '.html', 8 | LINK_SUFFIX: '.html', 9 | HAS_SOURCE: true, 10 | SOURCELINK_SUFFIX: '.txt', 11 | NAVIGATION_WITH_KEYS: false 12 | }; -------------------------------------------------------------------------------- /docs/index.rst: -------------------------------------------------------------------------------- 1 | Welcome to VibPy's documentation! 2 | ================================= 3 | 4 | Indices and tables 5 | ================== 6 | * :ref:`genindex` 7 | * :ref:`modindex` 8 | * :ref:`search` 9 | 10 | .. toctree:: 11 | :maxdepth: 1 12 | :caption: Contents: 13 | 14 | gettingstarted 15 | signal 16 | fft 17 | filter 18 | features 19 | bearing 20 | plt 21 | diagnose 22 | linalg 23 | stats 24 | particlefilter 25 | acoustics 26 | misc 27 | publications 28 | -------------------------------------------------------------------------------- /docs/html/_sources/index.rst.txt: -------------------------------------------------------------------------------- 1 | Welcome to VibPy's documentation! 2 | ================================= 3 | 4 | Indices and tables 5 | ================== 6 | * :ref:`genindex` 7 | * :ref:`modindex` 8 | * :ref:`search` 9 | 10 | .. toctree:: 11 | :maxdepth: 1 12 | :caption: Contents: 13 | 14 | gettingstarted 15 | signal 16 | fft 17 | filter 18 | features 19 | bearing 20 | plt 21 | diagnose 22 | linalg 23 | stats 24 | particlefilter 25 | acoustics 26 | misc 27 | publications 28 | -------------------------------------------------------------------------------- /pyvib/acoustics.py: -------------------------------------------------------------------------------- 1 | """ 2 | Functions related to acoustics 3 | """ 4 | 5 | import numpy as np 6 | import pyfftw 7 | 8 | from .fft import rawfft, rawifft 9 | 10 | pyfftw.interfaces.cache.enable() 11 | 12 | def cepstrum(x): 13 | """ 14 | Get cepstrum of a signal 15 | 16 | Parameters 17 | ---------- 18 | x : float 1D array 19 | Signal 20 | 21 | Returns 22 | ------- 23 | xc : float 1D array 24 | Cepstrum of the signal 25 | 26 | """ 27 | 28 | return np.abs( rawifft( np.log( np.abs( rawfft(x) )**2.0 ) ) )**2.0 29 | -------------------------------------------------------------------------------- /docs/datasets.bib: -------------------------------------------------------------------------------- 1 | @article{NZJOIS_2021, 2 | author = {Andreas Klausen}, 3 | journal = {DataverseNO}, 4 | title = {{UiA Accelerated Life Time Bearing Test Rig – Test 3, Variable speed around 50rpm}}, 5 | year = {2021}, 6 | version = {DRAFT VERSION}, 7 | doi = {10.18710/NZJOIS}, 8 | url = {https://doi.org/10.18710/NZJOIS} 9 | } 10 | 11 | @article{BG1QNG_2020, 12 | author = {Klausen, Andreas}, 13 | journal = {DataverseNO}, 14 | title = {{UiA Accelerated Life Time Bearing Test Rig – Test 1, 250 rpm}}, 15 | year = {2020}, 16 | version = {DRAFT VERSION}, 17 | doi = {10.18710/BG1QNG}, 18 | url = {https://doi.org/10.18710/BG1QNG} 19 | } 20 | -------------------------------------------------------------------------------- /docs/Makefile: -------------------------------------------------------------------------------- 1 | # Minimal makefile for Sphinx documentation 2 | # 3 | 4 | # You can set these variables from the command line. 5 | SPHINXOPTS = 6 | SPHINXBUILD = sphinx-build 7 | SOURCEDIR = . 8 | BUILDDIR = . 9 | 10 | # Put it first so that "make" without argument is like "make help". 11 | help: 12 | @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) 13 | 14 | .PHONY: help Makefile 15 | 16 | # Catch-all target: route all unknown targets to Sphinx using the new 17 | # "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). 18 | %: Makefile 19 | @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) -------------------------------------------------------------------------------- /pyvib/__init__.py: -------------------------------------------------------------------------------- 1 | # ./__init__.py 2 | import sys 3 | 4 | from . import acoustics as acoustics 5 | from . import bearing as bearing 6 | from . import diagnose as diagnose 7 | from . import fft as fft 8 | from . import filter as filter 9 | from . import linalg as linalg 10 | from . import misc as misc 11 | from . import plt as plt 12 | from . import signal as signal 13 | from . import stats as stats 14 | from . import ParticleFilter as ParticleFilter 15 | from . import features as features 16 | 17 | def set_seed(seed=None): 18 | for element in [acoustics, bearing, diagnose, fft, 19 | filter, linalg, misc, plt, signal, stats, 20 | ParticleFilter, features]: 21 | element.np.random.seed(seed) 22 | -------------------------------------------------------------------------------- /setup.py: -------------------------------------------------------------------------------- 1 | from setuptools import setup, find_packages 2 | 3 | setup( 4 | name='pyvib', 5 | version='1.0.0', 6 | author='Andreas Klausen', 7 | author_email='andreas.klausen@motiontech.no', 8 | packages=find_packages(), 9 | entry_points={ 10 | }, 11 | scripts=[ 12 | ], 13 | url='https://github.com/andrek10/bearing-vibration-diagnostics-toolbox', 14 | license='LICENSE.md', 15 | description='PyVib Python Library', 16 | install_requires=[ 17 | 'numpy>=1.17.0', 18 | 'pyfftw>=0.12.0', 19 | 'numba>=0.54.1', 20 | 'scipy>=1.7.3', 21 | 'scikit-learn>=1.0.1', 22 | 'pandas>=1.3.4', 23 | 'matplotlib>=3.5.0', 24 | 'psutil>=5.8.0', 25 | 'netcdf4>=1.5.8' 26 | ], 27 | ) 28 | -------------------------------------------------------------------------------- /docs/make.bat: -------------------------------------------------------------------------------- 1 | @ECHO OFF 2 | 3 | pushd %~dp0 4 | 5 | REM Command file for Sphinx documentation 6 | 7 | if "%SPHINXBUILD%" == "" ( 8 | set SPHINXBUILD=sphinx-build 9 | ) 10 | set SOURCEDIR=. 11 | set BUILDDIR=. 12 | 13 | if "%1" == "" goto help 14 | 15 | %SPHINXBUILD% >NUL 2>NUL 16 | if errorlevel 9009 ( 17 | echo. 18 | echo.The 'sphinx-build' command was not found. Make sure you have Sphinx 19 | echo.installed, then set the SPHINXBUILD environment variable to point 20 | echo.to the full path of the 'sphinx-build' executable. Alternatively you 21 | echo.may add the Sphinx directory to PATH. 22 | echo. 23 | echo.If you don't have Sphinx installed, grab it from 24 | echo.http://sphinx-doc.org/ 25 | exit /b 1 26 | ) 27 | 28 | %SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% 29 | goto end 30 | 31 | :help 32 | %SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% 33 | 34 | :end 35 | popd 36 | -------------------------------------------------------------------------------- /docs/html/_static/js/badge_only.js: -------------------------------------------------------------------------------- 1 | !function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=4)}({4:function(e,t,r){}}); -------------------------------------------------------------------------------- /docs/publications.rst: -------------------------------------------------------------------------------- 1 | Publications 2 | ============ 3 | 4 | Thesis 5 | ------ 6 | 7 | The pyvib module was built during my PhD education at University of Agder, Grimstad, Norway. 8 | Because of the open-source community, I was able to produce most of my thesis with LaTeX, Inkscape and most importantly Python. 9 | In addition, the PhD thesis was funded by the public: Ministry of Education in Norway. 10 | In this spirit, I release the pyvib module to the public. 11 | 12 | `Here is a link to download the Thesismisc
89 |Determine all prime factors for the input number
93 |number (int) – Number to get prime factors of
96 |factors – Prime factors
99 |1D array of int
102 |Functions related to acoustics
89 |93 |95 |Get cepstrum of a signal
94 |
Signal
99 |Cepstrum of the signal
105 |Linear algebra
89 |Estimate the i’th singular value composition using the diagonal mean sum
93 |U (array 2D float) –
sigma (array 1D float) – The singular values
V (array 2D float) –
i (int) – The i’th singular value to recompose. 0 < i < Sigma.size
Contents:
97 || 95 | p | ||
| 99 | |
100 | pyvib | 101 | |
| 104 | |
105 | pyvib.acoustics | 106 | |
| 109 | |
110 | pyvib.bearing | 111 | |
| 114 | |
115 | pyvib.diagnose | 116 | |
| 119 | |
120 | pyvib.features | 121 | |
| 124 | |
125 | pyvib.fft | 126 | |
| 129 | |
130 | pyvib.filter | 131 | |
| 134 | |
135 | pyvib.linalg | 136 | |
| 139 | |
140 | pyvib.misc | 141 | |
| 144 | |
145 | pyvib.ParticleFilter | 146 | |
| 149 | |
150 | pyvib.plt | 151 | |
| 154 | |
155 | pyvib.signal | 156 | |
| 159 | |
160 | pyvib.stats | 161 | |
FFT related functions
89 |The scaled amplitude frequency spectrum
93 |y (float 1D array) – Signal you want FFT of.
Fs (float) – Sampling frequency
Detrend (string, optional) – Detrends the signal using scipy.signal.detrend 99 | - ‘constant’ to remove mean value 100 | - ‘linear’ to remove least squares fit 101 | - ‘none’ to do nothing
hann (bool, optional) – Add a hanning window if true.
cons (bool, optional) –
Whether conservative part of the spectrum should be returned:
104 |True returns Fs/2.56
False returns Fs/2.0
Y (float 1D array) – FFT amplitude
df (float) – Delta frequency
Raw FFT of the signal.
125 |y (float 1D array) – Signal to get spectrum of
Fs (float) – Sampling frequency in Hz
Y (float 1D array) – Spectrum values
df (float) – Delta frequency in Hz
Raw inverse FFT
146 |Y (float 1D array) – Spectrum to inverse
149 |y – Time domain signal
152 |float 1D array
155 |' + _('Hide Search Matches') + '
') 239 | .appendTo($('#searchbox')); 240 | } 241 | }, 242 | 243 | /** 244 | * init the domain index toggle buttons 245 | */ 246 | initIndexTable : function() { 247 | var togglers = $('img.toggler').click(function() { 248 | var src = $(this).attr('src'); 249 | var idnum = $(this).attr('id').substr(7); 250 | $('tr.cg-' + idnum).toggle(); 251 | if (src.substr(-9) === 'minus.png') 252 | $(this).attr('src', src.substr(0, src.length-9) + 'plus.png'); 253 | else 254 | $(this).attr('src', src.substr(0, src.length-8) + 'minus.png'); 255 | }).css('display', ''); 256 | if (DOCUMENTATION_OPTIONS.COLLAPSE_INDEX) { 257 | togglers.click(); 258 | } 259 | }, 260 | 261 | /** 262 | * helper function to hide the search marks again 263 | */ 264 | hideSearchWords : function() { 265 | $('#searchbox .highlight-link').fadeOut(300); 266 | $('span.highlighted').removeClass('highlighted'); 267 | }, 268 | 269 | /** 270 | * make the url absolute 271 | */ 272 | makeURL : function(relativeURL) { 273 | return DOCUMENTATION_OPTIONS.URL_ROOT + '/' + relativeURL; 274 | }, 275 | 276 | /** 277 | * get the current relative url 278 | */ 279 | getCurrentURL : function() { 280 | var path = document.location.pathname; 281 | var parts = path.split(/\//); 282 | $.each(DOCUMENTATION_OPTIONS.URL_ROOT.split(/\//), function() { 283 | if (this === '..') 284 | parts.pop(); 285 | }); 286 | var url = parts.join('/'); 287 | return path.substring(url.lastIndexOf('/') + 1, path.length - 1); 288 | }, 289 | 290 | initOnKeyListeners: function() { 291 | $(document).keydown(function(event) { 292 | var activeElementType = document.activeElement.tagName; 293 | // don't navigate when in search box, textarea, dropdown or button 294 | if (activeElementType !== 'TEXTAREA' && activeElementType !== 'INPUT' && activeElementType !== 'SELECT' 295 | && activeElementType !== 'BUTTON' && !event.altKey && !event.ctrlKey && !event.metaKey 296 | && !event.shiftKey) { 297 | switch (event.keyCode) { 298 | case 37: // left 299 | var prevHref = $('link[rel="prev"]').prop('href'); 300 | if (prevHref) { 301 | window.location.href = prevHref; 302 | return false; 303 | } 304 | break; 305 | case 39: // right 306 | var nextHref = $('link[rel="next"]').prop('href'); 307 | if (nextHref) { 308 | window.location.href = nextHref; 309 | return false; 310 | } 311 | break; 312 | } 313 | } 314 | }); 315 | } 316 | }; 317 | 318 | // quick alias for translations 319 | _ = Documentation.gettext; 320 | 321 | $(document).ready(function() { 322 | Documentation.init(); 323 | }); 324 | -------------------------------------------------------------------------------- /pyvib/stats.py: -------------------------------------------------------------------------------- 1 | """ 2 | Statistical functions 3 | """ 4 | 5 | from copy import deepcopy 6 | from math import log 7 | 8 | import matplotlib.pyplot as plt 9 | import numpy as np 10 | from numba import jit, njit 11 | 12 | from .misc import pretty 13 | from .signal import envelope, fftwconvolve 14 | 15 | 16 | def arresidual(t, y, a): 17 | """ 18 | Returns the residual of the autoregressive model with coefficients a 19 | 20 | Parameters 21 | ---------- 22 | t : float 1D array 23 | Time signal 24 | y : float 1D array 25 | Signal to filter 26 | a : float 1D array 27 | AR model coeffs 28 | 29 | Returns 30 | ------- 31 | t : float 1D array 32 | New time signal 33 | y : float 1D array 34 | Filtered signal 35 | """ 36 | 37 | y = fftwconvolve(y, a, 'valid') 38 | N = a.size - 1 39 | t = t[N:] 40 | return t, y 41 | 42 | def arresponse(t, y, a): 43 | """ 44 | Returns the predicted response of the autoregressive model with coeffs a 45 | 46 | Parameters 47 | ---------- 48 | t : float 1D array 49 | Time signal 50 | y : float 1D array 51 | Signal 52 | a : float 1D array 53 | AR model coeffs 54 | 55 | Returns 56 | ------- 57 | t : float 1D array 58 | New time signal 59 | y : float 1D array 60 | Filtered signal 61 | """ 62 | 63 | ynoise = fftwconvolve(y, a, 'valid') 64 | N = a.size - 1 65 | y = y[N:] - ynoise 66 | t = t[N:] 67 | return t, y 68 | 69 | def armodel(y, p, Crit=0, debug=False): 70 | """ 71 | This function tries to remove stationary signals by estimating an 72 | autoregressive model on the vibration signal. Afterwards this estiamte can 73 | be subtracted from the original signal using arresidual() 74 | 75 | Parameters 76 | ---------- 77 | y : float 1D array 78 | Vibration data. 79 | p : int 80 | Maximum number of filter coefficients 81 | Crit : int, optional 82 | Criterion for choosing optimal p: 83 | 84 | - 0 uses Akaike Information Criterium (AICc) 85 | - 1 uses Bayesian Information Criterium (BIC) 86 | 87 | debug : boolean, optional 88 | Choose if debug information should be returned 89 | 90 | Returns 91 | ------- 92 | aopt : float 1D array 93 | Optimal AR model parameters 94 | popt : int 95 | Optimal model order 96 | 97 | See also 98 | -------- 99 | arresidual() - Return the residual (random) signal 100 | arresponse() - Returns the autoregressive model response 101 | """ 102 | 103 | y = y - y.mean() 104 | RR = fftwconvolve(np.flipud(y), y) 105 | RR_start = RR.size // 2 106 | 107 | # Actual AR model 108 | abest, sigma, AIC, apmax, popt = _autoRegressiveFilter_v4(RR[RR_start:RR_start+p+1], p, Crit, y.size) 109 | aopt = np.concatenate((np.ones(1), abest[0:popt])) 110 | apmax = np.concatenate((np.ones(1), apmax)) 111 | 112 | if debug is True: 113 | return aopt, popt, apmax, AIC, sigma 114 | else: 115 | return aopt, popt 116 | 117 | def EHNR(x, Fs = 1.0, debug=False): 118 | """ 119 | Get Envelope Harmonic-to-noise ratio 120 | Based on: 121 | Xu, X., Zhao, M., Lin, J., & Lei, Y. (2016). 122 | Envelope harmonic-to-noise ratio for periodic impulses 123 | detection and its application to bearing diagnosis. 124 | Measurement, 91, 385-397. 125 | 126 | Parameters 127 | ---------- 128 | x : float 1D array 129 | Signal 130 | Fs : float, optional 131 | Sampling frequency 132 | debug : boolean, optional 133 | Whether debug information is returned 134 | 135 | Returns 136 | ------- 137 | EHNR : float 138 | The EHNR value 139 | """ 140 | 141 | if x.size % 2 == 1: 142 | x = x[0:-1] 143 | Env_prime = envelope(x) 144 | Env = Env_prime - np.mean(Env_prime) 145 | 146 | t_i = x.size/2 - 1 147 | dt = 1.0/Fs 148 | temp = Env[:t_i] 149 | r_Env = fftwconvolve(Env[:2*t_i], temp[::-1], 'valid')*dt 150 | i_rem = int(t_i/20.0) 151 | for i in range(i_rem, t_i): 152 | der = r_Env[i] - r_Env[i-1] 153 | if der > 0.0: 154 | i_rem = i 155 | break 156 | if i == t_i - 1: 157 | return 0.0 158 | tauMax_i = np.argmax(r_Env[i_rem:]) + i_rem 159 | r_EnvMax = r_Env[tauMax_i] 160 | if debug is True: 161 | plt.figure() 162 | axes = plt.gca() 163 | plt.plot(r_Env) 164 | plt.title('i_rem = %i' % (i_rem)) 165 | ylim = axes.get_ylim() 166 | plt.plot([i_rem, i_rem], [ylim[0], ylim[1]], '-g') 167 | plt.plot([tauMax_i, tauMax_i], [ylim[0], ylim[1]], '--r') 168 | plt.show() 169 | EHNR = r_EnvMax/(r_Env[0] - r_EnvMax) 170 | return EHNR 171 | 172 | @jit(nopython=True, cache=True) 173 | def _autoRegressiveFilter_v4(RR, pmax, Crit, signalSize): 174 | """ 175 | Solves the Yule-Walker equations for autoregressie model 176 | """ 177 | # Make necessary arrays for calculation 178 | abest = np.zeros(pmax) 179 | aold = np.zeros(pmax) 180 | anew = np.zeros(pmax) 181 | sigma = np.zeros(pmax) 182 | AIC = np.zeros(pmax) 183 | AIC_min = 1e10 184 | popt = 0 185 | 186 | # Initialize AR solver 187 | anew[0] = -RR[1]/RR[0] 188 | sigma[0] = (1.0 - anew[0]**2)*RR[0] 189 | 190 | # Initialzie best AR model 191 | AIC[0] = signalSize*(log(sigma[0] / signalSize) + 1.0) + 2.0*(0 + 1 + 1)*signalSize/(signalSize - (0+1) - 2) 192 | AIC_min = AIC[0] 193 | abest[0] = anew[0] 194 | popt = 1 195 | 196 | # Recurrsively iterate through 197 | for k in range(1, pmax): 198 | for j in range(0, k): 199 | aold[j] = anew[j] 200 | temp = 0.0 201 | for j in range(0, k): 202 | temp += aold[j]*RR[k-j] 203 | anew[k] = -(RR[k+1] + temp)/sigma[k-1] 204 | for i in range(0, k): 205 | anew[i] = aold[i] + anew[k]*aold[k-i-1] 206 | sigma[k] = (1 - anew[k]*anew[k])*sigma[k-1] 207 | AIC[k] = signalSize*(log(sigma[k] / signalSize) + 1) + 2*(k+1 + 1)*signalSize/(signalSize - k+1-2) 208 | if AIC[k] < AIC_min: 209 | AIC_min = AIC[k] 210 | popt = k + 1 211 | for j in range(0, k+1): 212 | abest[j] = anew[j] 213 | 214 | # Return 215 | return abest, sigma, AIC, anew, popt 216 | 217 | def _checkOccurences(rho, tol, printOccurences, skipSignals): 218 | """ 219 | Checks occurences of co-variances being over a thrshold 220 | """ 221 | 222 | occurences = np.zeros(n) 223 | for i in range(0, n): 224 | for j in range(i+1, n): 225 | if np.abs(rho[i, j]) >= tol: 226 | occurences[i] += 1 227 | occurences[j] += 1 228 | if printOccurences is True: 229 | print('W: Linear dependency between signals %i-%i' % (i, j)) 230 | if printOccurences is True: 231 | print('Occurences:') 232 | pretty(occurences[:,None]) 233 | 234 | return occurences 235 | 236 | def covariance(A, printSingular=False, tol=0.9, skipSignals=[]): 237 | """ 238 | Compute the covariance of columns in matrix A 239 | 240 | Parameters 241 | ---------- 242 | A : array 243 | [m,n] array with m observatios and n signals. 244 | printSingular : bool, optional 245 | Print list of singular signals 246 | 247 | Returns 248 | ------- 249 | rho : array 250 | Covariance matrix 251 | occurences : array 252 | How many other signals each signal is 253 | similar to. 254 | """ 255 | 256 | n = A.shape[1] 257 | rho = np.zeros((n, n)) 258 | for i in range(0, n): 259 | if i in skipSignals: next 260 | for j in range(0, n): 261 | if j in skipSignals: next 262 | temp = pearsonr(A[:, i], A[:, j]) 263 | rho[i, j] = temp[0] 264 | 265 | occurences = _checkOccurences(rho, tol, printSingular, skipSignals) 266 | 267 | return rho, occurences 268 | 269 | def maximizeUncorrelatedSignals(A, tol=0.9): 270 | """ 271 | Maximize number of signals such that all are uncorrelated 272 | according to the tolerance. 273 | 274 | A : array, or list of arrays 275 | [m,n] array with m observatios and n signals. 276 | If list, n must be equal on all arrays 277 | tol : float, optional 278 | Tolerance for covariance 279 | """ 280 | 281 | # Initialize 282 | if type(A) is np.ndarray: 283 | operation = 0 284 | A = np.array(A) 285 | ABest = np.array(A) 286 | N = A.shape[1] 287 | elif type(A) is list: 288 | operation = 1 289 | A = deepcopy(A) 290 | ABest = deepcopy(A) 291 | N = A[0].shape[1] 292 | else: 293 | print('Wrong input A') 294 | return None 295 | nMax = 0 296 | 297 | skipSignals = [] 298 | for j in range(N, 1): 299 | if operation == 0: 300 | rho, occurences = covariance(A, printSingular=False, tol=tol, skipSignals=skipSignals) 301 | n = np.sum(occurences == 0.0) 302 | if n > nMax: 303 | nMax = n 304 | ABest = np.array(A) 305 | I = np.ones(j, bool) 306 | temp = np.argsort(occurences) 307 | 308 | I[temp[-1]] = False 309 | 310 | 311 | elif operation == 1: 312 | rho = np.empty((j, j)) 313 | for k in range(0, len(A)): 314 | rhoTemp, occurencesTemp = covariance(A, printSingular=False, tol=tol) 315 | rho += rhoTemp 316 | rho /= len(A) 317 | occurences = _checkOccurences(rho, tol, printOccurences=False) 318 | n = np.sum(occurences == 0.0) 319 | if n > nMax: 320 | nMax = n 321 | ABest = deepcopy(A) 322 | 323 | @njit(cache=True) 324 | def _spearmanWorker(temp1, temp2): 325 | """ 326 | Calculate the spearman coefficient 327 | """ 328 | return np.sum((temp1)*(temp2)) / np.sqrt(np.sum((temp1)**2)*np.sum((temp2)**2)) 329 | 330 | def spearman(x1): 331 | """ 332 | Computes the spearman coefficient of input x1 np.array 333 | Assumes the comparison vector is linearly increasing. 334 | 335 | Parameters 336 | ---------- 337 | x1 : float 1D array 338 | The signal to calculate Spearman coefficient of 339 | 340 | Returns 341 | ------- 342 | spearman : float 343 | Spearman coefficient 344 | """ 345 | 346 | x1rankMean = float(x1.size - 1)/2.0 347 | temp1 = np.argsort(x1)[::-1] - x1rankMean 348 | temp2 = np.arange(x1.size-1, -1, -1) - x1rankMean 349 | return _spearmanWorker(temp1, temp2) 350 | 351 | 352 | @njit(cache=True) 353 | def _percentileWorker(x, y, yp): 354 | """ 355 | Calculates the percentile 356 | """ 357 | if yp <= y[0]: 358 | return x[0] 359 | x1 = x[0] 360 | y1 = y[0] 361 | for i in range(1, x.size): 362 | x2 = x[i] 363 | y2 = y[i] 364 | if y1 <= yp <= y2: 365 | xp = (yp - y1)*(x2 - x1)/(y2 - y1) + x1 366 | break 367 | y1 = y2 368 | x1 = x2 369 | return xp 370 | 371 | def percentile(v, p, w=None): 372 | """ 373 | Gets the p percentile of a PDF with weights w and values v 374 | 0.0 <= p <= w.sum 375 | if w is None, w.sum == 1.0 376 | 377 | Parameters 378 | ---------- 379 | v : float 1D array 380 | Value samples 381 | p : float 382 | Percentile 383 | w : float 1D array, optional 384 | Weights of the value samples 385 | 386 | Returns 387 | ------- 388 | percentile : float 389 | The percentile 390 | """ 391 | assert 0.0 <= p <= 1.0 392 | if w is None: 393 | w = np.ones(v.size)/v.size 394 | else: 395 | assert w.size == v.size 396 | I = np.argsort(v) 397 | return _percentileWorker(v[I], np.cumsum(w[I]), p) 398 | -------------------------------------------------------------------------------- /docs/html/_static/language_data.js: -------------------------------------------------------------------------------- 1 | /* 2 | * language_data.js 3 | * ~~~~~~~~~~~~~~~~ 4 | * 5 | * This script contains the language-specific data used by searchtools.js, 6 | * namely the list of stopwords, stemmer, scorer and splitter. 7 | * 8 | * :copyright: Copyright 2007-2021 by the Sphinx team, see AUTHORS. 9 | * :license: BSD, see LICENSE for details. 10 | * 11 | */ 12 | 13 | var stopwords = ["a","and","are","as","at","be","but","by","for","if","in","into","is","it","near","no","not","of","on","or","such","that","the","their","then","there","these","they","this","to","was","will","with"]; 14 | 15 | 16 | /* Non-minified version is copied as a separate JS file, is available */ 17 | 18 | /** 19 | * Porter Stemmer 20 | */ 21 | var Stemmer = function() { 22 | 23 | var step2list = { 24 | ational: 'ate', 25 | tional: 'tion', 26 | enci: 'ence', 27 | anci: 'ance', 28 | izer: 'ize', 29 | bli: 'ble', 30 | alli: 'al', 31 | entli: 'ent', 32 | eli: 'e', 33 | ousli: 'ous', 34 | ization: 'ize', 35 | ation: 'ate', 36 | ator: 'ate', 37 | alism: 'al', 38 | iveness: 'ive', 39 | fulness: 'ful', 40 | ousness: 'ous', 41 | aliti: 'al', 42 | iviti: 'ive', 43 | biliti: 'ble', 44 | logi: 'log' 45 | }; 46 | 47 | var step3list = { 48 | icate: 'ic', 49 | ative: '', 50 | alize: 'al', 51 | iciti: 'ic', 52 | ical: 'ic', 53 | ful: '', 54 | ness: '' 55 | }; 56 | 57 | var c = "[^aeiou]"; // consonant 58 | var v = "[aeiouy]"; // vowel 59 | var C = c + "[^aeiouy]*"; // consonant sequence 60 | var V = v + "[aeiou]*"; // vowel sequence 61 | 62 | var mgr0 = "^(" + C + ")?" + V + C; // [C]VC... is m>0 63 | var meq1 = "^(" + C + ")?" + V + C + "(" + V + ")?$"; // [C]VC[V] is m=1 64 | var mgr1 = "^(" + C + ")?" + V + C + V + C; // [C]VCVC... is m>1 65 | var s_v = "^(" + C + ")?" + v; // vowel in stem 66 | 67 | this.stemWord = function (w) { 68 | var stem; 69 | var suffix; 70 | var firstch; 71 | var origword = w; 72 | 73 | if (w.length < 3) 74 | return w; 75 | 76 | var re; 77 | var re2; 78 | var re3; 79 | var re4; 80 | 81 | firstch = w.substr(0,1); 82 | if (firstch == "y") 83 | w = firstch.toUpperCase() + w.substr(1); 84 | 85 | // Step 1a 86 | re = /^(.+?)(ss|i)es$/; 87 | re2 = /^(.+?)([^s])s$/; 88 | 89 | if (re.test(w)) 90 | w = w.replace(re,"$1$2"); 91 | else if (re2.test(w)) 92 | w = w.replace(re2,"$1$2"); 93 | 94 | // Step 1b 95 | re = /^(.+?)eed$/; 96 | re2 = /^(.+?)(ed|ing)$/; 97 | if (re.test(w)) { 98 | var fp = re.exec(w); 99 | re = new RegExp(mgr0); 100 | if (re.test(fp[1])) { 101 | re = /.$/; 102 | w = w.replace(re,""); 103 | } 104 | } 105 | else if (re2.test(w)) { 106 | var fp = re2.exec(w); 107 | stem = fp[1]; 108 | re2 = new RegExp(s_v); 109 | if (re2.test(stem)) { 110 | w = stem; 111 | re2 = /(at|bl|iz)$/; 112 | re3 = new RegExp("([^aeiouylsz])\\1$"); 113 | re4 = new RegExp("^" + C + v + "[^aeiouwxy]$"); 114 | if (re2.test(w)) 115 | w = w + "e"; 116 | else if (re3.test(w)) { 117 | re = /.$/; 118 | w = w.replace(re,""); 119 | } 120 | else if (re4.test(w)) 121 | w = w + "e"; 122 | } 123 | } 124 | 125 | // Step 1c 126 | re = /^(.+?)y$/; 127 | if (re.test(w)) { 128 | var fp = re.exec(w); 129 | stem = fp[1]; 130 | re = new RegExp(s_v); 131 | if (re.test(stem)) 132 | w = stem + "i"; 133 | } 134 | 135 | // Step 2 136 | re = /^(.+?)(ational|tional|enci|anci|izer|bli|alli|entli|eli|ousli|ization|ation|ator|alism|iveness|fulness|ousness|aliti|iviti|biliti|logi)$/; 137 | if (re.test(w)) { 138 | var fp = re.exec(w); 139 | stem = fp[1]; 140 | suffix = fp[2]; 141 | re = new RegExp(mgr0); 142 | if (re.test(stem)) 143 | w = stem + step2list[suffix]; 144 | } 145 | 146 | // Step 3 147 | re = /^(.+?)(icate|ative|alize|iciti|ical|ful|ness)$/; 148 | if (re.test(w)) { 149 | var fp = re.exec(w); 150 | stem = fp[1]; 151 | suffix = fp[2]; 152 | re = new RegExp(mgr0); 153 | if (re.test(stem)) 154 | w = stem + step3list[suffix]; 155 | } 156 | 157 | // Step 4 158 | re = /^(.+?)(al|ance|ence|er|ic|able|ible|ant|ement|ment|ent|ou|ism|ate|iti|ous|ive|ize)$/; 159 | re2 = /^(.+?)(s|t)(ion)$/; 160 | if (re.test(w)) { 161 | var fp = re.exec(w); 162 | stem = fp[1]; 163 | re = new RegExp(mgr1); 164 | if (re.test(stem)) 165 | w = stem; 166 | } 167 | else if (re2.test(w)) { 168 | var fp = re2.exec(w); 169 | stem = fp[1] + fp[2]; 170 | re2 = new RegExp(mgr1); 171 | if (re2.test(stem)) 172 | w = stem; 173 | } 174 | 175 | // Step 5 176 | re = /^(.+?)e$/; 177 | if (re.test(w)) { 178 | var fp = re.exec(w); 179 | stem = fp[1]; 180 | re = new RegExp(mgr1); 181 | re2 = new RegExp(meq1); 182 | re3 = new RegExp("^" + C + v + "[^aeiouwxy]$"); 183 | if (re.test(stem) || (re2.test(stem) && !(re3.test(stem)))) 184 | w = stem; 185 | } 186 | re = /ll$/; 187 | re2 = new RegExp(mgr1); 188 | if (re.test(w) && re2.test(w)) { 189 | re = /.$/; 190 | w = w.replace(re,""); 191 | } 192 | 193 | // and turn initial Y back to y 194 | if (firstch == "y") 195 | w = firstch.toLowerCase() + w.substr(1); 196 | return w; 197 | } 198 | } 199 | 200 | 201 | 202 | 203 | var splitChars = (function() { 204 | var result = {}; 205 | var singles = [96, 180, 187, 191, 215, 247, 749, 885, 903, 907, 909, 930, 1014, 1648, 206 | 1748, 1809, 2416, 2473, 2481, 2526, 2601, 2609, 2612, 2615, 2653, 2702, 207 | 2706, 2729, 2737, 2740, 2857, 2865, 2868, 2910, 2928, 2948, 2961, 2971, 208 | 2973, 3085, 3089, 3113, 3124, 3213, 3217, 3241, 3252, 3295, 3341, 3345, 209 | 3369, 3506, 3516, 3633, 3715, 3721, 3736, 3744, 3748, 3750, 3756, 3761, 210 | 3781, 3912, 4239, 4347, 4681, 4695, 4697, 4745, 4785, 4799, 4801, 4823, 211 | 4881, 5760, 5901, 5997, 6313, 7405, 8024, 8026, 8028, 8030, 8117, 8125, 212 | 8133, 8181, 8468, 8485, 8487, 8489, 8494, 8527, 11311, 11359, 11687, 11695, 213 | 11703, 11711, 11719, 11727, 11735, 12448, 12539, 43010, 43014, 43019, 43587, 214 | 43696, 43713, 64286, 64297, 64311, 64317, 64319, 64322, 64325, 65141]; 215 | var i, j, start, end; 216 | for (i = 0; i < singles.length; i++) { 217 | result[singles[i]] = true; 218 | } 219 | var ranges = [[0, 47], [58, 64], [91, 94], [123, 169], [171, 177], [182, 184], [706, 709], 220 | [722, 735], [741, 747], [751, 879], [888, 889], [894, 901], [1154, 1161], 221 | [1318, 1328], [1367, 1368], [1370, 1376], [1416, 1487], [1515, 1519], [1523, 1568], 222 | [1611, 1631], [1642, 1645], [1750, 1764], [1767, 1773], [1789, 1790], [1792, 1807], 223 | [1840, 1868], [1958, 1968], [1970, 1983], [2027, 2035], [2038, 2041], [2043, 2047], 224 | [2070, 2073], [2075, 2083], [2085, 2087], [2089, 2307], [2362, 2364], [2366, 2383], 225 | [2385, 2391], [2402, 2405], [2419, 2424], [2432, 2436], [2445, 2446], [2449, 2450], 226 | [2483, 2485], [2490, 2492], [2494, 2509], [2511, 2523], [2530, 2533], [2546, 2547], 227 | [2554, 2564], [2571, 2574], [2577, 2578], [2618, 2648], [2655, 2661], [2672, 2673], 228 | [2677, 2692], [2746, 2748], [2750, 2767], [2769, 2783], [2786, 2789], [2800, 2820], 229 | [2829, 2830], [2833, 2834], [2874, 2876], [2878, 2907], [2914, 2917], [2930, 2946], 230 | [2955, 2957], [2966, 2968], [2976, 2978], [2981, 2983], [2987, 2989], [3002, 3023], 231 | [3025, 3045], [3059, 3076], [3130, 3132], [3134, 3159], [3162, 3167], [3170, 3173], 232 | [3184, 3191], [3199, 3204], [3258, 3260], [3262, 3293], [3298, 3301], [3312, 3332], 233 | [3386, 3388], [3390, 3423], [3426, 3429], [3446, 3449], [3456, 3460], [3479, 3481], 234 | [3518, 3519], [3527, 3584], [3636, 3647], [3655, 3663], [3674, 3712], [3717, 3718], 235 | [3723, 3724], [3726, 3731], [3752, 3753], [3764, 3772], [3774, 3775], [3783, 3791], 236 | [3802, 3803], [3806, 3839], [3841, 3871], [3892, 3903], [3949, 3975], [3980, 4095], 237 | [4139, 4158], [4170, 4175], [4182, 4185], [4190, 4192], [4194, 4196], [4199, 4205], 238 | [4209, 4212], [4226, 4237], [4250, 4255], [4294, 4303], [4349, 4351], [4686, 4687], 239 | [4702, 4703], [4750, 4751], [4790, 4791], [4806, 4807], [4886, 4887], [4955, 4968], 240 | [4989, 4991], [5008, 5023], [5109, 5120], [5741, 5742], [5787, 5791], [5867, 5869], 241 | [5873, 5887], [5906, 5919], [5938, 5951], [5970, 5983], [6001, 6015], [6068, 6102], 242 | [6104, 6107], [6109, 6111], [6122, 6127], [6138, 6159], [6170, 6175], [6264, 6271], 243 | [6315, 6319], [6390, 6399], [6429, 6469], [6510, 6511], [6517, 6527], [6572, 6592], 244 | [6600, 6607], [6619, 6655], [6679, 6687], [6741, 6783], [6794, 6799], [6810, 6822], 245 | [6824, 6916], [6964, 6980], [6988, 6991], [7002, 7042], [7073, 7085], [7098, 7167], 246 | [7204, 7231], [7242, 7244], [7294, 7400], [7410, 7423], [7616, 7679], [7958, 7959], 247 | [7966, 7967], [8006, 8007], [8014, 8015], [8062, 8063], [8127, 8129], [8141, 8143], 248 | [8148, 8149], [8156, 8159], [8173, 8177], [8189, 8303], [8306, 8307], [8314, 8318], 249 | [8330, 8335], [8341, 8449], [8451, 8454], [8456, 8457], [8470, 8472], [8478, 8483], 250 | [8506, 8507], [8512, 8516], [8522, 8525], [8586, 9311], [9372, 9449], [9472, 10101], 251 | [10132, 11263], [11493, 11498], [11503, 11516], [11518, 11519], [11558, 11567], 252 | [11622, 11630], [11632, 11647], [11671, 11679], [11743, 11822], [11824, 12292], 253 | [12296, 12320], [12330, 12336], [12342, 12343], [12349, 12352], [12439, 12444], 254 | [12544, 12548], [12590, 12592], [12687, 12689], [12694, 12703], [12728, 12783], 255 | [12800, 12831], [12842, 12880], [12896, 12927], [12938, 12976], [12992, 13311], 256 | [19894, 19967], [40908, 40959], [42125, 42191], [42238, 42239], [42509, 42511], 257 | [42540, 42559], [42592, 42593], [42607, 42622], [42648, 42655], [42736, 42774], 258 | [42784, 42785], [42889, 42890], [42893, 43002], [43043, 43055], [43062, 43071], 259 | [43124, 43137], [43188, 43215], [43226, 43249], [43256, 43258], [43260, 43263], 260 | [43302, 43311], [43335, 43359], [43389, 43395], [43443, 43470], [43482, 43519], 261 | [43561, 43583], [43596, 43599], [43610, 43615], [43639, 43641], [43643, 43647], 262 | [43698, 43700], [43703, 43704], [43710, 43711], [43715, 43738], [43742, 43967], 263 | [44003, 44015], [44026, 44031], [55204, 55215], [55239, 55242], [55292, 55295], 264 | [57344, 63743], [64046, 64047], [64110, 64111], [64218, 64255], [64263, 64274], 265 | [64280, 64284], [64434, 64466], [64830, 64847], [64912, 64913], [64968, 65007], 266 | [65020, 65135], [65277, 65295], [65306, 65312], [65339, 65344], [65371, 65381], 267 | [65471, 65473], [65480, 65481], [65488, 65489], [65496, 65497]]; 268 | for (i = 0; i < ranges.length; i++) { 269 | start = ranges[i][0]; 270 | end = ranges[i][1]; 271 | for (j = start; j <= end; j++) { 272 | result[j] = true; 273 | } 274 | } 275 | return result; 276 | })(); 277 | 278 | function splitQuery(query) { 279 | var result = []; 280 | var start = -1; 281 | for (var i = 0; i < query.length; i++) { 282 | if (splitChars[query.charCodeAt(i)]) { 283 | if (start !== -1) { 284 | result.push(query.slice(start, i)); 285 | start = -1; 286 | } 287 | } else if (start === -1) { 288 | start = i; 289 | } 290 | } 291 | if (start !== -1) { 292 | result.push(query.slice(start)); 293 | } 294 | return result; 295 | } 296 | 297 | 298 | -------------------------------------------------------------------------------- /docs/html/publications.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 |The pyvib module was built during my PhD education at University of Agder, Grimstad, Norway. 95 | Because of the open-source community, I was able to produce most of my thesis with LaTeX, Inkscape and most importantly Python. 96 | In addition, the PhD thesis was funded by the public: Ministry of Education in Norway. 97 | In this spirit, I release the pyvib module to the public.
98 |Here is a link to download the Thesis at the University of Agder AURA.
99 |Andreas Klausen. Condition monitoring of rolling element bearings during low and variable speed conditions. Ph. D. thesis, University of Agder, 2019.
102 |Here is a list of relevant papers written during my PhD.
109 |Surya Teja Kandukuri, Andreas Klausen, Hamid Reza Karimi, and Kjell Gunnar Robbersmyr. A review of diagnostics and prognostics of low-speed machinery towards wind turbine farm-level health management. Renewable and Sustainable Energy Reviews, 53:697–708, 2016.
112 |Andreas Klausen, Roy Werner Folgerø, Kjell G Robbersmyr, and Hamid Reza Karimi. Accelerated bearing life-time test rig development for low speed data acquisition. Modeling, Identification and Control, 38(3):143–156, 2017.
115 |Andreas Klausen and Kjell G Robbersmyr. Cross-correlation of whitened vibration signals for low-speed bearing diagnostics. Mechanical Systems and Signal Processing, 118:226–244, 2019.
118 |Martin Hemmer, Andreas Klausen, Khang Huynh, Kjell Gunnar Robbersmyr, and Tor Inge Waag. Simulation-driven deep classification of bearing faults from raw vibration data. International Journal of Prognostics and Health Management, 2019.
121 |Andreas Klausen, Huynh V Khang, and Kjell G Robbersmyr. Multi-band identification for enhancing bearing fault detection in variable speed conditions. Mechanical Systems and Signal Processing, 139:106422, 2020.
124 |Martin Hemmer, Andreas Klausen, Huynh Van Khang, Kjell G Robbersmyr, and Tor I Waag. Health indicator for low-speed axial bearings using variational autoencoders. IEEE Access, 8:35842–35852, 2020.
127 |Andreas Klausen, Kjell G Robbersmyr, and Hamid R Karimi. Autonomous bearing fault diagnosis method based on envelope spectrum. IFAC-PapersOnLine, 50(1):13378–13383, 2017.
130 |Surya Teja Kandukuri, Andreas Klausen, Van Khang Huynh, and Kjell G Robbersmyr. Fault diagnostics of wind turbine electric pitch systems using sensor fusion approach. Journal of Physics: Conference Series, 1037(3):032036, 2018.
133 |Andreas Klausen, Huynh Van Khang, and Kjell G Robbersmyr. Novel threshold calculations for remaining useful lifetime estimation of rolling element bearings. XIII International Conference on Electrical Machines (ICEM), pages 1912–1918, 2018.
136 |Mohamed A. A Ismail and Andreas Klausen. Multiple defect size estimation of rolling bearings using autonomous diagnosis and vibrational jerk. 7th World Conference on Structural Control and Monitoring, 2018.
139 |Arild Bergesen Husebø, Surya Teja Kandukuri, Andreas Klausen, and Kjell Gunnar Robbersmyr. Rapid diagnosis of induction motor electrical faults using convolutional autoencoder feature extraction. PHM Society European Conference, 5(1):10, 2020.
142 |Andreas Klausen, Johannes Kalaoja, Surya Teja Kandukuri, and Kjell G Robbersmyr. Sensitivity analysis of online oil quality monitoring for early detection of water ingress in marine propulsion systems. PHM Society European Conference, 5(1):10, 2020.
145 |Some of the datasets that were created using a custom test-rig are available here
152 |Andreas Klausen. UiA Accelerated Life Time Bearing Test Rig – Test 3, Variable speed around 50rpm. DataverseNO, 2021. URL: https://doi.org/10.18710/NZJOIS, doi:10.18710/NZJOIS.
155 |Andreas Klausen. UiA Accelerated Life Time Bearing Test Rig – Test 1, 250 rpm. DataverseNO, 2020. URL: https://doi.org/10.18710/BG1QNG, doi:10.18710/BG1QNG.
158 |