Skip to main content

time-freq feature from signal for phm purpose

Project description

phm-feature

介绍

  • phm中的特征抽取任务
  • 抽取振动信号中的各类时、频域业务特征值

软件架构

软件架构说明

.. code-block:: shell

.
├── build
│   ├── bdist.linux-x86_64
│   └── lib
│       └── phm_feature
│           └── __init__.py
├── dist
│   ├── phm_feature-0.0.2-py3-none-any.whl
│   └── phm_feature-0.0.2.tar.gz
├── LICENSE
├── phm_feature
│   ├── __init__.py
├── phm_feature.egg-info
│   ├── dependency_links.txt
│   ├── PKG-INFO
│   ├── SOURCES.txt
│   └── top_level.txt
├── README.md
├── setup.py
└── test.py

安装教程

  • 使用pip进行安装

.. code-block:: python

pip install phm-feature

使用说明

获得振动信号的特征值


.. code-block:: python

    import phm_feature
    from phm_feature import *
    enable_parallel(processnum=None) 开启多线程模式
    disable_parallel() 开启单线程模式
    feature_t(data) 获取时间域特征
    feature_f 获取频率域特征
    fft(data, 50) 快速离散傅里叶变换
    power(data, 50) 功率谱
    ifft(data, 50) 快速离散逆傅里叶变换
    cepstrum(data, 50) 倒谱
    envelope(data) 包络谱
    window(data, 'hamming') 加窗-汉明窗
    divide(data, 50, 25) 分帧

参与贡献
--------------------------------------------------------------------------------------------

2022-07-04 v0.0.1
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

pypi上传初版本

pypi上传phm-feature初版本


2022-07-04 v0.0.2
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

新增多线程模式


phm-feature
=========================================================================

介绍
-------------------------------------------------------------------------

使用torch torchaudio 构建PHM特征抽取功能层

功能层介绍
-----------------------------------------------------------------------------

torchphm.layers 将phm固定使用的数据操作,固化为如下层:

.. code-block:: python

    1. STFT 离散傅立叶变换
    2. Spectrogram 谱图
    3. MelFilterbank mel譜过滤
    4. AmplitudeToDb 幅度取分贝
    5. TimeStretch 变速不变调
    6. ComplexNorm 复数输出取模'范数'
    7. ApplyFilterbank 过滤器应用

应用场景
------------------------------------------------------------------------------------

.. note::

    组合上述功能层,实现不同场景

.. code-block:: shell

    1. STFT
        分帧==>加窗==>短时离散傅立叶变换

    2. "变速不变调" Time scale modification
        详细见 https://zhuanlan.zhihu.com/p/337193578
        用于声谱图压缩、扩张处理,供后续分析

    3. 梅尔mel谱转换
       对于语谱图进行mel谱转换

    4. HPSS
        中值滤波,过滤出频率的谐波分量与冲击分量
        为什么中值滤波,可以过滤出"数据轮廓"及发现"谐波分量和冲击分量",参见
        https://blog.csdn.net/qq_38131594/article/details/80758567


软件结构说明
-----------------------------------------------------------------------------------

.. code-block:: shell

    .
    ├── dist
    │   ├── torchphm-1.1.7.tar.gz
    │   └── torchphm-1.1.8.tar.gz
    ├── draw
    │   ├── draw_functional.py
    │   ├── draw_layers.py
    │   ├── draw_torchphm_layers.ipynb
    │   ├── torchphm -> ../torchphm
    │   └── Untitled.ipynb
    ├── examples_torchphm.ipynb
    ├── README.md
    ├── setup.cfg
    ├── setup.py
    ├── tests
    │   ├── test_functional.py
    │   └── test_layers.py
    ├── torchphm
    │   ├── beta_hpss.py
    │   ├── functional.py
    │   ├── __init__.py
    │   ├── layers.py
    └── torchphm.egg-info

======================== =========== 
dist                     pypi上传包
======================== =========== 
draw                     画图
examples_torchphm.ipynb  应用例程
tests                    测试文件
torchphm                 实现源码
======================== =========== 

安装教程
--------------------------------------------------------------------------------------

.. code-block:: python 

    pip install phm-feature



Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

phm_feature-0.1.1.tar.gz (17.2 kB view details)

Uploaded Source

Built Distribution

phm_feature-0.1.1-py3-none-any.whl (17.5 kB view details)

Uploaded Python 3

File details

Details for the file phm_feature-0.1.1.tar.gz.

File metadata

  • Download URL: phm_feature-0.1.1.tar.gz
  • Upload date:
  • Size: 17.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.8.10

File hashes

Hashes for phm_feature-0.1.1.tar.gz
Algorithm Hash digest
SHA256 b42701573bba0e7f13bed02e1fb45448b3b031bef8f78f6b744210347c66fb14
MD5 408f391ef18b150fa6c6ce883bbad865
BLAKE2b-256 d1ef1fb495bb7d266cb9bc487f80a9add00f56a2ff9870310182f8cac0e65207

See more details on using hashes here.

File details

Details for the file phm_feature-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: phm_feature-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 17.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.8.10

File hashes

Hashes for phm_feature-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 84fff4808c59a2bc6dff3b4cefc5b899b04cdd28aab8c1ca57e36ffa06218eee
MD5 b2ea0cb14d081661897472f854884dfa
BLAKE2b-256 e7a04b5dceefa55b6666034a1802d7d6f8e230c5b1f3ce6a13dd5532643fcd0f

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page