@@ -159,7 +159,7 @@ def __init__(self, impedance: RangeLike, cutoff_freq: RangeLike):
159159 self .gnd = self .Export (self .rc .gnd .adapt_to (Ground ()), [Common ])
160160
161161
162- class LowPassAnalogDifferentialRc (AnalogFilter , KiCadImportableBlock , GeneratorBlock ):
162+ class LowPassAnalogDifferentialRc (AnalogFilter , KiCadImportableBlock ):
163163 """Analog-typed low-pass differential RC filter, with cutoff frequency specified at the -3dB (~70%) point.
164164 Impedance is the single-ended resistor value."""
165165 def symbol_pinning (self , symbol_name : str ) -> Mapping [str , BasePort ]:
@@ -179,16 +179,14 @@ def __init__(self, impedance: RangeLike, cutoff_freq: RangeLike):
179179 self .impedance = self .ArgParameter (impedance )
180180 self .cutoff_freq = self .ArgParameter (cutoff_freq )
181181
182- self .generator_param (self .impedance , self .cutoff_freq )
183-
184- def generate (self ) -> None :
185- super ().generate ()
182+ def contents (self ) -> None :
183+ super ().contents ()
186184
187185 self .rp = self .Block (Resistor (resistance = self .impedance ))
188186 self .rn = self .Block (Resistor (resistance = self .impedance ))
189- capacitance = Range . cancel_multiply (1 / (2 * pi * self .get ( self . impedance )), 1 / self . get ( self . cutoff_freq ))
187+ capacitance = ( 1 / self . cutoff_freq ). shrink_multiply (1 / (2 * pi * self .impedance ))
190188 # capacitance is single-ended, halve it for differential
191- self .c = self .Block (Capacitor (capacitance = 0.5 * capacitance * Farad ,
189+ self .c = self .Block (Capacitor (capacitance = 0.5 * capacitance ,
192190 voltage = self .inp .link ().voltage - self .inn .link ().voltage ))
193191 self .connect (self .inp , self .rp .a .adapt_to (AnalogSink (
194192 impedance = self .rp .actual_resistance + self .outp .link ().sink_impedance ,
0 commit comments