"""Original LCENJ educational calculation, CC0-1.0. Python3.10+ standard library.
No RF transmission, device access or measured input.
"""
c=3e8; B=1e9; T=40e-6; R=3; S=B/T; delay=2*R/c; beat=S*delay; recovered=c*beat/(2*S)
resolution=c/(2*B); wavelength=c/60e9; Tc=50e-6; N=128
dv=wavelength/(2*N*Tc); vmax=wavelength/(4*Tc)
assert abs(beat-500000)<1e-6 and abs(recovered-R)<1e-12 and abs(resolution-.15)<1e-12
assert abs(dv-.390625)<1e-12 and abs(vmax-25)<1e-12
print(f"slope={S:g} Hz/s; delay={delay*1e9:g} ns; beat={beat:g} Hz; recovered={recovered:g} m")
print(f"ideal range scale={resolution:g} m; velocity scale={dv:g} m/s; simple speed bound=+/-{vmax:g} m/s")
print("Calculated hypothetical examples only; no hardware, RF or measured-data test.")
