.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "tutorials/widgets/plot_4_peaks_gallery.py" .. LINE NUMBERS ARE GIVEN BELOW. .. only:: html .. note:: :class: sphx-glr-download-link-note :ref:`Go to the end ` to download the full example code. .. rst-class:: sphx-glr-example-title .. _sphx_glr_tutorials_widgets_plot_4_peaks_gallery.py: Peaks Widgets Gallery ===================== Some widgets are useful before sorting and works with the "peaks" given by the detect_peaks() function. They are useful to check drift before running sorters. .. GENERATED FROM PYTHON SOURCE LINES 11-16 .. code-block:: Python import matplotlib.pyplot as plt import spikeinterface.full as si .. GENERATED FROM PYTHON SOURCE LINES 17-18 First, let's generate a simulated dataset .. GENERATED FROM PYTHON SOURCE LINES 18-21 .. code-block:: Python recording, sorting = si.generate_ground_truth_recording() .. GENERATED FROM PYTHON SOURCE LINES 22-23 Let's filter and detect peaks on it .. GENERATED FROM PYTHON SOURCE LINES 23-42 .. code-block:: Python from spikeinterface.sortingcomponents.peak_detection import detect_peaks rec_filtered = si.bandpass_filter(recording=recording, freq_min=300.0, freq_max=6000.0, margin_ms=5.0) print(rec_filtered) peaks = detect_peaks( recording=rec_filtered, method="locally_exclusive", peak_sign="neg", detect_threshold=6, exclude_sweep_ms=0.3, radius_um=100, noise_levels=None, random_chunk_kwargs={}, chunk_memory="10M", n_jobs=1, progress_bar=True, ) .. rst-class:: sphx-glr-script-out .. code-block:: none GroundTruthRecording (BandpassFilterRecording): 4 channels - 25.0kHz - 1 segments 250,000 samples - 10.00s - float32 dtype - 3.81 MiB noise_level (no parallelization): 0%| | 0/20 [00:00` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_4_peaks_gallery.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: plot_4_peaks_gallery.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_