def addPole(self, pole, name=None): newname = self.generatePoleName() newPole = ComplexPoint(pole, name=newname) self.activate(newPole) self.poles.append(newPole) if self.isRealFilter == True: conjugate = newPole.generateConjugate() self.poles.append(conjugate)
def addZero(self, zero, name=None): newname = self.generateZeroName() newZero = ComplexPoint(zero, name=newname) self.activate(newZero) self.zeroes.append(newZero) if self.isRealFilter == True: conjugate = newZero.generateConjugate() self.zeroes.append(conjugate)
def addZero(self, zero, name = None): newname = self.generateZeroName() newZero = ComplexPoint(zero, name = newname) self.activate(newZero) self.zeroes.append(newZero) if self.isRealFilter == True: conjugate = newZero.generateConjugate() self.zeroes.append(conjugate)
def addPole(self, pole, name = None): newname = self.generatePoleName() newPole = ComplexPoint(pole, name = newname) self.activate(newPole) self.poles.append(newPole) if self.isRealFilter == True: conjugate = newPole.generateConjugate() self.poles.append(conjugate)
def OnSize(self, event): self.size = event.GetSize() self.drawGraph(event) self.Refresh() event.Skip() def OnPaint(self, event=None): self.drawGraph(event) if __name__ == '__main__': zer = [] pol = [] point = ComplexPoint(complex(1 / 2.0, 1.0 / 2)) point2 = ComplexPoint(complex(1.0 / 3, -1.0 / 2)) pol.append(point) pol.append(point.getConjugate()) zer.append(point2) zer.append(point2.getConjugate()) """ for i in range(2): b = ComplexPoint(complex(1.0/(i+1), 0)) #a = ComplexPoint(complex(0.1, 0.1/(pow(i + 1, 2)))) zer.append(b) pol.append(a) """ app = wx.PySimpleApp()
def OnSize(self, event): self.size = event.GetSize() self.drawGraph(event) self.Refresh() event.Skip() def OnPaint(self, event = None): self.drawGraph(event) if __name__ == '__main__': zer = [] pol = [] point = ComplexPoint(complex(1/2.0, 1.0/2)) point2 = ComplexPoint(complex(1.0/3, -1.0/2)) pol.append(point) pol.append(point.getConjugate()) zer.append(point2) zer.append(point2.getConjugate()) """ for i in range(2): b = ComplexPoint(complex(1.0/(i+1), 0)) #a = ComplexPoint(complex(0.1, 0.1/(pow(i + 1, 2)))) zer.append(b) pol.append(a) """ app = wx.PySimpleApp()
#print self.zeroes for z in self.zeroes: if z.isActive(): dc.SetPen(wx.Pen("red", 3)) else: dc.SetPen(wx.Pen("black", 2)) self.drawZero(z.getReal(), z.getImag(), dc, event) #print 'loop:drawZeroes()' #print 'drawZeroes end' def drawMonomials(self, dc, event): self.drawPoles(dc, event) self.drawZeroes(dc, event) #print 'drawMonomials()' def OnPaint(self, event = None): self.drawGraph(event) if __name__ == '__main__': #print 'absolute start' app = wx.PySimpleApp() #print 'start' frame = ZeroPoleFrame(None) #print 'end ZeroFrame Construction' zer = [ComplexPoint(complex(0, 0)), ComplexPoint(complex(1.0/2, 1.0/2))] pol = [ComplexPoint(complex(-1.0/2, -1.0/2))] frame.setZeroes(zer) frame.setPoles(pol) #print 'executed' frame.Show() app.MainLoop()
phase = B-A """ while phase < -math.pi: phase += math.pi while phase > math.pi: phase -= math.pi """ graphList.append(phase) return graphList if __name__ == '__main__': testZeroes = [] testPoles = [] for i in range(1): b = ComplexPoint(complex(1.0, 0)) testZeroes.append(b) #a = ComplexPoint(complex(1.0/(2*i+1),1.0/(2*i+1) )) #testPoles.append(a) mylist = graphPhase(zeroes = testZeroes, poles = testPoles) for num in mylist: print num