Skip to content

Commit

Permalink
fixing broken links
Browse files Browse the repository at this point in the history
  • Loading branch information
Nikeshbajaj committed Aug 25, 2024
1 parent 4e3efa3 commit 9979b7a
Show file tree
Hide file tree
Showing 27 changed files with 219 additions and 196 deletions.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,7 @@ since they reprepresent the outliers. However, some of the (weired) articles use
A simple block-diagram shown below is the procedure of wavelet filtering.



.. figure:: https://raw.githubusercontent.com/spkit/images/master/extra/images/wavelet_filtering_block_dia_1.png
.. figure:: https://raw.githubusercontent.com/spkit/images/master/extra/wavelet_filtering_block_dia_1.png
:align: center
:scale: 80%

Expand All @@ -86,9 +85,9 @@ if you want to zero out coefficient below the threshold or above by setting *fil
However, default setting is *threshold='optimal'* and *filter_out_below=True*.

There are a few more options to tune threshold and mode of filtering.
For more details see doc section or run :func:`sp.wavelet_filtering`
For more details see doc section or run :func:`spkit.wavelet_filtering`

.. GENERATED FROM PYTHON SOURCE LINES 72-86
.. GENERATED FROM PYTHON SOURCE LINES 71-85
.. code-block:: Python
Expand All @@ -113,12 +112,12 @@ For more details see doc section or run :func:`sp.wavelet_filtering`
.. GENERATED FROM PYTHON SOURCE LINES 87-89
.. GENERATED FROM PYTHON SOURCE LINES 86-88
Wavelet filtering with optimal threshold ans db3
--------------------------------------------------

.. GENERATED FROM PYTHON SOURCE LINES 89-93
.. GENERATED FROM PYTHON SOURCE LINES 88-92
.. code-block:: Python
Expand All @@ -144,12 +143,12 @@ Wavelet filtering with optimal threshold ans db3
.. GENERATED FROM PYTHON SOURCE LINES 94-96
.. GENERATED FROM PYTHON SOURCE LINES 93-95
With SD threshold
-------------------

.. GENERATED FROM PYTHON SOURCE LINES 96-100
.. GENERATED FROM PYTHON SOURCE LINES 95-99
.. code-block:: Python
Expand All @@ -175,12 +174,12 @@ With SD threshold
.. GENERATED FROM PYTHON SOURCE LINES 101-103
.. GENERATED FROM PYTHON SOURCE LINES 100-102
With IQR
----------

.. GENERATED FROM PYTHON SOURCE LINES 103-107
.. GENERATED FROM PYTHON SOURCE LINES 102-106
.. code-block:: Python
Expand All @@ -206,12 +205,12 @@ With IQR
.. GENERATED FROM PYTHON SOURCE LINES 108-110
.. GENERATED FROM PYTHON SOURCE LINES 107-109
Limit the number of levels for decomposition to 2
---------------------------------------------------

.. GENERATED FROM PYTHON SOURCE LINES 110-114
.. GENERATED FROM PYTHON SOURCE LINES 109-113
.. code-block:: Python
Expand All @@ -237,12 +236,12 @@ Limit the number of levels for decomposition to 2
.. GENERATED FROM PYTHON SOURCE LINES 115-117
.. GENERATED FROM PYTHON SOURCE LINES 114-116
With *db12*
------------

.. GENERATED FROM PYTHON SOURCE LINES 117-121
.. GENERATED FROM PYTHON SOURCE LINES 116-120
.. code-block:: Python
Expand All @@ -268,12 +267,12 @@ With *db12*
.. GENERATED FROM PYTHON SOURCE LINES 122-124
.. GENERATED FROM PYTHON SOURCE LINES 121-123
With Symlet - *sym4*
---------------------

.. GENERATED FROM PYTHON SOURCE LINES 124-128
.. GENERATED FROM PYTHON SOURCE LINES 123-127
.. code-block:: Python
Expand All @@ -299,12 +298,12 @@ With Symlet - *sym4*
.. GENERATED FROM PYTHON SOURCE LINES 129-131
.. GENERATED FROM PYTHON SOURCE LINES 128-130
With Coiflet - *coif4*
-----------------------

.. GENERATED FROM PYTHON SOURCE LINES 131-133
.. GENERATED FROM PYTHON SOURCE LINES 130-132
.. code-block:: Python
Expand All @@ -331,7 +330,7 @@ With Coiflet - *coif4*
.. rst-class:: sphx-glr-timing

**Total running time of the script:** (0 minutes 0.800 seconds)
**Total running time of the script:** (0 minutes 0.744 seconds)


.. _sphx_glr_download_auto_examples_wavelet_analysis_plot_sp_wavelet_filtering_example.py:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

Computation times
=================
**00:00.800** total execution time for 2 files **from auto_examples/wavelet_analysis**:
**00:00.744** total execution time for 2 files **from auto_examples/wavelet_analysis**:

.. container::

Expand All @@ -33,7 +33,7 @@ Computation times
- Time
- Mem (MB)
* - :ref:`sphx_glr_auto_examples_wavelet_analysis_plot_sp_wavelet_filtering_example.py` (``plot_sp_wavelet_filtering_example.py``)
- 00:00.800
- 00:00.744
- 0.0
* - :ref:`sphx_glr_auto_examples_wavelet_analysis_plot_sp_scalogram_cwt_example.py` (``plot_sp_scalogram_cwt_example.py``)
- 00:00.000
Expand Down
28 changes: 17 additions & 11 deletions _sources/modules/sp_cwt.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -295,29 +295,33 @@ Admiddibility const :math:`C_{\psi} =\frac{1}{n}` and :math:`w = 2\pi f`

.. math::
\psi(t) &= \frac{1}{\pi} \frac{1-t^2}{(1+t^2)^2}\\
\psi(t) &= p(t) + \frac{d}{dt}p(t)\\
\psi(t) &= \frac{1}{\pi} \frac{1-t^2}{(1+t^2)^2}
\psi(t) &= p(t) + \frac{d}{dt}p(t)
\psi(w) &= |w|e^{-|w|}
**where**
.

.. math::
.. math::
p(t) &=\frac{1}{\pi}\frac{1}{1+t^2}\\
w &= 2\pi f
p(t) &=\frac{1}{\pi}\frac{1}{1+t^2}
w &= 2\pi f
>>> XW,S = sp.cwt.ScalogramCWT(x,t,fs=fs,,wType='Poisson',method = 2,PlotPSD=True)
>>> XW,S = sp.cwt.ScalogramCWT(x,t,fs=fs,,wType='Poisson',method = 2,PlotPSD=True)


#Type 3 (n)
~~~~~~~~~~

.. math::
\psi(t) &= \frac{1}{2\pi}(1-jt)^{-(n+1)}\\
\psi(t) &= \frac{1}{2\pi}(1-jt)^{-(n+1)}
\psi(w) &= \frac{1}{\Gamma{n+1}}w^{n}e^{-w}u(w)
Expand All @@ -326,13 +330,15 @@ Admiddibility const :math:`C_{\psi} =\frac{1}{n}` and :math:`w = 2\pi f`

.. math::
\text{unit step function }\quad u(w) &=1 \quad \text{ if $w>=0$ }\quad \text{else } 0\\
\text{unit step function }\quad u(w) &=1 \quad \text{ if $w>=0$ }\quad \text{else } 0
w &= 2\pi f
>>> XW,S = sp.cwt.ScalogramCWT(x,t,fs=fs,wType='Poisson',method = 3,PlotPSD=True)
>>> XW,S = sp.cwt.ScalogramCWT(x,t,fs=fs,wType='Poisson',method = 3,PlotPSD=True)

#TODO

Expand Down
21 changes: 13 additions & 8 deletions _sources/modules/sp_dwt.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Wavelet Filtering & Shrinkage
Other than classical spectral filtering, Wavelet filtering is one of common techniques used in signal processing.
It allows to filter out short-time duration patterns captured by used wavelet. The patterns to be filtered out depends
on the wavelet family (e.g. *db3*) used and number of level of decomposition.
Algorithmically, it is very straightforward. Decompose a signal :math:`x(n)`, into wavelet coefficients :math:`X(k):math:`,
Algorithmically, it is very straightforward. Decompose a signal :math:`x(n)`, into wavelet coefficients :math:`X(k)`,
where each coefficient represents the strength of wavelet pattern at particular time. With some threshold,
remove the coefficients by zeroing out and reconstruct the signal back.

Expand All @@ -37,8 +37,10 @@ where :math:`\tilde{\sigma}` is estimation of noise variance and :math:`N` lengt
and :math:`X(k)` are wavelet coeffients of :math:`x(n)`

There are other methods to choose threshold too. One can choose a
* :math:`\theta =1.5\times SD(X(k))` or
* :math:`\theta =IQR(X(k))`

* :math:`\theta =1.5\times SD(X(k))` or
* :math:`\theta =IQR(X(k))`

as to select the outliers, by standard deviation and interquartile range, respectively.

According to the theory, the **optimal threshold** should be applied by zeroing out the coefficients
Expand All @@ -55,21 +57,22 @@ A simple block-diagram shown below is the procedure of wavelet filtering.


**References:**
* [1] D.L. Donoho, J.M. Johnstone, **Ideal spatial adaptation by wavelet shrinkage** Biometrika, 81 (1994), pp. 425-455

* [1] D.L. Donoho, J.M. Johnstone, *Ideal spatial adaptation by wavelet shrinkage* Biometrika, 81 (1994), pp. 425-455


**API**

* **spkit.wavelet_filtering(...)**
* **spkit.wavelet_filtering_win(...)**
* :func:`spkit.wavelet_filtering`
* :func:`spkit.wavelet_filtering_win`

In ***spkit***, we have implemented all three methods for threshold computing, can be chosen by *threshold = 'optimal',
'sd' or 'iqr'* or can be passed as a float value for a fixed threshold, e.g. *threshold = 0.5*. It also support to choose,
if you want to zero out coefficient below the threshold or above by setting *filter_out_below* True or False.
However, default setting is *threshold='optimal'* and *filter_out_below=True*.

There are a few more options to tune threshold and mode of filtering.
For more details see doc section or run :func:`sp.wavelet_filtering`
For more details see doc section or run :func:`spkit.wavelet_filtering`



Expand Down Expand Up @@ -112,10 +115,12 @@ Wavelet decomposed signals
plt.show()


`Check Example here<../modules/generated/spkit.wavelet_decomposed_signals.html>`_
.. raw:: html

<a href = "../modules/generated/spkit.wavelet_decomposed_signals.html" target="_blank">Check Example here</a>


Check Example here :func:`spkit.wavelet_decomposed_signals`

Temporal analysis
==================
9 changes: 7 additions & 2 deletions _sources/modules/sp_filtering_drift.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
Drift Removing
==================

.. currentmodule:: spkit.core.processing
.. currentmodule:: spkit


While recording signal, it is very common to observe the baseline wondering
Expand All @@ -30,7 +30,7 @@ Filter out DC component - Remving drift using Recursive (IIR type) filter

.. math::
y[n] = \frac{(alpha-1)}{alpha} * ( x[n] - x[n-1] -y[n-1])
y[n] = \frac{(\alpha-1)}{\alpha} * ( x[n] - x[n-1] -y[n-1])
where :math:`y[-1] = x[0]`, :math:`x[-1] = x[0]`
resulting :math:`y[0] = 0`
Expand All @@ -49,6 +49,7 @@ Filter out DC component - Remving drift using Recursive (IIR type) filter
xf = sp.filterDC(x,alpha=256,return_background=False)


check : :func:`filterDC`

Spectral filter - IIR Filters
=============================
Expand All @@ -64,6 +65,9 @@ A common approach to remove drift is also to use spectral filtering such as butt
xf = sp.filter_X(x.copy(),fs=128.0, band=[0.5], btype='highpass',ftype='SOS')


check : :func:`filter_X`


Savitzky-Golay filter
=====================

Expand All @@ -86,3 +90,4 @@ Filter out DC component using Savitzky-Golay filter
xf = sp.filterDC_sGolay(x,window_length=127, polyorder=3)


check : :func:`filterDC_sGolay`
4 changes: 2 additions & 2 deletions _sources/sg_execution_times.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

Computation times
=================
**00:00.800** total execution time for 34 files **from all galleries**:
**00:00.744** total execution time for 34 files **from all galleries**:

.. container::

Expand All @@ -33,7 +33,7 @@ Computation times
- Time
- Mem (MB)
* - :ref:`sphx_glr_auto_examples_wavelet_analysis_plot_sp_wavelet_filtering_example.py` (``../examples/wavelet_analysis/plot_sp_wavelet_filtering_example.py``)
- 00:00.800
- 00:00.744
- 0.0
* - :ref:`sphx_glr_auto_examples_electroencephalogram_plot_sp_ATAR_algorithm_tuning.py` (``../examples/electroencephalogram/plot_sp_ATAR_algorithm_tuning.py``)
- 00:00.000
Expand Down
4 changes: 2 additions & 2 deletions _sources/user_guide.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ User Guide

.. seealso:: User Guide - API

**User Guide is in continues development. It is not complete yet, we are keep updating the contents.**
Please check API: :ref:`api_ref`, which is the most complete documentation of spkit.
**User Guide is in a continues development. It is not a complete guide yet, we are keep updating the contents.**
For now, please check the API: :ref:`api_ref`, which is the most complete documentation of all the functions and modules.



Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<meta property="og:url" content="https://spkit.github.io/auto_examples/wavelet_analysis/plot_sp_wavelet_filtering_example.html" />
<meta property="og:site_name" content="spkit" />
<meta property="og:description" content="Background Other than classical spectral filtering, Wavelet filtering is one of common techniques used in signal processing. It allows to filter out short-time duration patterns captured by used wa..." />
<meta property="og:image" content="https://raw.githubusercontent.com/spkit/images/master/extra/images/wavelet_filtering_block_dia_1.png" />
<meta property="og:image" content="https://raw.githubusercontent.com/spkit/images/master/extra/wavelet_filtering_block_dia_1.png" />
<meta property="og:image:alt" content="spkit" />
<meta name="description" content="Background Other than classical spectral filtering, Wavelet filtering is one of common techniques used in signal processing. It allows to filter out short-time duration patterns captured by used wa..." />

Expand Down Expand Up @@ -295,7 +295,7 @@ <h4><i>Simple and easy to use for signal analysis and predictive analysis</i></h
since they reprepresent the outliers. However, some of the (weired) articles use these thresholds in other-way round.</p>
<p>A simple block-diagram shown below is the procedure of wavelet filtering.</p>
<figure class="align-center">
<a class="reference internal image-reference" href="https://raw.githubusercontent.com/spkit/images/master/extra/images/wavelet_filtering_block_dia_1.png"><img alt="https://raw.githubusercontent.com/spkit/images/master/extra/images/wavelet_filtering_block_dia_1.png" src="https://raw.githubusercontent.com/spkit/images/master/extra/images/wavelet_filtering_block_dia_1.png" /></a>
<a class="reference internal image-reference" href="https://raw.githubusercontent.com/spkit/images/master/extra/wavelet_filtering_block_dia_1.png"><img alt="https://raw.githubusercontent.com/spkit/images/master/extra/wavelet_filtering_block_dia_1.png" src="https://raw.githubusercontent.com/spkit/images/master/extra/wavelet_filtering_block_dia_1.png" /></a>
</figure>
<dl class="simple">
<dt><strong>References:</strong></dt><dd><ul class="simple">
Expand All @@ -315,7 +315,7 @@ <h4><i>Simple and easy to use for signal analysis and predictive analysis</i></h
if you want to zero out coefficient below the threshold or above by setting <em>filter_out_below</em> True or False.
However, default setting is <em>threshold=’optimal’</em> and <em>filter_out_below=True</em>.</p>
<p>There are a few more options to tune threshold and mode of filtering.
For more details see doc section or run <code class="xref py py-func docutils literal notranslate"><span class="pre">sp.wavelet_filtering</span></code></p>
For more details see doc section or run <a class="reference internal" href="../../modules/generated/spkit.wavelet_filtering.html#spkit.wavelet_filtering" title="spkit.wavelet_filtering"><code class="xref py py-func docutils literal notranslate"><span class="pre">spkit.wavelet_filtering</span></code></a></p>
<div class="highlight-Python notranslate"><div class="highlight"><pre><span></span><span class="kn">import</span> <span class="nn">numpy</span> <span class="k">as</span> <span class="nn">np</span>
<span class="kn">import</span> <span class="nn">matplotlib.pyplot</span> <span class="k">as</span> <span class="nn">plt</span>
<span class="kn">import</span> <span class="nn">spkit</span> <span class="k">as</span> <span class="nn">sp</span>
Expand Down Expand Up @@ -390,7 +390,7 @@ <h2>With Coiflet - <em>coif4</em><a class="headerlink" href="#with-coiflet-coif4
<img src="../../_images/sphx_glr_plot_sp_wavelet_filtering_example_007.png" srcset="../../_images/sphx_glr_plot_sp_wavelet_filtering_example_007.png" alt="plot sp wavelet filtering example" class = "sphx-glr-single-img"/><div class="sphx-glr-script-out highlight-none notranslate"><div class="highlight"><pre><span></span>WPD: False wv: coif4 threshold: optimal k: 1.5 mode: elim filter_out_below?: True
</pre></div>
</div>
<p class="sphx-glr-timing"><strong>Total running time of the script:</strong> (0 minutes 0.800 seconds)</p>
<p class="sphx-glr-timing"><strong>Total running time of the script:</strong> (0 minutes 0.744 seconds)</p>
<div class="sphx-glr-footer sphx-glr-footer-example docutils container" id="sphx-glr-download-auto-examples-wavelet-analysis-plot-sp-wavelet-filtering-example-py">
<div class="binder-badge docutils container">
<a class="reference external image-reference" href="https://mybinder.org/v2/gh/spkit/spkit/0.9.X?urlpath=lab/tree/notebooks/auto_examples/wavelet_analysis/plot_sp_wavelet_filtering_example.ipynb"><img alt="Launch binder" src="../../_images/binder_badge_logo7.svg" width="150px" /></a>
Expand Down
Loading

0 comments on commit 9979b7a

Please sign in to comment.