10182

# Low-Pass and High-Pass Filtering of Images

This Demonstration shows the results of applying two different types of filters to images. To apply the filters, the discrete Fourier transform of the image is taken and then changed through a series of steps. The filter is then applied by performing pointwise multiplication with the transform matrix and the rectangular filter that cancels out high frequencies if it is a high-pass filter or low frequencies if a low-pass filter. The steps are then done in inverse, and then the inverse discrete Fourier transform is taken to give the result. Notice that when low frequencies closer to the center are filtered out, there is more blurring at areas of rapidly changing pixel intensity, and when high frequencies closer to the edges are filtered, the areas of rapidly changing intensity are emphasized to show an outline of the image.

### DETAILS

These are the steps that the program conducts to output the results:
1. Read in the image as a pixel intensity matrix.
2. Take the fast Fourier transform of the matrix. To obtain a power spectrum, multiply each element of the transform matrix by its complex conjugate.
3. Take the base-2 logarithm of each element of the power spectrum in order to improve its brightness and contrast settings in the display.
4. Shift the result's zero-frequency component from the top-left corner to the center by splitting the matrix into four equally sized quadrants and swapping them across the center.
5. Create a low-pass filter by making a rectangle of 1's, with the dimensions specified by the manipulated variables, at the center of a matrix of 0's with the same dimensions as the image. To make a high-pass filter, make the rectangle full of 0's among a matrix of 1's.
6. Multiply the shifted logarithm of the power spectrum by each filter pointwise.
7. Apply all the steps to change the power spectrum inversely to the filtered results. Then divide them by the complex conjugate matrix of the Fourier transform of the image.
8. Perform a fast inverse Fourier transform on the results.
9. Output the absolute value of the inverse transforms as images.

### PERMANENT CITATION

 Share: Embed Interactive Demonstration New! Just copy and paste this snippet of JavaScript code into your website or blog to put the live Demonstration on your site. More details » Download Demonstration as CDF » Download Author Code »(preview ») Files require Wolfram CDF Player or Mathematica.

#### Related Topics

 RELATED RESOURCES
 The #1 tool for creating Demonstrations and anything technical. Explore anything with the first computational knowledge engine. The web's most extensive mathematics resource. An app for every course—right in the palm of your hand. Read our views on math,science, and technology. The format that makes Demonstrations (and any information) easy to share and interact with. Programs & resources for educators, schools & students. Join the initiative for modernizing math education. Walk through homework problems one step at a time, with hints to help along the way. Unlimited random practice problems and answers with built-in Step-by-step solutions. Practice online or make a printable study sheet. Knowledge-based programming for everyone.
 © 2015 Wolfram Demonstrations Project & Contributors  |  Terms of Use  |  Privacy Policy  |  RSS
 Note: To run this Demonstration you need Mathematica 7+ or the free Mathematica Player 7EX Download or upgrade to Mathematica Player 7EX I already have Mathematica Player or Mathematica 7+