Skip to content

Commit

Permalink
docs
Browse files Browse the repository at this point in the history
  • Loading branch information
demotu committed Mar 29, 2020
1 parent 538da0c commit 9d458c0
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 22 deletions.
31 changes: 19 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
@@ -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:
Expand All @@ -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, <https://github.com/demotu/psd2>.
And a possible BibTeX entry:

Expand All @@ -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).
6 changes: 3 additions & 3 deletions docs/psd2.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -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)"
]
Expand All @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion psd2/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
from .psd2 import psd2

__version__ = "0.0.1"
__version__ = "0.0.4"
8 changes: 4 additions & 4 deletions psd2/psd2.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@

setuptools.setup(
name="psd2",
version="0.0.1",
version="0.0.4",
author="Marcos Duarte",
author_email="[email protected]",
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",
Expand Down

0 comments on commit 9d458c0

Please sign in to comment.