Optimized filtering reduces the error rate in detecting