MHz Speed Analog Reading + High Quality 40kHz Square Wave

How do you account for amplitude changing with distance?