We compare the performance of two methods of digital filtering to detect a radioactive source moving past a gamma-ray sensor. The first method is the boxcar filter, which is a standard method used in the detection of a moving radioactive source. The second method is the matched filter, which takes into account the variation in the number of photons absorbed in a gamma-ray sensor as a source moves past the sensor. We optimize both methods to detect a source moving at 5, 10, 15 and 20 mph, and the receiver-operator characteristics of the two techniques are plotted for comparison. The improvement of the matched filter over the box car filter is 27% at 5 mph and 22% at 10 mph for a 90% probability of detection and an average hours between false alarms equal to 10.