@@ -66,7 +66,7 @@ def moving_average(a, n=3):
66
66
67
67
68
68
def find_crossing_times (
69
- t , x , min_delay : float = 0.0 , rising_first : bool = True , min_init_dev : float = 0.1 , thresh : float = 0.0
69
+ t , x , min_delay : float = 0.0 , rising_first : bool = True , min_init_dev : float = 0.1 , thresh : float = 0.0 ,
70
70
):
71
71
"""
72
72
Finds the threshold crossing times of the input signal.
@@ -150,7 +150,9 @@ def find_crossing_times(
150
150
return array (xings [i :])
151
151
152
152
153
- def find_crossings (t , x , amplitude , min_delay : float = 0.0 , rising_first : bool = True , min_init_dev = 0.1 , mod_type = 0 ):
153
+ def find_crossings (
154
+ t , x , amplitude , min_delay : float = 0.0 , rising_first : bool = True , min_init_dev = 0.1 , mod_type = 0 ,
155
+ ):
154
156
"""
155
157
Finds the crossing times in a signal, according to the modulation type.
156
158
@@ -549,7 +551,7 @@ def calc_gamma_RLGC(R, L, G, C, ws):
549
551
w [0 ] = 1.0e-12
550
552
551
553
gamma = sqrt ((1j * w * L0 + R ) * (1j * w * C + G )) # propagation constant (nepers/m)
552
- Zc = sqrt ((1j * w * L0 + R ) / (1j * w * C + G )) # characteristic impedance (Ohms)
554
+ Zc = sqrt ((1j * w * L0 + R ) / (1j * w * C + G )) # characteristic impedance (Ohms)
553
555
554
556
return (gamma , Zc )
555
557
@@ -642,7 +644,7 @@ def calc_eye(ui, samps_per_ui, height, ys, y_max, clock_times=None):
642
644
interp_fac = (start_time - start_ix * tsamp ) // tsamp
643
645
i = 0
644
646
for (samp1 , samp2 ) in zip (
645
- ys [start_ix : start_ix + 2 * samps_per_ui ], ys [start_ix + 1 : start_ix + 1 + 2 * samps_per_ui ]
647
+ ys [start_ix : start_ix + 2 * samps_per_ui ], ys [start_ix + 1 : start_ix + 1 + 2 * samps_per_ui ],
646
648
):
647
649
y = samp1 + (samp2 - samp1 ) * interp_fac
648
650
img_array [int (y * y_scale + 0.5 ) + y_offset , i ] += 1
@@ -659,6 +661,7 @@ def calc_eye(ui, samps_per_ui, height, ys, y_max, clock_times=None):
659
661
660
662
return img_array
661
663
664
+
662
665
def draw_channel (height , width , thickness , separation , ch_type , arraySize = [25 , 100 ]):
663
666
"""
664
667
Draws the channel cross section.
@@ -682,26 +685,26 @@ def draw_channel(height, width, thickness, separation, ch_type, arraySize=[25, 1
682
685
xMid = int (xMax // 2 )
683
686
yMid = int (yMax // 2 )
684
687
yOff = int (yMax // 10 + hScale * height )
685
- if ch_type == ' microstrip_se' or ch_type == ' stripline_se' : # single-ended configuration
686
- xOff1 = xMid - int (hScale * (width / 2 ))
688
+ if ch_type == " microstrip_se" or ch_type == " stripline_se" : # single-ended configuration
689
+ xOff1 = xMid - int (hScale * (width / 2 ))
687
690
xOff2 = None
688
- else : # differential configuration
689
- xOff1 = xMid - int (hScale * (separation / 2 + width ))
690
- xOff2 = xMid + int (hScale * separation / 2 )
691
+ else : # differential configuration
692
+ xOff1 = xMid - int (hScale * (separation / 2 + width ))
693
+ xOff2 = xMid + int (hScale * separation / 2 )
691
694
# Generate the cross-section drawing.
692
695
# - Fill w/ dielectric color.
693
696
img_array = 10 * ones (arraySize )
694
697
# - Draw the reference plane.
695
698
for y in range (yMax // 10 ):
696
699
for x in range (xMax ):
697
- img_array [y ,x ] = 0
700
+ img_array [y , x ] = 0
698
701
# - Draw air, or second plane, depending on configuration.
699
- if ch_type == ' microstrip_se' or ch_type == ' microstrip_diff' : # microstrip configuration
702
+ if ch_type == " microstrip_se" or ch_type == " microstrip_diff" : # microstrip configuration
700
703
for y in range (yOff , yMax ):
701
704
for x in range (xMax ):
702
705
img_array [y , x ] = 255 # air (white)
703
- else : # stripline configuration
704
- for y in range (yOff + int (hScale * (thickness + height )), yMax ):
706
+ else : # stripline configuration
707
+ for y in range (yOff + int (hScale * (thickness + height )), yMax ):
705
708
for x in range (xMax ):
706
709
img_array [y , x ] = 0 # metal (black)
707
710
# - Draw trace(s).
@@ -712,6 +715,7 @@ def draw_channel(height, width, thickness, separation, ch_type, arraySize=[25, 1
712
715
img_array [yOff + y , xOff2 + x ] = 0
713
716
return img_array
714
717
718
+
715
719
def make_ctle (rx_bw , peak_freq , peak_mag , w , mode = "Passive" , dc_offset = 0 ):
716
720
"""
717
721
Generate the frequency response of a continuous time linear
@@ -1043,6 +1047,7 @@ def pulse_center(p, nspui):
1043
1047
clock_pos = int (mean ([main_lobe_ixs [0 ], main_lobe_ixs [- 1 ]]))
1044
1048
return (clock_pos , thresh )
1045
1049
1050
+
1046
1051
def submodules (package ):
1047
1052
1048
1053
# mod_path = package.__file__
@@ -1062,4 +1067,4 @@ def submodules(package):
1062
1067
# mod = loader.load_module(package.__name__ + "." + name)
1063
1068
rst [name ] = mod
1064
1069
1065
- return rst
1070
+ return rst
0 commit comments