Professional Documents
Culture Documents
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:
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 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.
[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);