Mathematics are developed to transform a moiré pattern into a 3-D Fourier space. Grating shapes, tilt, heterodyning, phase shifting, and Fourier filtering are all easily visualized in the 3-D Fourier space. It is shown why, in general, a moiré pattern cannot be interpreted in the 2-D spatial domain by a simple algorithm operating on a point. A moiré pattern is defined in terms of the 3-D Fourier space. A simple algorithm is developed to generate the value of the moiré pattern at a point. The filter characteristics of a solid state camera are developed and exploited. Phase modulation and synchronous detection are shown to filter out only components due to the fundamental harmonic of the reference grating. The specimen frequency vector is recovered from the moiré phase field.