From 9d458c06f74ef839f204a1cf1f580ee7318cfdfb Mon Sep 17 00:00:00 2001 From: demotu Date: Sun, 29 Mar 2020 17:22:49 -0300 Subject: [PATCH] docs --- README.md | 31 +++++++++++++++++++------------ docs/psd2.ipynb | 6 +++--- psd2/__init__.py | 2 +- psd2/psd2.py | 8 ++++---- setup.py | 4 ++-- 5 files changed, 29 insertions(+), 22 deletions(-) diff --git a/README.md b/README.md index e13514c..c5374ba 100644 --- a/README.md +++ b/README.md @@ -1,18 +1,24 @@ # [psd2](https://pypi.org/project/psd2/) -A Python module for estimation of power spectral density characteristics using Welch's method +Estimation of power spectral density characteristics using Welch's method The function psd2.py from Python module psd2 estimates power spectral density characteristics using Welch's method. This function is just a wrap of the scipy.signal.welch function with estimation of some frequency characteristics and a plot. The psd2.py returns power spectral density data, frequency percentiles of the power spectral density (for example, Fpcntile[50] gives the median power frequency in Hz); mean power frequency; maximum power frequency; total power, and plots power spectral density data. -Installation ------------- -``` +## Installation + +```bash pip install psd2 ``` -Examples --------- +Or + +```bash +conda install -c duartexyz psd2 +``` + +## Examples + ```python #Generate a test signal, a 2 Vrms sine wave at 1234 Hz, corrupted by # 0.001 V**2/Hz of white noise sampled at 10 kHz and calculate the PSD: @@ -26,13 +32,14 @@ Examples >>> x += np.random.normal(scale=np.sqrt(noise_power), size=time.shape) >>> psd2(x, fs=freq); ``` - * [psd2.ipynb](https://github.com/demotu/psd2/blob/master/docs/psd2.ipynb) -How to cite this work ---------------------- +- [psd2.ipynb](https://github.com/demotu/psd2/blob/master/docs/psd2.ipynb) + +## How to cite this work + Here is a suggestion to cite this GitHub repository: -> Duarte, M. (2020) psd2: A Python module for estimation of power spectral density characteristics using Welch's method, https://github.com/demotu/psd2. +> Duarte, M. (2020) psd2: A Python module for estimation of power spectral density characteristics using Welch's method. GitHub repository, . And a possible BibTeX entry: @@ -47,6 +54,6 @@ And a possible BibTeX entry: } ``` -License -------- +## License + The non-software content of this project is licensed under a [Creative Commons Attribution 4.0 International License](http://creativecommons.org/licenses/by/4.0/), and the software code is licensed under the [MIT license](https://opensource.org/licenses/mit-license.php). diff --git a/docs/psd2.ipynb b/docs/psd2.ipynb index 8e2da32..6753b04 100644 --- a/docs/psd2.ipynb +++ b/docs/psd2.ipynb @@ -6,7 +6,7 @@ "source": [ "# [psd2](https://pypi.org/project/psd2)\n", "\n", - "A Python module for estimation of power spectral density characteristcs using Welch's method\n", + "A Python module for estimation of power spectral density characteristics using Welch's method\n", "\n", "[https://pypi.org/project/psd2](https://pypi.org/project/psd2)" ] @@ -33,10 +33,10 @@ "Help on function psd2 in module psd2.psd2:\n", "\n", "psd2(x, fs=1.0, window='hanning', nperseg=None, noverlap=None, nfft=None, detrend='constant', show=True, ax=None, scales='linear', xlim=None, units='V')\n", - " Estimate power spectral density characteristcs using Welch's method.\n", + " Estimate power spectral density characteristics using Welch's method.\n", " \n", " This function is just a wrap of the scipy.signal.welch function with\n", - " estimation of some frequency characteristcs and a plot. For completeness,\n", + " estimation of some frequency characteristics and a plot. For completeness,\n", " most of the help from scipy.signal.welch function is pasted here.\n", " \n", " Welch's method [1]_ computes an estimate of the power spectral density\n", diff --git a/psd2/__init__.py b/psd2/__init__.py index 2b880a2..b149c6b 100644 --- a/psd2/__init__.py +++ b/psd2/__init__.py @@ -1,3 +1,3 @@ from .psd2 import psd2 -__version__ = "0.0.1" +__version__ = "0.0.4" diff --git a/psd2/psd2.py b/psd2/psd2.py index 07e5062..b96b4e3 100644 --- a/psd2/psd2.py +++ b/psd2/psd2.py @@ -1,21 +1,21 @@ #!/usr/bin/env python -"""Estimate power spectral density characteristcs using Welch's method.""" +"""Estimate power spectral density characteristics using Welch's method.""" import numpy as np __author__ = 'Marcos Duarte, https://github.com/demotu' -__version__ = "0.0.1" +__version__ = "0.0.4" __license__ = "MIT" def psd2(x, fs=1.0, window='hanning', nperseg=None, noverlap=None, nfft=None, detrend='constant', show=True, ax=None, scales='linear', xlim=None, units='V'): - """Estimate power spectral density characteristcs using Welch's method. + """Estimate power spectral density characteristics using Welch's method. This function is just a wrap of the scipy.signal.welch function with - estimation of some frequency characteristcs and a plot. For completeness, + estimation of some frequency characteristics and a plot. For completeness, most of the help from scipy.signal.welch function is pasted here. Welch's method [1]_ computes an estimate of the power spectral density diff --git a/setup.py b/setup.py index 4cc561e..ac57113 100644 --- a/setup.py +++ b/setup.py @@ -5,10 +5,10 @@ setuptools.setup( name="psd2", - version="0.0.1", + version="0.0.4", author="Marcos Duarte", author_email="duartexyz@gmail.com", - description="Estimate power spectral density characteristcs using Welch's method", + description="Estimate power spectral density characteristics using Welch's method", long_description=long_description, long_description_content_type="text/markdown", url="https://github.com/demotu/psd2",