Skip to content

Commit

Permalink
Process towards further signal analysis
Browse files Browse the repository at this point in the history
  • Loading branch information
daquintero committed Sep 19, 2024
1 parent bb93005 commit 28373df
Show file tree
Hide file tree
Showing 23 changed files with 360 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import piel
import piel.experimental as pe
import piel.analysis.signals.time_data as tda
from piel.models.physical.electrical import E8364A, cables
from datetime import datetime

Expand Down Expand Up @@ -642,8 +643,58 @@ def calibration_propagation_delay_experiment(

# `piel.analysis` also provides some functionality to analyse the corresponding time-data accordingly.
#
# For example, we might want to extract only the rising edge section of the signals:
# For example, we might want to extract only the rising edge section of one of the measured signals:

piel.analysis.signals.time_data
example_signal = calibration_propagation_delay_experiment_data.data.collection[
3
].dut_waveform
example_signal_measurements = (
calibration_propagation_delay_experiment_data.data.collection[3].measurements
)

help(tda.extract_rising_edges)

example_signal_rising_edge_list = tda.extract_rising_edges(
signal=example_signal, lower_threshold_ratio=0.1, upper_threshold_ratio=0.9
)

# We can, for example, plot all these signals overlaid on top of each other - easily by just offsetting to a base reference time:

dir(piel)
offset_example_signal_rising_edge_list = tda.offset_time_signals(
example_signal_rising_edge_list
)

piel.visual.plot.signals.plot_multi_data_time_signal(
offset_example_signal_rising_edge_list
)

# We can technically also extract some statistical metrics from this data which we could use to compare with the measured statistics:

offset_example_signal_rising_edge_metrics = tda.extract_rising_edge_statistical_metrics(
offset_example_signal_rising_edge_list
)
offset_example_signal_rising_edge_metrics.table

# | | Metric | Value |
# |---:|:-------------------|------------:|
# | 0 | Value | 0.020914 |
# | 1 | Mean | 0.020914 |
# | 2 | Min | -0.108703 |
# | 3 | Max | 0.150609 |
# | 4 | Standard Deviation | 0.00727889 |
# | 5 | Count | 17 |

# We could now compare this to the metrics the oscilloscope calculated for us previously:

example_signal_measurements["pk-pk_ch2__v"].table

# | | Metric | Value |
# |---:|:-------------------|:-------------------|
# | 0 | Value | 0.274796879094793 |
# | 1 | Mean | 0.276517693380144 |
# | 2 | Min | 0.02445312536438 |
# | 3 | Max | 0.345625005150214 |
# | 4 | Standard Deviation | 0.0039634275277739 |
# | 5 | Count | 9.91k |

# We can see the measurements are approximately close enough which is pretty cool! I would still trust the device measurements more, but with this functionality it is possible to compare a given waveform to a stastistical output from a machine.
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@
"min": 0,
"max": 0,
"standard_deviation": 0,
"count": null,
"unit": {
"name": "second",
"datum": "second",
Expand Down Expand Up @@ -111,6 +112,7 @@
"min": 0,
"max": 0,
"standard_deviation": 0,
"count": null,
"unit": {
"name": "second",
"datum": "second",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@
"min": 0,
"max": 0,
"standard_deviation": 0,
"count": null,
"unit": {
"name": "second",
"datum": "second",
Expand Down Expand Up @@ -111,6 +112,7 @@
"min": 0,
"max": 0,
"standard_deviation": 0,
"count": null,
"unit": {
"name": "second",
"datum": "second",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@
"min": 0,
"max": 0,
"standard_deviation": 0,
"count": null,
"unit": {
"name": "second",
"datum": "second",
Expand Down Expand Up @@ -111,6 +112,7 @@
"min": 0,
"max": 0,
"standard_deviation": 0,
"count": null,
"unit": {
"name": "second",
"datum": "second",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@
"min": 0,
"max": 0,
"standard_deviation": 0,
"count": null,
"unit": {
"name": "second",
"datum": "second",
Expand Down Expand Up @@ -111,6 +112,7 @@
"min": 0,
"max": 0,
"standard_deviation": 0,
"count": null,
"unit": {
"name": "second",
"datum": "second",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@
"min": 0,
"max": 0,
"standard_deviation": 0,
"count": null,
"unit": {
"name": "second",
"datum": "second",
Expand Down Expand Up @@ -116,6 +117,7 @@
"min": 0,
"max": 0,
"standard_deviation": 0,
"count": null,
"unit": {
"name": "second",
"datum": "second",
Expand Down Expand Up @@ -216,6 +218,7 @@
"min": 0,
"max": 0,
"standard_deviation": 0,
"count": null,
"unit": {
"name": "second",
"datum": "second",
Expand Down Expand Up @@ -246,6 +249,7 @@
"min": 0,
"max": 0,
"standard_deviation": 0,
"count": null,
"unit": {
"name": "second",
"datum": "second",
Expand Down Expand Up @@ -346,6 +350,7 @@
"min": 0,
"max": 0,
"standard_deviation": 0,
"count": null,
"unit": {
"name": "second",
"datum": "second",
Expand Down Expand Up @@ -376,6 +381,7 @@
"min": 0,
"max": 0,
"standard_deviation": 0,
"count": null,
"unit": {
"name": "second",
"datum": "second",
Expand Down Expand Up @@ -476,6 +482,7 @@
"min": 0,
"max": 0,
"standard_deviation": 0,
"count": null,
"unit": {
"name": "second",
"datum": "second",
Expand Down Expand Up @@ -506,6 +513,7 @@
"min": 0,
"max": 0,
"standard_deviation": 0,
"count": null,
"unit": {
"name": "second",
"datum": "second",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@
"min": 0,
"max": 0,
"standard_deviation": 0,
"count": null,
"unit": {
"name": "second",
"datum": "second",
Expand Down Expand Up @@ -111,6 +112,7 @@
"min": 0,
"max": 0,
"standard_deviation": 0,
"count": null,
"unit": {
"name": "second",
"datum": "second",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@
"min": 0,
"max": 0,
"standard_deviation": 0,
"count": null,
"unit": {
"name": "second",
"datum": "second",
Expand Down Expand Up @@ -111,6 +112,7 @@
"min": 0,
"max": 0,
"standard_deviation": 0,
"count": null,
"unit": {
"name": "second",
"datum": "second",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@
"min": 0,
"max": 0,
"standard_deviation": 0,
"count": null,
"unit": {
"name": "second",
"datum": "second",
Expand Down Expand Up @@ -111,6 +112,7 @@
"min": 0,
"max": 0,
"standard_deviation": 0,
"count": null,
"unit": {
"name": "second",
"datum": "second",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@
"min": 0,
"max": 0,
"standard_deviation": 0,
"count": null,
"unit": {
"name": "second",
"datum": "second",
Expand Down Expand Up @@ -111,6 +112,7 @@
"min": 0,
"max": 0,
"standard_deviation": 0,
"count": null,
"unit": {
"name": "second",
"datum": "second",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@
"min": 0,
"max": 0,
"standard_deviation": 0,
"count": null,
"unit": {
"name": "second",
"datum": "second",
Expand Down Expand Up @@ -116,6 +117,7 @@
"min": 0,
"max": 0,
"standard_deviation": 0,
"count": null,
"unit": {
"name": "second",
"datum": "second",
Expand Down Expand Up @@ -222,6 +224,7 @@
"min": 0,
"max": 0,
"standard_deviation": 0,
"count": null,
"unit": {
"name": "second",
"datum": "second",
Expand Down Expand Up @@ -252,6 +255,7 @@
"min": 0,
"max": 0,
"standard_deviation": 0,
"count": null,
"unit": {
"name": "second",
"datum": "second",
Expand Down Expand Up @@ -358,6 +362,7 @@
"min": 0,
"max": 0,
"standard_deviation": 0,
"count": null,
"unit": {
"name": "second",
"datum": "second",
Expand Down Expand Up @@ -388,6 +393,7 @@
"min": 0,
"max": 0,
"standard_deviation": 0,
"count": null,
"unit": {
"name": "second",
"datum": "second",
Expand Down Expand Up @@ -494,6 +500,7 @@
"min": 0,
"max": 0,
"standard_deviation": 0,
"count": null,
"unit": {
"name": "second",
"datum": "second",
Expand Down Expand Up @@ -524,6 +531,7 @@
"min": 0,
"max": 0,
"standard_deviation": 0,
"count": null,
"unit": {
"name": "second",
"datum": "second",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,7 @@
"min": 0,
"max": 0,
"standard_deviation": 0,
"count": null,
"unit": {
"name": "second",
"datum": "second",
Expand Down Expand Up @@ -193,6 +194,7 @@
"min": 0,
"max": 0,
"standard_deviation": 0,
"count": null,
"unit": {
"name": "second",
"datum": "second",
Expand Down Expand Up @@ -223,6 +225,7 @@
"min": 0,
"max": 0,
"standard_deviation": 0,
"count": null,
"unit": {
"name": "second",
"datum": "second",
Expand All @@ -234,7 +237,7 @@
"goal": "",
"parameters": {},
"index": 0,
"date_configured": "2024-09-19 23:02:49.605687",
"date_configured": "2024-09-20 00:34:16.673180",
"date_measured": "",
"measurement_configuration_list": [
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,7 @@
"min": 0,
"max": 0,
"standard_deviation": 0,
"count": null,
"unit": {
"name": "second",
"datum": "second",
Expand Down Expand Up @@ -193,6 +194,7 @@
"min": 0,
"max": 0,
"standard_deviation": 0,
"count": null,
"unit": {
"name": "second",
"datum": "second",
Expand Down Expand Up @@ -223,6 +225,7 @@
"min": 0,
"max": 0,
"standard_deviation": 0,
"count": null,
"unit": {
"name": "second",
"datum": "second",
Expand All @@ -234,7 +237,7 @@
"goal": "",
"parameters": {},
"index": 1,
"date_configured": "2024-09-19 23:02:49.605836",
"date_configured": "2024-09-20 00:34:16.673332",
"date_measured": "",
"measurement_configuration_list": [
{
Expand Down
Loading

0 comments on commit 28373df

Please sign in to comment.