2
0
Fork 0
OPL/py/atten_levels.py
2013-09-12 23:52:35 +08:00

13 lines
185 B
Python

lvls = [.75, 1.5, 3, 6, 12, 24]
def get_db(i):
db = 0.0
for d in lvls:
if i & 0x1:
db += d
i >>= 1
return db
for i in range(2**6):
db = get_db(i)
print '"%.2f dB",' % db,