To find a known shape buried in noise, correlate the incoming signal against a copy of that shape — slide the template along and multiply-add at each position. Where they align, the products reinforce and the correlation peaks; elsewhere they cancel. The matched filter is provably the optimal detector for a known signal in white noise: it maximizes the signal-to-noise ratio at the moment of alignment. It is how radar finds an echo, how GPS locks a ranging code, how a barcode scanner finds the pattern. Detection as a search for a peak.
The demo correlates a signal against a 4-sample template and finds the lag of maximum correlation — the alignment position: live demo
“A signal too weak to see is lost.” — correlate it against its known shape and the peak lifts it out of the noise. cited
A known shape pulled from noise by its own echo — detection as the search for a peak. correlation
On the canonical compiler, correlating a signal against its template peaks at lag 3 — exactly where the template was embedded: