Code covered by the BSD License

Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.

### Highlights from Butterworth Bandpass Filter for Image Processing

5.0
5.0 | 2 ratings Rate this file 39 Downloads (last 30 days) File Size: 2.34 KB File ID: #30946 Version: 1.2

# Butterworth Bandpass Filter for Image Processing

### Leonardo O. Iheme (view profile)

01 Apr 2011 (Updated )

This function performs butterworth bandpass filtering in the frequency domain

File Information
Description

Butterworth Bandpass Filter
This simple function was written for my Digital Image Processing course
at Eastern Mediterranean University taught by
Assoc. Prof. Dr. Hasan Demirel
for the 2010-2011 Spring Semester
for the complete report:
http://www.scribd.com/doc/51981950/HW4-Frequency-Domain-Bandpass-Filtering

Written By:
Leonardo O. Iheme (leonardo.iheme@cc.emu.edu.tr)
23rd of March 2011

I = The input grey scale image
d0 = Lower cut off frequency
d1 = Higher cut off frequency
n = order of the filter

The function makes use of the simple principle that a bandpass filter
can be obtained by multiplying a lowpass filter with a highpass filter
where the lowpass filter has a higher cut off frquency than the high pass filter.

Usage BUTTERWORTHBPF(I,DO,D1,N)
Example
ima = imread('grass.jpg');
ima = rgb2gray(ima);
filtered_image = butterworthbpf(ima,30,120,4);

Required Products Image Acquisition Toolbox
Image Processing Toolbox
MATLAB release MATLAB 7.10 (R2010a)
Tags for This File   Please login to tag files.
 Please login to add a comment or rating.
Comments and Ratings (4)
05 Jul 2016 Raul Ziranda

### Raul Ziranda (view profile)

10 Dec 2015 Leonardo

### Leonardo (view profile)

May I've just found a working solutions for my issue

adding a string input called type and then:

filter4(i,j)=1.0-filter3(i,j); % in the for loop

if type == 'bandpass'
% Update image with passed frequencies.
filtered_image = fftI + filter3.*fftI;
elseif type == 'bandreject'
% Update image with passed frequencies.
filtered_image = fftI + filter4.*fftI;
end

Comment only
04 Dec 2015 Leonardo

### Leonardo (view profile)

Dear sir,
Your code is simple and effective.
Just one question; how should I modify the code to obtain a band reject filter instead of a band pass filter with the same parameters ??
It should be quite simple.
Any suggestions ?

Thank you in advance !!

Comment only
14 Oct 2013 Robin Martin

### Robin Martin (view profile)

Very good code simple and effecient!

Updates
04 Apr 2011 1.2

Updated the title

Contact us