Skip to content

Commit

Permalink
RTD file typo fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
psambit9791 committed Jun 24, 2022
1 parent a6eca0d commit 204e3bf
Showing 1 changed file with 43 additions and 17 deletions.
60 changes: 43 additions & 17 deletions docs/source/usage.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,11 @@ Usage
Generating a Signal
--------------------

.. code-block::
.. code-block:: python
import numpy as np
import pysnr
Fi = 2500
Fs = 48000
N = 1000
Expand All @@ -16,23 +20,33 @@ Generating a Signal
Performing SNR
---------------

Using signal and noise
***********************

.. code-block:: python
snr_value, noise_power = pysnr.snr_signal(signal, noise)
Using only signal
******************

.. code-block::
snr_value, noise_power = pysnr.snr_signal(signal, Fs)
.. code-block:: python
snr_value, noise_power = pysnr.snr_signal(signal+noise, Fs)
Using only density periodogram
*******************************

.. code-block::
.. code-block:: python
f, pxx = pysnr.periodogram(signal+noise, Fs, window=('kaiser', 38))
snr_value, noise_power = pysnr.snr_power_spectral_density(pxx, f)
Using only spectrum periodogram
*******************************

.. code-block::
.. code-block:: python
f, sxx = pysnr.periodogram(signal+noise, Fs, window=('kaiser', 38), scaling="spectrum")
w = scipy.signal.windows.kaiser(len(signal), 38, False)
rbw = pysnr.utils.enbw(w, Fs)
Expand All @@ -45,20 +59,23 @@ Performing THD
Using only signal
******************

.. code-block::
.. code-block:: python
thd_value, harmonic_power = pysnr.thd_signal(signal+noise, Fs)
Using only density periodogram
*******************************

.. code-block::
.. code-block:: python
f, pxx = pysnr.periodogram(signal+noise, Fs, window=('kaiser', 38))
thd_value, harmonic_power = pysnr.thd_power_spectral_density(pxx, f)
Using only spectrum periodogram
*******************************

.. code-block::
.. code-block:: python
f, sxx = pysnr.periodogram(signal+noise, Fs, window=('kaiser', 38), scaling="spectrum")
w = scipy.signal.windows.kaiser(len(signal), 38, False)
rbw = pysnr.utils.enbw(w, Fs)
Expand All @@ -71,20 +88,23 @@ Performing SINAD
Using only signal
******************

.. code-block::
.. code-block:: python
sinad_value, noise_harmonic_power = pysnr.sinad_signal(signal+noise, Fs)
Using only density periodogram
*******************************

.. code-block::
.. code-block:: python
f, pxx = pysnr.periodogram(signal+noise, Fs, window=('kaiser', 38))
sinad_value, noise_harmonic_power = pysnr.sinad_power_spectral_density(pxx, f)
Using only spectrum periodogram
*******************************

.. code-block::
.. code-block:: python
f, sxx = pysnr.periodogram(signal+noise, Fs, window=('kaiser', 38), scaling="spectrum")
w = scipy.signal.windows.kaiser(len(signal), 38, False)
rbw = pysnr.utils.enbw(w, Fs)
Expand All @@ -97,20 +117,23 @@ Performing TOI
Using only signal
******************

.. code-block::
.. code-block:: python
toi_value, signal_power, imod_power = pysnr.toi_signal(signal+noise, Fs)
Using only density periodogram
*******************************

.. code-block::
.. code-block:: python
f, pxx = pysnr.periodogram(signal+noise, Fs, window=('kaiser', 38))
toi_value, signal_power, imod_power = pysnr.toi_power_spectral_density(pxx, f)
Using only spectrum periodogram
*******************************

.. code-block::
.. code-block:: python
f, sxx = pysnr.periodogram(signal+noise, Fs, window=('kaiser', 38), scaling="spectrum")
w = scipy.signal.windows.kaiser(len(signal), 38, False)
rbw = pysnr.utils.enbw(w, Fs)
Expand All @@ -123,20 +146,23 @@ Performing SFDR
Using only signal
******************

.. code-block::
.. code-block:: python
sfdr_value, spur_power = pysnr.sfdr_signal(signal+noise, Fs)
Using only density periodogram
*******************************

.. code-block::
.. code-block:: python
f, pxx = pysnr.periodogram(signal+noise, Fs, window=('kaiser', 38))
sfdr_value, spur_power = pysnr.sfdr_power_spectral_density(pxx, f)
Using only spectrum periodogram
*******************************

.. code-block::
.. code-block:: python
f, sxx = pysnr.periodogram(signal+noise, Fs, window=('kaiser', 38), scaling="spectrum")
w = scipy.signal.windows.kaiser(len(signal), 38, False)
rbw = pysnr.utils.enbw(w, Fs)
Expand Down

0 comments on commit 204e3bf

Please sign in to comment.