selcal/scripts/tones.py

27 lines
631 B
Python
Executable File

#! /usr/bin/env python3
'''
def frequency_16(n):
return 100 * 10 ** ((n + 22) * 0.0225)
'''
def frequency_32(n):
return 100 * 10 ** ((n + 22) * 0.0225)
def width_16(n):
return 12.5 * 10 ** (n * 0.045)
def width_32(n):
return 6.25 * 10 ** (n * 0.0225)
SELCAL_16 = 'ABCDEFGHJKLMPQRS'
SELCAL_EXTRA = 'TUVWXYZ123456789'
SELCAL_32 = [item for pair in zip(SELCAL_16, SELCAL_EXTRA) for item in pair]
TONES = {SELCAL_32[n]:frequency_32(n) for n in range(32)}
if __name__ == "__main__":
# Print SELCAL 32 tones in csv format, ascending frequency order
print('\n'.join([f"{k},{v}" for k,v in TONES.items()]))