Open source laser wavemeter with NO expensive optics and NO machining
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

24 lines
521 B

import sys, os
sample_rate = 48e6
ref_frequency = 1.97e6
ref_phase = 0
ref_ftw = int(ref_frequency*2**32/sample_rate)
fp = os.fdopen(sys.stdout.fileno(), "wb")
while True:
sample = 0
for _ in range(2):
sample <<= 4
ref_phase = (ref_phase + ref_ftw) & 0xffffffff
delta = 0
meas_phase = (ref_phase + delta) & 0xffffffff
if ref_phase >= 0x80000000:
sample |= 0x01
if meas_phase >= 0x80000000:
sample |= 0x02
fp.write(bytes([sample]))