You are on page 1of 6

LOW PASS IDEAL, GAUSSIAN AND BUTTER WORTH IN FRQ.

AIM:- To study Ideal, Gaussian and butter north Laps using MATLAB.

THEORY:-
A 2-D ideal loan pass filter is one whose TF satisfies relation:

H (u, v) = 1 if D (u, v) =Do


0 if D (u., v)= Do

D (u, v) is distance from point (u, v) to origin of frequency plane.

A plot of frequency response and cross section is shown below.

The frequency inside the circle of radius Do are passed with no


Attenuation and outside the circle are completely attenuated.

Butterworth LPF:-

The butter north LPF of order n and cut off frequency at distance
Do from the origin has transfer function given by,

H (u, v) = 1
1+ [D (u, v)/Do] 2n

Unlike ILPF, the BHPF transfer function does not have a sharp
discontinuity that establishes a clear cut off between passed and filtered
frequencies. A butter north filter of order 1 has no ringing. Ringing generally
is imperceptible in filter of order 2 but can become a significant factor in
filter of higher order.

Gaussian LPF:-

The transfer function of Gaussian LPF is given by,


H (u, v) = e-D 2 (u, v) / 2Do2
Do= cut off frequency
D (u, v) = distance of (u, v) from the center.

When D (u, v) = Do the flow of filter is down to 0.707 of its maximum


value. As IFI of the Gaussian LPF also is Gaussian, thus the spatial
Gaussian filter will have no ringing.
CONCLUSION:-

The low pass filter covers the entire range of image pixels. With
Increasing order the Gaussian filter reached ideal filter specifications. For
Lower order butter north order has lower smooth output.

%%%Filter in Frequency Domain%%%%%%%%%%%%%%


%%%%%%%%%IDEAL LOW PASS FILER%%%%%%%%%%%%%%
clc;
close all;
clear all;
a=imread('cameraman.tif');
b=double(a);
figure(1);
subplot(2,2,1);
imshow(uint8(a));title('In put image');
[m n]=size(b);
D0=input('Enter the in cut-off frequency = ');
for u=1:1:m;
for v=1:1:n;
D=((u-(m/2))^2+(v-(n/2))^2)^0.5;
if D<D0;
H(u,v)=1;
else
H(u,v)=0;
end
end
end
c=fft2(b);
d=fftshift(c);
e=d.*H;
f=abs(ifft2(e));
subplot(2,2,2);
mesh(H);
subplot(2,2,3);
imshow(uint8(f));title('filtered image');
subplot(2,2,4);
imagesc(H);
%%%%%%%%Gaussian LOW PASS FILER%%%%%%%%%%%%%%
clc;
close all;
clear all;
a=imread('cameraman.tif');
b=double(a);

[m n]=size(b);
D0=input('Enter the in cut-off frequency/Standard deviation = ');
for u=1:1:m;
for v=1:1:n;
Da=((u-(m/2))^2+(v-(n/2))^2)^0.5;
D=Da*Da;
H(u,v)=exp(-D/(2*D0*D0));
end
end
c=fft2(b);
d=fftshift(c);
e=d.*H;
f=abs(ifft2(e));
figure(1);
subplot(2,2,1);
imshow(uint8(a));title('In put image');
subplot(2,2,2);
mesh(H);
subplot(2,2,3);
imshow(uint8(f));title('filtered image');
subplot(2,2,4);
imagesc(H);
%%%%%%%%BUTTERWORTH LOW PASS FILER%%%%%%%%%%%%%%
clc;
close all;
clear all;
a=imread('cameraman.tif');
b=double(a);
R=input('Enter the Order of filter = ');
[m n]=size(b);
D0=input('Enter the in cut-off frequency = ');
for u=1:1:m;
for v=1:1:n;
D=((u-(m/2))^2+(v-(n/2))^2)^0.5;

H(u,v)=1/(1+((D/D0)^(2*R)));
end
end
c=fft2(b);
d=fftshift(c);
e=d.*H;
f=abs(ifft2(e));
figure(1);
subplot(2,2,1);
imshow(uint8(a));title('In put image');
subplot(2,2,2);
mesh(H);
subplot(2,2,3);
imshow(uint8(f));title('filtered image');
subplot(2,2,4);
imagesc(H);

You might also like