Exemplo n.º 1
0
    def __init__(self, R1, R2, fp, fs, gpass, gstop, ftype, btype):
        """ Variables init """
        Filter.__init__(self, fp, fs, gpass, gstop, ftype, btype)
        self.R1 = R1
        self.R2 = R2
        self.units = Units()

        """ TEST DATA FOR CHEBY """
        #self.gpass = 1.5
        #self.ord = 4
        #self.wn = np.pi * 100000.0

        """ TEST DATA FOR BUTTER """
        #self.ord = 5
        #self.wn = 100000.0

        if ftype == 'butter':
            self.alpha = self.alpha()
        elif ftype in ('cheby1', 'cheby2'):
            self.E = self.epsilon()
            self.gamma = self.gamma()
            self.a = self.a_help_var()
            self.a_ = self.a_prim_help_var()

            print("gamma ", self.gamma)
            print("epsilon ", self.E)
            print("a", self.a)
            print("a_ ", self.a_)
           
        #Frequency to pulsation
        self.wn = self.wn * np.pi * 2    
Exemplo n.º 2
0
    def __init__(self, R1, R2, fp, fs, gpass, gstop, ftype, btype):
        """ Variables init """
        Filter.__init__(self, fp, fs, gpass, gstop, ftype, btype)
        self.R1 = R1
        self.R2 = R2
        self.units = Units()

        """ TEST DATA FOR CHEBY """
        #self.gpass = 1.5
        #self.ord = 4
        #self.wn = np.pi * 100000.0

        """ TEST DATA FOR BUTTER """
        #self.ord = 5
        #self.wn = 100000.0

        if ftype == 'butter':
            self.alpha = self.alpha()
        elif ftype in ('cheby1', 'cheby2'):
            self.E = self.epsilon()
            self.gamma = self.gamma()
            self.a = self.a_help_var()
            self.a_ = self.a_prim_help_var()

            print "gamma ", self.gamma
            print "epsilon ", self.E
            print "a", self.a
            print "a_ ", self.a_
           
        #Frequency to pulsation
        self.wn = self.wn * np.pi * 2