How to use pdm - 4 common examples

To help you get started, we’ve selected a few pdm examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github mkj / pru-mic / pdm / pdm1.py View on Github external
def run_cic1(args, inf, decim, wavdiv, scaleboost, doplot, wavfn = None):

    rate = F/decim
    newrate = rate / wavdiv
    w = openwav(wavfn, newrate) if wavfn else None

    play = Player(newrate, INCHUNK)

    decoder = cic.cic_n4m2(decim)

    if args.bitex:
        ins = bitexstream(inf, INCHUNK)
    else:
        ins = demuxone(inf, INCHUNK, TESTMIC)

    for chunk, insamps in enumerate(ins):
        first = (chunk == 0)

        if first:
            print("insamps mean %f rms %f" % (np.mean(insamps), np.mean(insamps**2)**0.5))
            print("insamps min %f max %f" % (np.min(insamps), np.max(insamps)))
            maxamp = decoder.getmaxamp()
            maxbits = np.log2(maxamp)
github mkj / pru-mic / pdm / pdm1.py View on Github external
def decodestream(f, chunk):
    decoders = [decimater() for _ in range(NSTREAMS)]
    for a in demuxstream(f, chunk):
        yield [decode(x) for (decode, x) in zip(decoders, a)]
github mkj / pru-mic / pdm / pdm1.py View on Github external
def decodeone(f, chunk, decim):
    decoder = decimater(decim)
    for a in demuxstream(f, chunk):
        yield decoder(a[NSTREAMS-1-TESTMIC])
github mkj / pru-mic / pdm / tracks.py View on Github external
def main():
    t = Tracks(None, 1000, 0)

    n = np.zeros(5)
    n[:] = range(5)
    t.add(n, 'five')
    n = np.zeros(4)
    n[:] = range(4)
    t.add(n[:5], 'four')
    n = np.zeros(6)
    n[:] = range(6)
    t.add(n, 'six')
    print(t.tracks)

pdm

A modern Python package and dependency manager supporting the latest PEP standards

MIT
Latest version published 13 days ago

Package Health Score

94 / 100
Full package analysis