The noise comes from a deterministic LCG, so the same seed always gives the same waveform.
While paused, moving a slider updates the results immediately.
Top = received r[n] = s[n] + n[n] (blue) / middle = filter coefficients h[n] = s[L−1−n] (green) / bottom = output y[n] (red, yellow dot = peak)
Convolving the received signal r[n] = s[n] + n[n] with the time-reversed copy of the known signal h[n] = s[L−1−n] makes the output peak at the arrival position. That is the matched filter.
Filter output, where * denotes convolution:
$$y[n] = \sum_{k=0}^{L-1} h[k]\,r[n-k] = (h * r)[n]$$Input SNR and output peak SNR. E_s = A²·L is the signal energy:
$$\mathrm{SNR}_\mathrm{in} = \frac{A^2}{\sigma^2}, \qquad \mathrm{SNR}_\mathrm{out} = \frac{E_s}{\sigma^2} = \frac{A^2 L}{\sigma^2}$$Processing gain of the matched filter (equal to the pulse length):
$$G = \frac{\mathrm{SNR}_\mathrm{out}}{\mathrm{SNR}_\mathrm{in}} = L$$The longer the pulse, the larger the gain, so detection becomes possible even at a low input SNR. This is the basic principle of radar pulse compression and matched reception in communications.