if n == 0:
        x0 = 1.0
    else:
        x0 = 0.0

    # Difference equation
    y0 = x0 - a1 * y1 - a2 * y2

    # Delays
    y2 = y1
    y1 = y0

    # Difference equation second time
    y00 = y0 - a1 * y01 - a2 * y02

    # Delays
    y02 = y01
    y01 = y00

    # Output
    y00 = check_samples.check(y00, gain)
    out = gain * y00
    str_out = struct.pack('i', out)  # 'h' for 16 bits
    stream.write(str_out, 1)

print("* done *")

stream.stop_stream()
stream.close()
p.terminate()
    if n == 0:
        x0 = 1.0
    else:
        x0 = 0.0

    # Difference equation
    y0 = x0 - a1 * y1 - a2 * y2

    # Delays
    y2 = y1
    y1 = y0

    # Difference equation second time
    y00 = y0 - a1 * y01 - a2 * y02

    # Delays
    y02 = y01
    y01 = y00

    # Output
    y00 = check_samples.check(y00,gain)
    out = gain * y00
    str_out = struct.pack('i', out)     # 'h' for 16 bits
    stream.write(str_out, 1)

print("* done *")

stream.stop_stream()
stream.close()
p.terminate()
Exemplo n.º 3
0
    if n == 0:
        x0 = 1.0
    else:
        x0 = 0.0

    # Difference equation
    y10 = x0 - a11 * y11 - a12 * y12

    # Delays
    y12 = y11
    y11 = y10

    # Difference equation second time
    y20 = y10 - a21 * y21 - a22 * y22

    # Delays
    y22 = y21
    y21 = y20

    # Output
    y20 = check_samples.check(y20, gain)
    out = gain * y20
    str_out = struct.pack('h', out)  # 'h' for 16 bits
    stream.write(str_out, 1)

print("* done *")

stream.stop_stream()
stream.close()
p.terminate()
    if n == 0:
        x0 = 1.0
    else:
        x0 = 0.0

    # Difference equation
    y10 = x0 - a11 * y11 - a12 * y12

    # Delays
    y12 = y11
    y11 = y10

    # Difference equation second time
    y20 = y10 - a21 * y21 - a22 * y22

    # Delays
    y22 = y21
    y21 = y20

    # Output
    y20 = check_samples.check(y20,gain)
    out = gain * y20
    str_out = struct.pack('h', out)     # 'h' for 16 bits
    stream.write(str_out, 1)

print("* done *")

stream.stop_stream()
stream.close()
p.terminate()