Skip to content

Commit

Permalink
deploy: d048d7d
Browse files Browse the repository at this point in the history
  • Loading branch information
DominiqueMakowski committed Oct 2, 2023
1 parent 2f5e3f7 commit 8632bd6
Show file tree
Hide file tree
Showing 279 changed files with 384 additions and 559 deletions.
Binary file modified .doctrees/environment.pickle
Binary file not shown.
Binary file modified .doctrees/examples/bio_custom/bio_custom.doctree
Binary file not shown.
Binary file modified .doctrees/examples/bio_eventrelated/bio_eventrelated.doctree
Binary file not shown.
Binary file not shown.
Binary file modified .doctrees/examples/ecg_heartbeats/ecg_heartbeats.doctree
Binary file not shown.
Binary file modified .doctrees/examples/eda_peaks/eda_peaks.doctree
Binary file not shown.
Binary file modified .doctrees/examples/eeg_microstates/eeg_microstates.doctree
Binary file not shown.
Binary file modified .doctrees/examples/eeg_power/eeg_power.doctree
Binary file not shown.
Binary file modified .doctrees/examples/eog_analyze/eog_analyze.doctree
Binary file not shown.
Binary file modified .doctrees/examples/misc_epochs_create/misc_epochs_create.doctree
Binary file not shown.
Binary file modified .doctrees/examples/misc_fit_function/misc_fit_function.doctree
Binary file not shown.
Binary file modified .doctrees/examples/signal_simulation/signal_simulation.doctree
Binary file not shown.
Binary file modified .doctrees/functions/benchmark.doctree
Binary file not shown.
Binary file modified .doctrees/functions/bio.doctree
Binary file not shown.
Binary file modified .doctrees/functions/complexity.doctree
Binary file not shown.
Binary file modified .doctrees/functions/ecg.doctree
Binary file not shown.
Binary file modified .doctrees/functions/eda.doctree
Binary file not shown.
Binary file modified .doctrees/functions/emg.doctree
Binary file not shown.
Binary file modified .doctrees/functions/events.doctree
Binary file not shown.
Binary file modified .doctrees/functions/markov.doctree
Binary file not shown.
Binary file modified .doctrees/functions/misc.doctree
Binary file not shown.
Binary file modified .doctrees/functions/ppg.doctree
Binary file not shown.
Binary file modified .doctrees/functions/rsp.doctree
Binary file not shown.
Binary file modified .doctrees/functions/signal.doctree
Binary file not shown.
Binary file modified .doctrees/functions/stats.doctree
Binary file not shown.
Binary file modified .doctrees/studies/complexity_eeg.doctree
Binary file not shown.
Binary file modified .doctrees/studies/ecg_benchmark.doctree
Binary file not shown.
Binary file modified .doctrees/studies/eog_blinktemplate.doctree
Binary file not shown.
Binary file modified .doctrees/studies/erp_gam.doctree
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Binary file modified _images/entropy_power2.png
Diff not rendered.
Diff not rendered.
Diff not rendered.
Binary file modified _images/p_bio_process1.png
Binary file modified _images/p_cluster_findnumber1.png
Binary file modified _images/p_complexity1.png
Binary file modified _images/p_complexity2.png
Binary file modified _images/p_complexity_coarsegraining2.png
Binary file modified _images/p_complexity_coarsegraining3.png
Binary file removed _images/p_complexity_decorrelation1.png
Diff not rendered.
Binary file modified _images/p_complexity_delay1.png
Binary file modified _images/p_complexity_delay10.png
Binary file modified _images/p_complexity_delay2.png
Binary file modified _images/p_complexity_delay3.png
Binary file modified _images/p_complexity_delay4.png
Binary file modified _images/p_complexity_delay5.png
Binary file modified _images/p_complexity_delay6.png
Binary file modified _images/p_complexity_delay7.png
Binary file modified _images/p_complexity_delay8.png
Binary file modified _images/p_complexity_delay9.png
Binary file modified _images/p_complexity_dimension1.png
Binary file modified _images/p_complexity_dimension2.png
Binary file modified _images/p_complexity_dimension3.png
Binary file modified _images/p_complexity_k1.png
Binary file modified _images/p_complexity_lempelziv1.png
Binary file modified _images/p_complexity_lempelziv2.png
Binary file removed _images/p_complexity_lyapunov1.png
Diff not rendered.
Binary file removed _images/p_complexity_lyapunov2.png
Diff not rendered.
Binary file modified _images/p_complexity_rqa1.png
Binary file modified _images/p_complexity_simulate3.png
Binary file modified _images/p_complexity_simulate4.png
Binary file modified _images/p_complexity_simulate7.png
Binary file modified _images/p_complexity_simulate8.png
Binary file modified _images/p_complexity_symbolize10.png
Binary file modified _images/p_complexity_symbolize11.png
Binary file modified _images/p_complexity_symbolize4.png
Binary file modified _images/p_complexity_symbolize5.png
Binary file modified _images/p_complexity_symbolize6.png
Binary file modified _images/p_complexity_symbolize7.png
Binary file modified _images/p_complexity_symbolize8.png
Binary file modified _images/p_complexity_symbolize9.png
Binary file modified _images/p_density1.png
Binary file modified _images/p_density2.png
Binary file modified _images/p_density_bandwidth.png
Binary file modified _images/p_ecg_clean.png
Binary file modified _images/p_ecg_delineate1.png
Binary file modified _images/p_ecg_invert1.png
Binary file modified _images/p_ecg_peaks1.png
Binary file modified _images/p_ecg_peaks2.png
Binary file modified _images/p_ecg_peaks3.png
Binary file modified _images/p_ecg_plot.png
Binary file modified _images/p_ecg_process.png
Binary file modified _images/p_ecg_quality.png
Binary file modified _images/p_ecg_segment.png
Binary file modified _images/p_ecg_simulate1.png
Binary file modified _images/p_ecg_simulate2.png
Binary file modified _images/p_eda_changepoints1.png
Binary file modified _images/p_eda_clean.png
Binary file modified _images/p_eda_findpeaks.png
Binary file modified _images/p_eda_fixpeaks.png
Binary file modified _images/p_eda_peaks.png
Binary file modified _images/p_eda_phasic1.png
Binary file modified _images/p_eda_plot1.png
Binary file modified _images/p_eda_process.png
Binary file modified _images/p_eda_simulate1.png
Binary file modified _images/p_eeg_simulate1.png
Binary file modified _images/p_emg_activation1.png
Binary file modified _images/p_emg_activation2.png
Binary file modified _images/p_emg_activation3.png
Binary file modified _images/p_emg_activation4.png
Binary file modified _images/p_emg_amplitude1.png
Binary file modified _images/p_emg_clean1.png
Binary file modified _images/p_emg_plot.png
Binary file modified _images/p_emg_process1.png
Binary file modified _images/p_emg_simulate1.png
Binary file modified _images/p_entropy_attention1.png
Binary file modified _images/p_entropy_grid1.png
Binary file modified _images/p_entropy_grid2.png
Binary file modified _images/p_entropy_hierarchical1.png
Binary file modified _images/p_entropy_increment1.png
Binary file modified _images/p_entropy_phase1.png
Binary file modified _images/p_entropy_phase2.png
Binary file modified _images/p_entropy_shannon1.png
Binary file modified _images/p_entropy_slope1.png
Binary file modified _images/p_entropy_spectral1.png
Binary file modified _images/p_entropy_spectral2.png
Binary file modified _images/p_entropy_symbolicdynamic1.png
Binary file modified _images/p_entropy_symbolicdynamic2.png
Binary file modified _images/p_epochs_average1.png
Binary file modified _images/p_epochs_plot2.png
Binary file modified _images/p_events_plot4.png
Binary file modified _images/p_find_plateau1.png
Binary file modified _images/p_fit_loess1.png
Binary file modified _images/p_fractal_density1.png
Binary file modified _images/p_fractal_density2.png
Binary file modified _images/p_fractal_density3.png
Binary file modified _images/p_fractal_dfa1.png
Binary file modified _images/p_fractal_dfa2.png
Binary file modified _images/p_fractal_dfa3.png
Binary file modified _images/p_fractal_higuchi1.png
Binary file modified _images/p_fractal_higuchi2.png
Binary file modified _images/p_fractal_mandelbrot4.png
Binary file modified _images/p_fractal_mandelbrot5.png
Binary file modified _images/p_fractal_psdslope1.png
Binary file modified _images/p_fractal_tmf.png
Binary file modified _images/p_hdi1.png
Binary file modified _images/p_information_mutual1.png
Binary file modified _images/p_katz.png
Binary file modified _images/p_microstate_segment1.png
Binary file modified _images/p_microstate_segment4.png
Binary file modified _images/p_microstates_classify.png
Binary file modified _images/p_microstates_findnumber1.png
Binary file modified _images/p_microstates_plot1.png
Binary file modified _images/p_nld1.png
Binary file modified _images/p_ppg_clean1.png
Binary file modified _images/p_ppg_findpeaks1.png
Binary file modified _images/p_ppg_findpeaks2.png
Binary file modified _images/p_ppg_peaks1.png
Binary file modified _images/p_ppg_peaks2.png
Binary file modified _images/p_ppg_peaks3.png
Binary file modified _images/p_ppg_plot1.png
Binary file modified _images/p_ppg_process1.png
Binary file modified _images/p_ppg_segment.png
Binary file modified _images/p_recurrence_matrix1.png
Binary file modified _images/p_recurrence_matrix2.png
Binary file modified _images/p_recurrence_matrix3.png
Binary file modified _images/p_recurrence_matrix4.png
Binary file modified _images/p_rsp_amp1.png
Binary file modified _images/p_rsp_amp2.png
Binary file modified _images/p_rsp_clean1.png
Binary file modified _images/p_rsp_findpeaks1.png
Binary file modified _images/p_rsp_fixpeaks1.png
Binary file modified _images/p_rsp_peaks1.png
Binary file modified _images/p_rsp_phase1.png
Binary file modified _images/p_rsp_plot1.png
Binary file modified _images/p_rsp_process_1.png
Binary file modified _images/p_rsp_simulate1.png
Binary file modified _images/p_rsp_symmetry1.png
Binary file modified _images/p_signal_autocor2.png
Binary file removed _images/p_signal_autocor3.png
Diff not rendered.
Binary file modified _images/p_signal_changepoints1.png
Binary file modified _images/p_signal_decompose1.png
Binary file modified _images/p_signal_decompose2.png
Binary file modified _images/p_signal_decompose3.png
Binary file modified _images/p_signal_distort2.png
Binary file modified _images/p_signal_filter3.png
Binary file modified _images/p_signal_fixpeaks1.png
Binary file modified _images/p_signal_fixpeaks2.png
Binary file modified _images/p_signal_noise1.png
Binary file modified _images/p_signal_noise2.png
Binary file modified _images/p_signal_period.png
Binary file modified _images/p_signal_power1.png
Binary file modified _images/p_signal_psd1.png
Binary file modified _images/p_signal_psd2.png
Binary file modified _images/p_signal_psd3.png
Binary file modified _images/p_signal_psd4.png
Binary file modified _images/p_signal_psd5.png
Binary file modified _images/p_signal_recompose1.png
Binary file modified _images/p_signal_smooth1.png
Binary file modified _images/p_signal_smooth2.png
Binary file modified _images/p_signal_surrogate1.png
Binary file modified _images/p_signal_surrogate2.png
Binary file modified _images/p_signal_surrogate3.png
Binary file modified _images/p_summary1.png
35 changes: 6 additions & 29 deletions _modules/neurokit2/complexity/complexity_decorrelation.html
Original file line number Diff line number Diff line change
Expand Up @@ -360,14 +360,13 @@ <h1></h1>
<article class="bd-article" role="main">

<h1>Source code for neurokit2.complexity.complexity_decorrelation</h1><div class="highlight"><pre>
<span></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">numpy</span> <span class="k">as</span> <span class="nn">np</span>
<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">pandas</span> <span class="k">as</span> <span class="nn">pd</span>

<span class="kn">from</span> <span class="nn">..signal</span> <span class="kn">import</span> <span class="n">signal_autocor</span>


<div class="viewcode-block" id="complexity_decorrelation"><a class="viewcode-back" href="../../../functions/complexity.html#neurokit2.complexity.complexity_decorrelation">[docs]</a><span class="k">def</span> <span class="nf">complexity_decorrelation</span><span class="p">(</span><span class="n">signal</span><span class="p">,</span> <span class="n">show</span><span class="o">=</span><span class="kc">False</span><span class="p">):</span>
<div class="viewcode-block" id="complexity_decorrelation"><a class="viewcode-back" href="../../../functions/complexity.html#neurokit2.complexity.complexity_decorrelation">[docs]</a><span class="k">def</span> <span class="nf">complexity_decorrelation</span><span class="p">(</span><span class="n">signal</span><span class="p">):</span>
<span class="w"> </span><span class="sd">&quot;&quot;&quot;**Decorrelation Time (DT)**</span>

<span class="sd"> The decorrelation time (DT) is defined as the time (in samples) of the first zero crossing of</span>
Expand All @@ -380,8 +379,6 @@ <h1>Source code for neurokit2.complexity.complexity_decorrelation</h1><div class
<span class="sd"> ----------</span>
<span class="sd"> signal : Union[list, np.array, pd.Series]</span>
<span class="sd"> The signal (i.e., a time series) in the form of a vector of values.</span>
<span class="sd"> show : bool</span>
<span class="sd"> If True, will return a plot of the autocorrelation.</span>

<span class="sd"> Returns</span>
<span class="sd"> -------</span>
Expand All @@ -401,15 +398,11 @@ <h1>Source code for neurokit2.complexity.complexity_decorrelation</h1><div class

<span class="sd"> import neurokit2 as nk</span>

<span class="sd"> # Simulate a signal</span>
<span class="sd"> signal = nk.signal_simulate(duration=5, sampling_rate=100, frequency=[5, 6], noise=0.5)</span>
<span class="sd"> # Simulate a signal with duration os 2s</span>
<span class="sd"> signal = nk.signal_simulate(duration=2, frequency=[5, 9, 12])</span>

<span class="sd"> # Compute DT</span>
<span class="sd"> @savefig p_complexity_decorrelation1.png scale=100%</span>
<span class="sd"> dt, _ = nk.complexity_decorrelation(signal, show=True)</span>
<span class="sd"> @suppress</span>
<span class="sd"> plt.close()</span>

<span class="sd"> dt, _ = nk.complexity_decorrelation(signal)</span>
<span class="sd"> dt</span>

<span class="sd"> References</span>
Expand All @@ -429,30 +422,14 @@ <h1>Source code for neurokit2.complexity.complexity_decorrelation</h1><div class
<span class="p">)</span>

<span class="c1"># Unbiased autocor (see https://github.com/mne-tools/mne-features/)</span>
<span class="n">autocor</span><span class="p">,</span> <span class="n">_</span> <span class="o">=</span> <span class="n">signal_autocor</span><span class="p">(</span><span class="n">signal</span><span class="p">,</span> <span class="n">unbiased</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span>
<span class="n">autocor</span><span class="p">,</span> <span class="n">_</span> <span class="o">=</span> <span class="n">signal_autocor</span><span class="p">(</span><span class="n">signal</span><span class="p">,</span> <span class="n">method</span><span class="o">=</span><span class="s2">&quot;unbiased&quot;</span><span class="p">)</span>

<span class="c1"># Get zero-crossings</span>
<span class="n">zc</span> <span class="o">=</span> <span class="n">np</span><span class="o">.</span><span class="n">diff</span><span class="p">(</span><span class="n">np</span><span class="o">.</span><span class="n">sign</span><span class="p">(</span><span class="n">autocor</span><span class="p">))</span> <span class="o">!=</span> <span class="mi">0</span>
<span class="k">if</span> <span class="n">np</span><span class="o">.</span><span class="n">any</span><span class="p">(</span><span class="n">zc</span><span class="p">):</span>
<span class="n">dt</span> <span class="o">=</span> <span class="n">np</span><span class="o">.</span><span class="n">argmax</span><span class="p">(</span><span class="n">zc</span><span class="p">)</span> <span class="o">+</span> <span class="mi">1</span>
<span class="k">else</span><span class="p">:</span>
<span class="n">dt</span> <span class="o">=</span> <span class="o">-</span><span class="mi">1</span>

<span class="k">if</span> <span class="n">show</span> <span class="ow">is</span> <span class="kc">True</span><span class="p">:</span>
<span class="c1"># Max length of autocorrelation to plot</span>
<span class="n">max_len</span> <span class="o">=</span> <span class="nb">int</span><span class="p">(</span><span class="n">dt</span> <span class="o">*</span> <span class="mi">4</span><span class="p">)</span>
<span class="k">if</span> <span class="n">max_len</span> <span class="o">&gt;</span> <span class="nb">len</span><span class="p">(</span><span class="n">autocor</span><span class="p">):</span>
<span class="n">max_len</span> <span class="o">=</span> <span class="nb">len</span><span class="p">(</span><span class="n">autocor</span><span class="p">)</span>

<span class="n">plt</span><span class="o">.</span><span class="n">plot</span><span class="p">(</span><span class="n">autocor</span><span class="p">[</span><span class="mi">0</span><span class="p">:</span><span class="n">max_len</span><span class="p">])</span>
<span class="n">plt</span><span class="o">.</span><span class="n">xlabel</span><span class="p">(</span><span class="s2">&quot;Lag&quot;</span><span class="p">)</span>
<span class="n">plt</span><span class="o">.</span><span class="n">ylabel</span><span class="p">(</span><span class="s2">&quot;Autocorrelation&quot;</span><span class="p">)</span>
<span class="n">plt</span><span class="o">.</span><span class="n">xticks</span><span class="p">(</span><span class="n">np</span><span class="o">.</span><span class="n">arange</span><span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="n">max_len</span><span class="p">,</span> <span class="n">step</span><span class="o">=</span><span class="n">dt</span><span class="p">)</span><span class="o">.</span><span class="n">astype</span><span class="p">(</span><span class="nb">int</span><span class="p">))</span>
<span class="n">plt</span><span class="o">.</span><span class="n">axvline</span><span class="p">(</span><span class="n">dt</span><span class="p">,</span> <span class="n">color</span><span class="o">=</span><span class="s2">&quot;red&quot;</span><span class="p">,</span> <span class="n">linestyle</span><span class="o">=</span><span class="s2">&quot;--&quot;</span><span class="p">,</span> <span class="n">label</span><span class="o">=</span><span class="sa">f</span><span class="s2">&quot;DT = </span><span class="si">{</span><span class="n">dt</span><span class="si">}</span><span class="s2">&quot;</span><span class="p">)</span>
<span class="n">plt</span><span class="o">.</span><span class="n">axhline</span><span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="n">color</span><span class="o">=</span><span class="s2">&quot;black&quot;</span><span class="p">,</span> <span class="n">linestyle</span><span class="o">=</span><span class="s2">&quot;--&quot;</span><span class="p">)</span>
<span class="n">plt</span><span class="o">.</span><span class="n">title</span><span class="p">(</span><span class="s2">&quot;Decorrelation Time (DT)&quot;</span><span class="p">)</span>
<span class="n">plt</span><span class="o">.</span><span class="n">legend</span><span class="p">()</span>

<span class="k">return</span> <span class="n">dt</span><span class="p">,</span> <span class="p">{}</span></div>
</pre></div>

Expand Down
Loading

0 comments on commit 8632bd6

Please sign in to comment.