Skip to content

Commit

Permalink
3 add dual dirac model tail fitting (#133)
Browse files Browse the repository at this point in the history
* PyBERT jitter analysis improvements.

Rj has been converted to dual Dirac, but Pj is still based on spectral separation.

* First pull request for dual Dirac jitter decomposition.

Fixes #3.

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Added Jupyter notebook for testing new dual Dirac code.

* Semi-functional checkpoint, to preserve code changes made so far.

* Experiment w/ getting code alignment back.

I turned of the `black` hook in `.pre-commit-config.yaml`, to see if it was the one undoing my attempts at code alignment, and restored that alignment in the `pybert.utility.calc_jitter()` function.

* Removed white-space elimination by `black`.
Replaced "qt>=5" in `pyproject.toml`.
Brought back threshold plotting for jitter spectrums.
Added a utility function for making bathtub curves.
Added dual-Dirac calculations for Pj/Rj.

* Commented out `isort` portion of pre-commit config. file.

* Fixed broken DFE adaptation plotting.

* Updated PyAMI commit number.

* Restored original fix to DFE plotting breakage.

* Reverted name change: thresh => rel_thresh => thresh.

* OnJitterDecomposition notebook.

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
capn-freako and pre-commit-ci[bot] authored Dec 12, 2023
1 parent 3ea615f commit 0a486ac
Show file tree
Hide file tree
Showing 11 changed files with 1,883 additions and 611 deletions.
18 changes: 9 additions & 9 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
repos:
- repo: https://github.com/psf/black
rev: 23.11.0
hooks:
- id: black
- repo: https://github.com/pycqa/isort
rev: 5.13.1
hooks:
- id: isort
args: ["--profile", "black", "--filter-files"]
# - repo: https://github.com/psf/black
# rev: 23.11.0
# hooks:
# - id: black
# - repo: https://github.com/pycqa/isort
# rev: 5.13.1
# hooks:
# - id: isort
# args: ["--profile", "black", "--filter-files"]
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
hooks:
Expand Down
2 changes: 1 addition & 1 deletion PyAMI
8 changes: 0 additions & 8 deletions PyBERT.sublime-project

This file was deleted.

1,247 changes: 1,247 additions & 0 deletions misc/OnJitterDecomposition.ipynb

Large diffs are not rendered by default.

262 changes: 123 additions & 139 deletions misc/scikit-rf/S-param Check.ipynb

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ dependencies = [
"PyIBIS-AMI>=4.1.2",
"pyside2",
"pyyaml>=6",
"qt>=5",
"scikit-rf>=0.24.1",
]
keywords=["bert", "communication", "simulator"]
Expand Down
54 changes: 24 additions & 30 deletions src/pybert/gui/plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -420,38 +420,38 @@ def make_plots(self, n_dfe_taps):

# - Jitter Distributions tab
plot_jitter_dist_chnl = Plot(plotdata, padding_left=75)
plot_jitter_dist_chnl.plot(("jitter_bins", "jitter_chnl"), type="line", color="blue", name="Measured")
plot_jitter_dist_chnl.plot(("jitter_bins", "jitter_ext_chnl"), type="line", color="red", name="Extrapolated")
plot_jitter_dist_chnl.plot(("jitter_bins", "jitter_chnl"), type="line", color="blue", name="Total")
plot_jitter_dist_chnl.plot(("jitter_bins", "jitter_ext_chnl"), type="line", color="red", name="Data-Ind.")
plot_jitter_dist_chnl.title = post_chnl_str
plot_jitter_dist_chnl.index_axis.title = "Time (ps)"
plot_jitter_dist_chnl.value_axis.title = "Count"
plot_jitter_dist_chnl.value_axis.title = "PDF"
plot_jitter_dist_chnl.legend.visible = True
plot_jitter_dist_chnl.legend.align = "ur"

plot_jitter_dist_tx = Plot(plotdata, padding_left=75)
plot_jitter_dist_tx.plot(("jitter_bins", "jitter_tx"), type="line", color="blue", name="Measured")
plot_jitter_dist_tx.plot(("jitter_bins", "jitter_ext_tx"), type="line", color="red", name="Extrapolated")
plot_jitter_dist_tx.plot(("jitter_bins", "jitter_tx"), type="line", color="blue", name="Total")
plot_jitter_dist_tx.plot(("jitter_bins", "jitter_ext_tx"), type="line", color="red", name="Data-Ind.")
plot_jitter_dist_tx.title = post_tx_str
plot_jitter_dist_tx.index_axis.title = "Time (ps)"
plot_jitter_dist_tx.value_axis.title = "Count"
plot_jitter_dist_tx.value_axis.title = "PDF"
plot_jitter_dist_tx.legend.visible = True
plot_jitter_dist_tx.legend.align = "ur"

plot_jitter_dist_ctle = Plot(plotdata, padding_left=75)
plot_jitter_dist_ctle.plot(("jitter_bins", "jitter_ctle"), type="line", color="blue", name="Measured")
plot_jitter_dist_ctle.plot(("jitter_bins", "jitter_ext_ctle"), type="line", color="red", name="Extrapolated")
plot_jitter_dist_ctle.plot(("jitter_bins", "jitter_ctle"), type="line", color="blue", name="Total")
plot_jitter_dist_ctle.plot(("jitter_bins", "jitter_ext_ctle"), type="line", color="red", name="Data-Ind.")
plot_jitter_dist_ctle.title = post_ctle_str
plot_jitter_dist_ctle.index_axis.title = "Time (ps)"
plot_jitter_dist_ctle.value_axis.title = "Count"
plot_jitter_dist_ctle.value_axis.title = "PDF"
plot_jitter_dist_ctle.legend.visible = True
plot_jitter_dist_ctle.legend.align = "ur"

plot_jitter_dist_dfe = Plot(plotdata, padding_left=75)
plot_jitter_dist_dfe.plot(("jitter_bins", "jitter_dfe"), type="line", color="blue", name="Measured")
plot_jitter_dist_dfe.plot(("jitter_bins", "jitter_ext_dfe"), type="line", color="red", name="Extrapolated")
plot_jitter_dist_dfe.plot(("jitter_bins", "jitter_dfe"), type="line", color="blue", name="Total")
plot_jitter_dist_dfe.plot(("jitter_bins", "jitter_ext_dfe"), type="line", color="red", name="Data-Ind.")
plot_jitter_dist_dfe.title = post_dfe_str
plot_jitter_dist_dfe.index_axis.title = "Time (ps)"
plot_jitter_dist_dfe.value_axis.title = "Count"
plot_jitter_dist_dfe.value_axis.title = "PDF"
plot_jitter_dist_dfe.legend.visible = True
plot_jitter_dist_dfe.legend.align = "ur"

Expand All @@ -464,11 +464,9 @@ def make_plots(self, n_dfe_taps):

# - Jitter Spectrums tab
plot_jitter_spec_chnl = Plot(plotdata)
plot_jitter_spec_chnl.plot(("f_MHz", "jitter_spectrum_chnl"), type="line", color="blue", name="Total")
plot_jitter_spec_chnl.plot(
("f_MHz", "jitter_ind_spectrum_chnl"), type="line", color="red", name="Data Independent"
)
plot_jitter_spec_chnl.plot(("f_MHz", "thresh_chnl"), type="line", color="magenta", name="Pj Threshold")
plot_jitter_spec_chnl.plot(("f_MHz", "jitter_spectrum_chnl"), type="line", color="blue", name="Total")
plot_jitter_spec_chnl.plot(("f_MHz", "jitter_ind_spectrum_chnl"), type="line", color="red", name="Data Independent")
plot_jitter_spec_chnl.plot(("f_MHz", "thresh_chnl"), type="line", color="magenta", name="Pj Threshold")
plot_jitter_spec_chnl.title = post_chnl_str
plot_jitter_spec_chnl.index_axis.title = "Frequency (MHz)"
plot_jitter_spec_chnl.value_axis.title = "|FFT(TIE)| (dBui)"
Expand All @@ -481,9 +479,9 @@ def make_plots(self, n_dfe_taps):
plot_jitter_spec_chnl.legend.align = "lr"

plot_jitter_spec_tx = Plot(plotdata)
plot_jitter_spec_tx.plot(("f_MHz", "jitter_spectrum_tx"), type="line", color="blue", name="Total")
plot_jitter_spec_tx.plot(("f_MHz", "jitter_ind_spectrum_tx"), type="line", color="red", name="Data Independent")
plot_jitter_spec_tx.plot(("f_MHz", "thresh_tx"), type="line", color="magenta", name="Pj Threshold")
plot_jitter_spec_tx.plot(("f_MHz", "jitter_spectrum_tx"), type="line", color="blue", name="Total")
plot_jitter_spec_tx.plot(("f_MHz", "jitter_ind_spectrum_tx"), type="line", color="red", name="Data Independent")
plot_jitter_spec_tx.plot(("f_MHz", "thresh_tx"), type="line", color="magenta", name="Pj Threshold")
plot_jitter_spec_tx.title = post_tx_str
plot_jitter_spec_tx.index_axis.title = "Frequency (MHz)"
plot_jitter_spec_tx.value_axis.title = "|FFT(TIE)| (dBui)"
Expand All @@ -495,11 +493,9 @@ def make_plots(self, n_dfe_taps):
plot_jitter_spec_chnl.value_range = plot_jitter_spec_tx.value_range

plot_jitter_spec_ctle = Plot(plotdata)
plot_jitter_spec_ctle.plot(("f_MHz", "jitter_spectrum_ctle"), type="line", color="blue", name="Total")
plot_jitter_spec_ctle.plot(
("f_MHz", "jitter_ind_spectrum_ctle"), type="line", color="red", name="Data Independent"
)
plot_jitter_spec_ctle.plot(("f_MHz", "thresh_ctle"), type="line", color="magenta", name="Pj Threshold")
plot_jitter_spec_ctle.plot(("f_MHz", "jitter_spectrum_ctle"), type="line", color="blue", name="Total")
plot_jitter_spec_ctle.plot(("f_MHz", "jitter_ind_spectrum_ctle"), type="line", color="red", name="Data Independent")
plot_jitter_spec_ctle.plot(("f_MHz", "thresh_ctle"), type="line", color="magenta", name="Pj Threshold")
plot_jitter_spec_ctle.title = post_ctle_str
plot_jitter_spec_ctle.index_axis.title = "Frequency (MHz)"
plot_jitter_spec_ctle.value_axis.title = "|FFT(TIE)| (dBui)"
Expand All @@ -509,11 +505,9 @@ def make_plots(self, n_dfe_taps):
plot_jitter_spec_ctle.value_range = plot_jitter_spec_tx.value_range

plot_jitter_spec_dfe = Plot(plotdata)
plot_jitter_spec_dfe.plot(("f_MHz_dfe", "jitter_spectrum_dfe"), type="line", color="blue", name="Total")
plot_jitter_spec_dfe.plot(
("f_MHz_dfe", "jitter_ind_spectrum_dfe"), type="line", color="red", name="Data Independent"
)
plot_jitter_spec_dfe.plot(("f_MHz_dfe", "thresh_dfe"), type="line", color="magenta", name="Pj Threshold")
plot_jitter_spec_dfe.plot(("f_MHz_dfe", "jitter_spectrum_dfe"), type="line", color="blue", name="Total")
plot_jitter_spec_dfe.plot(("f_MHz_dfe", "jitter_ind_spectrum_dfe"), type="line", color="red", name="Data Independent")
plot_jitter_spec_dfe.plot(("f_MHz_dfe", "thresh_dfe"), type="line", color="magenta", name="Pj Threshold")
plot_jitter_spec_dfe.title = post_dfe_str
plot_jitter_spec_dfe.index_axis.title = "Frequency (MHz)"
plot_jitter_spec_dfe.value_axis.title = "|FFT(TIE)| (dBui)"
Expand Down
16 changes: 5 additions & 11 deletions src/pybert/gui/view.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,6 @@
name="pattern",
label="Pattern",
tooltip="pattern to use to construct bit stream",
# editor=TextEditor(auto_set=False, enter_set=True, evaluate=int),
),
Item(
name="seed",
Expand All @@ -104,16 +103,16 @@
show_border=True,
),
VGroup(
Item(
name="thresh",
label="Pj Threshold (sigma)",
tooltip="Threshold for identifying periodic jitter spectral elements. (sigma)",
),
Item(
name="impulse_length",
label="Impulse Response Length (ns)",
tooltip="Manual impulse response length override",
),
Item(
name="thresh",
label="Pj Threshold (sigma)",
tooltip="Threshold for identifying periodic jitter spectral elements. (sigma)",
),
Item(name="debug", label="Debug", tooltip="Enable to log extra information to console."),
label="Analysis Parameters",
show_border=True,
Expand Down Expand Up @@ -181,8 +180,6 @@
label="Use file",
),
spring,
# Item(name="padded", label="Zero-padded", enabled_when="use_ch_file == True"),
# Item(name="windowed", label="Windowed", enabled_when="use_ch_file == True"),
),
),
HGroup(
Expand Down Expand Up @@ -356,7 +353,6 @@
reorderable=False,
sortable=False,
selection_mode="cell",
# auto_size=True,
rows=4,
),
show_label=False,
Expand Down Expand Up @@ -771,7 +767,5 @@
buttons=NoButtons,
statusbar="status_str",
title="PyBERT",
# width=0.95,
# height=0.9,
icon=ImageResource("icon.png"),
)
Loading

0 comments on commit 0a486ac

Please sign in to comment.