4f spatial filtering

A 4f optical system images the input through two lenses. The first lens forms the spatial Fourier transform of the field in its back focal plane; a mask placed there filters spatial frequencies, and the second lens transforms back to an image. Below, a 2D FFT stands in for the lenses and a circular mask stands in for the filter.

Input

Fourier magnitude (log, centred)

Filtered output

8 px
keeps low frequencies, blurs the image

The lens performs a spatial Fourier transform: the centre of the spectrum is the average (low frequency), the outer regions are sharp detail (high frequency). The mask in the Fourier plane is spatial filtering. A low-pass mask passes the bright centre and blurs the image; a high-pass mask blocks the centre and leaves only edges.