Skip to content

filter

specify a filter mask from a given mask

Filter

Source code in passive_auto_design\devices\filter.py
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
class Filter:
    Order: int

    def __init__(
        self,
        f_pass: Frequency,
        f_stop: Frequency,
        ripple: PhysicalDimension,
        atten: PhysicalDimension,
    ):
        """
        f_pass: pass-band edge frequency
        f_stop: stop-band edge frequency
        ripple: maximum ripple in the pass band in dB
        atten: minimum attenuation in the stop band in dB
        """

        # tchebychev
        epsilon = sqrt(ripple.lin() - 1)
        a_2 = atten.lin()
        k1 = PhysicalDimension(value=epsilon / sqrt(a_2 - 1))
        k = f_pass.lin() / f_stop.lin()
        self.Order = ceil(k1.dB() / k.dB())

__init__(f_pass, f_stop, ripple, atten)

f_pass: pass-band edge frequency f_stop: stop-band edge frequency ripple: maximum ripple in the pass band in dB atten: minimum attenuation in the stop band in dB

Source code in passive_auto_design\devices\filter.py
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
def __init__(
    self,
    f_pass: Frequency,
    f_stop: Frequency,
    ripple: PhysicalDimension,
    atten: PhysicalDimension,
):
    """
    f_pass: pass-band edge frequency
    f_stop: stop-band edge frequency
    ripple: maximum ripple in the pass band in dB
    atten: minimum attenuation in the stop band in dB
    """

    # tchebychev
    epsilon = sqrt(ripple.lin() - 1)
    a_2 = atten.lin()
    k1 = PhysicalDimension(value=epsilon / sqrt(a_2 - 1))
    k = f_pass.lin() / f_stop.lin()
    self.Order = ceil(k1.dB() / k.dB())