A technique for optical pattern recognition using an amplitude-compensated matched filter is presented. With the synthetic discriminant function in a matched spatial filtering application an iterative technique is employed to first obtain the synthetic discriminant functions for the phase-only matched filter and then is extended to the amplitude-compensated matched filter. Computer simulation shows that the suggested spatial filter has a high signal-to-noise ratio and good Horner efficiency, and it is more sensitive to changes in the input image.