Add Python script for generating code.
This commit is contained in:
parent
6c85dbf251
commit
27c33adc80
1 changed files with 13 additions and 0 deletions
13
py/atten_levels.py
Normal file
13
py/atten_levels.py
Normal file
|
@ -0,0 +1,13 @@
|
|||
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,
|
Loading…
Reference in a new issue