예제 #1
0
    def __init__(self):
        super(SpectrographWidget, self).__init__()
        self.setLabel('bottom', 'Index', units='B')
        nPlots = 18
        nSamples = 500
        self.curves = []

        for i in range(nPlots):
            c = pg.PlotCurveItem(pen=(i, nPlots * 1.3))
            self.addItem(c)
            c.setPos(0, i * 6)
            self.curves.append(c)
            c.setData(np.zeros(nSamples))

        self.setYRange(0, nPlots * 6)
        self.setXRange(0, nSamples)

        self.buffer = np.zeros(nSamples)
        self.nPlots = nPlots

        self.filter = IIRFilter()
예제 #2
0
    pass


try:
    from mpd import MPDClient
    client = MPDClient()
    client.connect("localhost", 6600)

    def setMPDVolume(val):
        val = 100 - val
        val = np.min((np.max((val, 10)), 100))
        client.setvol(int(val))
except Exception, e:
    print "MPD error: ", e

iir0 = IIRFilter()
iir = IIRFilter()
iir2 = IIRFilter()
iir3 = IIRFilter()
iir4 = IIRFilter()


def update(channels):

    gridFilter.update(channels[0])

    iir0.update(channels[0])

    spectrogram.updateValue(gridFilter.ac)

    delta = iir0.band(0.5, 4)