Commit 3dd33c96 authored by Hafiz Emin Kosar's avatar Hafiz Emin Kosar
Browse files

Merge branch 'development-lab' of git.rwth-aachen.de:IENT/gdet3-demos into development-lab

parents 4a77b6f3 90c4a2ca
......@@ -11,41 +11,10 @@
from scipy import signal # convolution
from scipy.signal import find_peaks # peak finder
from ient_nb.ient_plots import *
from ient_nb.ient_signals import *
def find_intervals(s, thresh, delta):
"""
Find intervals of signal s by searching for delta-functions in the second derivative of s
Parameters
----------
s : array_like
The signal
thresh : float
Threshold for delta search
delta : float
Sampling period
Returns
-------
intervals_s, peaks, dd : *intervals* are the intervals, *peaks* the found peaks and *dd* the second derivative of s.
"""
# derivative of derivative shows delta functions at discontinuities
dd = np.diff(np.diff(s, prepend=0), prepend=0)/delta**2
# find delta functions
peaks, _ = find_peaks(np.abs(dd), prominence=thresh)
# return interval limits in seconds
intervals = np.round(tau[peaks]*10)/10
return intervals, peaks, dd
```
%% Cell type:markdown id: tags:
<div>
......@@ -280,6 +249,6 @@
%% Cell type:markdown id: tags:
This notebook is provided as [Open Educational Resource](https://en.wikipedia.org/wiki/Open_educational_resources) (OER). Feel free to use the notebook for your own purposes. The code is licensed under the [MIT license](https://opensource.org/licenses/MIT).
Please attribute the work as follows:
*Christian Rohlfing, Übungsbeispiele zur Vorlesung "Grundgebiete der Elektrotechnik 3 - Signale und Systeme"*, gehalten von Jens-Rainer Ohm, 2019, Institut für Nachrichtentechnik, RWTH Aachen University.
*Christian Rohlfing, Übungsbeispiele zur Vorlesung "Grundgebiete der Elektrotechnik 3 - Signale und Systeme"*, gehalten von Jens-Rainer Ohm, 2020, Institut für Nachrichtentechnik, RWTH Aachen University.
......
Subproject commit 0e50f13a97ece684661be60288bb08a4d0153907
Subproject commit 867b2ef335bb60a54da29a9361fd62193f7fabd9
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment