Monday, May 19, 2008

Image Decimation Aliasing Distortion

Resizing an image to make it smaller is known as decimation. Below is an example image reduced in size by 50% (decimated by 2) that used a crude throw away every other row and column method. Notice the aliasing distortion:


The image distortion seen above can be avoided by filtering before the decimation process. The ImageMagick toolkit has a number of image processing features which can be useful here. The following ImageMagick command line performs the proper decimation and filtering:

convert a.png -resize 50% b.png

Below is the same image but this time the resizing is clean and distortion free:


The ImageMagick toolkit can also resize an image to any arbitrary size with a command line like:

convert a.png -resize 300x250 b.png

Image decimation aliasing distortion is analogous to reducing the sample rate of a time series signal without first low pass filtering. This DSP phenomena can demonstrated with the baudline signal analyzer's decimation feature. Go into the Input Devices window and select a Decimate By ratio. Recording a tone sweep is a good signal source for visualizing this phenomena. Next disable baudline's anti-alias filter and record the test signal again, this time aliasing distortion will be visible. This sort of aliasing is also know as frequency folding and some examples can be seen in the Full Duplex DAQ comparision sound card solution report.