The current regulatory documents do not take into account the peculiarities of rail monitoring by mobile flaw-detectors, are focused on compliance with the initially set parameters and cannot always provide the required reliability of defect detection. The issues of maintaining the required reliability of ultrasonic inspection under the influence of interfering factors at significant scanning speeds by adjusting the threshold level of defect detection are considered. When implementing the bottom-echo method of ultrasonic inspection, an informative feature is the amplitude of the bottom signal. When analyzing the envelope of the bottom signal amplitude, an important role is played by establishing a baseline level from which the magnitude of the amplitude decrease is calculated. To automate the process of decoding ultrasonic data of mobile flaw-detectors, a special algorithm for estimating the baseline level of the bottom signal has been developed, implemented in the corresponding software for automatic processing of acoustic inspection data.