# How do optical anti-aliasing filters work from a frequency domain perspective?

To prevent aliasing caused by the finite number of pixels on a sensor, a blurring filter is commonly used. How does that work from a frequency domain perspective? What is the transfer function of such a filter?

In Karel Fliegel, Modeling and Measurement of Image Sensor Characteristics, Radioengineering, vol. 13, no. 4, December 2004, he gives the optical transfer functions (OTFs) for different detector photosensitive area shapes. OTF is the Fourier transform of the spatial domain impulse response. The spatial domain impulse response, also called the point spread function (PSF), is a 2-d function that is constant-valued (assuming uniform sensitivity) inside the detector photosensitive area and zero outside it.

If there is an optical low-pass (blurring) filter in front of the sensor or implemented by shaking the sensor, another PSF describes it, and the total PSF is the convolution of the PSF of the sensor element and the PSF of the optical low-pass filter. The total OTF is the product of the two OTFs. Birefringenge-based optical filters (for example patent US 6937283 B1) create shifted copies of the image so their PSFs are sums of shifted and possibly scaled Dirac pulses. For example, a square arrangement of four Dirac pulses is equivalent to a cascade of a horizontal and a vertical comb filter.

An optical anti-aliasing filter also attenuates in-band frequencies that would not alias. Using a software sharpening filter the amplitudes of those frequencies can be restored. This also amplifies aliased frequencies, but because their attenuation in the combined OTF of the anti-aliasing filter and the detector is stronger, they retain some of that attenuation.

Here is an example analysis of a horizontal-vertical-separable total PSF that includes 1) a square photosensitive area, 2) a birefringent optical low-pass filter that has a PSF that consists of a square arrangement of Dirac pulses separated horizontally and vertically by 0.4284281154 times pixel width, and 3) a digital post-processing filter (operating on the pixel data), which can be separated to a cascade of a horizontal and a vertical filter, both with a PSF [-0.01536945896, 1.030738917, -0.01536945896]. A square grid of pixels with no gaps between pixels (100 % coverage of the imaging plane by photosensitive areas) is assumed. The analysis is done only along one of the separable dimensions for simplicity, but it would be better to do a 2-d analysis.

Figure 1. Red: combined one-dimensional PSF of the optical anti-aliasing filter, the square photosensitive area, and the digital sharpening filter. Turquoise: the ideal sensor PSF for a square grid (sinc function). Black: PSF of the square photosensitive area. Horizontal axis: displacement in units of one pixel width.

Figure 2. One-dimensional OTFs (Fourier transforms) of PSFs of Fig. 1, using the same color code. Horizontal axis: spatial frequency in units of radians per pixel width. There are some plotting artifacts that make parts of the red curve invisible.

Considering sinc (Fig. 1) as the ideal one-dimensional PSF, the mean square error for imaging spatial white noise is reduced by 40 % by using the optical anti-aliasing filter and the digital sharpening filter. The sum of squares error can be calculated as the integral over the square of the difference between sinc and the actual PSF, or by Parseval's theorem equivalently in the frequency domain using the differences of the OTFs (Fig. 2). I optimized the coefficients and the amount of separation in the optical anti-aliasing filter so that the mean square error is minimized.

Without the optical anti-aliasing filter, a digital post-processing filter (not a sharpening filter this time) with optimized coefficients [0.06765983302, 0.8646803339, 0.06765983302] only reduces the mean-square error by 11 % compared to a reduction of 40 % from the combination of an optical anti-aliasing filter and a post-processing sharpening filter, so it is apparent that optical anti-aliasing is useful.

An anti-aliasing filter is basically just a low pass filter. The in images, aliasing happens when you upsample the signal (i.e. increase the number of samples used to represent the signal/image). This results in a blocky/pixelated image because you aren't really adding more information, you're just increasing the number of pixels that a single pixel of information used to represent. Imagine the following trivialized example:

Imagine this is the numeric representation of your data: 0,1,2,3,4,5,6 Now lets upsample by a factor of 4: 0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,6,6,6,6

What used to be a nice continuous slope is now blocks of flat, unchanging values separated by a sudden increase in value.

From a frequency perspective, these sudden increases represent very high frequency components (quick change == high frequency). To "remove" this, we use low pass filters to smooth out these transitions. Visually, it looks like we have more information resolution, but in reality, we just interpolated the original low resolution data.

• I'm familiar with the Nyquist–Shannon sampling theorem. My question relates to an optical filter. For an optical sensor, you cannot control the sampling rate, i.e. the distance between the sensors. You need to use an optical filter to remove aliasing in the spatial dimensions. You cannot achieve this in the digital domain. The anti-aliasing filter needs to be analog. Aliasing does not only happen when you up sample(interpolate) or down sample(decimate). It occurs when you convert from the analog to the digital domain. – user110971 Mar 28 '17 at 18:10

The optical device called optical lens works by forming an analog image of 3D real world on a flat 2D surface called the imaging plane. The most fundamental formula for the image formation of an ideal lens is: $$\frac{1}{f} = \frac{1}{d} + \frac{1}{s}$$ where $f$ is the focal length of the lens, $d$ is the real object distance to the lens and $s$ is the distance of the object's created image to the lens (+ on the other side wrtt object). For example when an object is at a large distance from the lens; i.e., $d \gg f$, then it tells that the image formation distance $s \approx f$ .

During the image capturing process, the image sensor is typically held at a fixed distance $s$ to the lens, except when the lens is slightly moved backward or forward for minor focusing adjustment. Therefore for an ideal lens, real world objects placed at the exact distance $d = \frac{s-f}{s f}$ becomes infinitely sharp on the image plane. Any other points which are not at this correct distance to the lens, will create blurry images due to being defocused on the image plane. And from a spatial-frequency domain perspective a blurry image means a low pass filtered image.

In order to relate this blurry (lowpass) image to an anti-aliased image we shall consider the spatial-sampling performed by the grid of sensor pixels on this 2D image plane where the distance between the consequitive pixels define the spatial sampling period. According to sampling theorem if the 2D Fourier transform of the analog image contains spatial-frequencies whose period is less than twice the pixel distance of the sensor, then there will be aliasing in the captured sampled image; i.e., the discrete-space sampled image will contain low frequency variations which does not exist in the original analog image formed by the lens on the image plane.

In order to avoid this aliasing to happen, what's required is the optical lowpass filtering of the analog image that's formed on the image plane, so that the Fourier transform of the resulting blurry image will be bandlimited to a maximum spatial frequency whose period is at least larger than twice that of the pixel distance of the sensor.

And as a matter of fact optically what realises this anti-aliasing lowpass filtering is the lens by a slight defocus of the image and also due to its imperfections (non-ideality) such as geometric aberrations and finite aperture size...

Therefore the result of this optical image formation mechanism is such that the spatial frequency content of the analog image decreases to the point where the spatial sampling is performed above the highest frequency in the image.