An optical diffraction method is described for inspecting periodic structures such as combs or semiconductor leads. Coherent light passing between the prongs of the structure self-interfere at the fractional Talbot plane to provide a simple method of inspection. Computer simulation and laboratory experiments show the viability of this approach. The theory assumes infinite structures. In practice, large end effect signals arise due to the finiteness of the periodic structure. A neural network is demonstrated that learns to distinguish end effect signals from prong damage signals. The variability of the measuring process in a production environment makes neural networks an appropriate approach for this task.