Ejemplo n.º 1
0
    def paintEvent(self, e):
        QFrame.paintEvent(self, e)
        self.rect = QRectF(0, 0, self.width(), self.height() - 10)

        qp = QPainter(self)
        qp.setRenderHint(QPainter.Antialiasing)

        self.drawTicks(qp, self.xaxis)
        self.drawTicks(qp, self.laxis)
        self.drawTicks(qp, self.raxis)      

        #paint filter response
        filt = self.parent().chain._filters[self.focused]
        if filt._enabled:
            w, H = sosfreqz(filt._sos, self.wor)
            pen = QPen((QColor(170, 0, 0)))
            pen.setWidth(1.5)
            if filt._type == FilterType.Peak:
                c = PlotCurve(pen, QBrush(QColor(255, 255, 255, 50)), is_path = True)
            else:
                c = PlotCurve(pen, is_path = True)

            c.setData(w * 0.5 / np.pi * fs, 20 * np.log10(np.abs(H) + eps))
            self.plot(qp, c, self.raxis)

        #paint chain response
        self.plot(qp, self.TFcurv, self.raxis)
         
        #paint handles      
        self.drawHandles(qp)  
        
        #paint the spectrum
        self.plot(qp, self.speccurv, self.laxis)    
Ejemplo n.º 2
0
  def updateChainTF(self):
 
      w, H = sosfreqz(self.chain.sos(), self.plotwin.wor)
      self.plotwin.TFcurv.setData(w * 0.5 / np.pi * fs, 20 * np.log10(np.abs(H) + eps))
      self.plotwin.update()