View License

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

» Watch video

Highlights from
Ideal Low-Pass Filtering of an Image

5.0 | 2 ratings Rate this file 25 Downloads (last 30 days) File Size: 1.42 KB File ID: #36674 Version: 1.1
image thumbnail

Ideal Low-Pass Filtering of an Image



14 May 2012 (Updated )

Ideal Low-Pass Filtering of an Image based on DFT

| Watch this File

File Information

function im = IdealLowPass(im0,fc)
% fc is the circular cutoff frequency which is normalized to [0 1], that is,
% the highest radian frequency \pi of digital signals is mapped to 1.

[ir,ic,iz] = size(im0);
hr = (ir-1)/2;
hc = (ic-1)/2;
[x, y] = meshgrid(-hc:hc, -hr:hr);

mg = sqrt((x/hc).^2 + (y/hr).^2);
lp = double(mg <= fc);

IM = fftshift(fft2(double(im0)));
IP = zeros(size(IM));
for z = 1:iz
    IP(:,:,z) = IM(:,:,z) .* lp;
im = abs(ifft2(ifftshift(IP)));


Ideal Low Pass Filter inspired this file.

MATLAB release MATLAB 7.9 (R2009b)
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (4)
15 May 2016 yusuf KOCAOGLU

26 Feb 2016 andres puerto lara

very useful, thanks

30 Oct 2013 wrest12

could you please add comments so that people who are new to Matlab can understand it easily

Comment only
23 Oct 2012 Sufyan

Sufyan (view profile)

could you please add more comments for each line of code ?

Comment only
15 May 2012 1.1

misunderstand the reply, and upload this twice, delete one, and update this.

Contact us