Mathematical Modelling and Simulation of Band Pass Filters ...
Implementation and comparison of Low pass filters in Frequency domain
-
Upload
zara-tariq -
Category
Technology
-
view
24 -
download
0
Transcript of Implementation and comparison of Low pass filters in Frequency domain
![Page 1: Implementation and comparison of Low pass filters in Frequency domain](https://reader035.fdocuments.net/reader035/viewer/2022070512/589cdbb61a28ab43388b73b1/html5/thumbnails/1.jpg)
IMPLEMENTATION AND COMPARISON OF LOW PASS FILTERS IN FREQUENCY DOMAIN
PRESENTERS:ZARA TARIQ 1573119SAPNA KUMARI 1573131
![Page 2: Implementation and comparison of Low pass filters in Frequency domain](https://reader035.fdocuments.net/reader035/viewer/2022070512/589cdbb61a28ab43388b73b1/html5/thumbnails/2.jpg)
AGENDA Introduction Low Pass Filters Comparison Between Types of LPF Implementation of LPF Demonstration of Implementation in MATLAB
![Page 3: Implementation and comparison of Low pass filters in Frequency domain](https://reader035.fdocuments.net/reader035/viewer/2022070512/589cdbb61a28ab43388b73b1/html5/thumbnails/3.jpg)
INTRODUCTION - FILTERS IN FREQENCY DOMAINImage filtering in frequency domain can be grouped in three, depending on the effects:
2. High pass filters (sharpening filters)3. Notch Filters (band-stop filters)
1. Low pass filters (smoothing filters)
![Page 4: Implementation and comparison of Low pass filters in Frequency domain](https://reader035.fdocuments.net/reader035/viewer/2022070512/589cdbb61a28ab43388b73b1/html5/thumbnails/4.jpg)
LOW PASS FILTERS (LPF)Why Is It Used?: Creates a blurred (or smoothed) image Reduces the high frequencies and leave the low frequencies of the
Fourier transformation to relatively unchanged
How Does It Works? Low frequency components correspond to slow changes in images Used to remove high spatial frequency noise from a digital image The low-pass filters usually employ moving window operator which
affects one pixel of the image at a time, changing its value by some function of a local region (window) of pixels.
The operator moves over the image to affect all the pixels in the image.
![Page 5: Implementation and comparison of Low pass filters in Frequency domain](https://reader035.fdocuments.net/reader035/viewer/2022070512/589cdbb61a28ab43388b73b1/html5/thumbnails/5.jpg)
COMPARISON BETWEEN TYPES OF LPFIdeal LPF: Cuts off all components that are greater than distance Do from center
Butterworth LPF: The transfer function of a Butterworth low pass filter of order n with cut-off
frequency at distance D0 from the origin No clear cut-off between passed & filtered frequencies
Gaussian LPF: Does not have sharp discontinuity Transfer function is smooth, like Butterworth filter
![Page 6: Implementation and comparison of Low pass filters in Frequency domain](https://reader035.fdocuments.net/reader035/viewer/2022070512/589cdbb61a28ab43388b73b1/html5/thumbnails/6.jpg)
nDvuDvuH 2
0 ]/),([11),(
Ideal LPF
Butterworth LPF
Gaussian LPF
![Page 7: Implementation and comparison of Low pass filters in Frequency domain](https://reader035.fdocuments.net/reader035/viewer/2022070512/589cdbb61a28ab43388b73b1/html5/thumbnails/7.jpg)
IMPLEMENTATION OF ALL TYPES OF LPF
EXAMPLE 1 - NOISY BIRD IMAGE
![Page 8: Implementation and comparison of Low pass filters in Frequency domain](https://reader035.fdocuments.net/reader035/viewer/2022070512/589cdbb61a28ab43388b73b1/html5/thumbnails/8.jpg)
Original Image of noisy miner bathing image
![Page 9: Implementation and comparison of Low pass filters in Frequency domain](https://reader035.fdocuments.net/reader035/viewer/2022070512/589cdbb61a28ab43388b73b1/html5/thumbnails/9.jpg)
Result of Ideal Low Pass Filter
![Page 10: Implementation and comparison of Low pass filters in Frequency domain](https://reader035.fdocuments.net/reader035/viewer/2022070512/589cdbb61a28ab43388b73b1/html5/thumbnails/10.jpg)
Result of Butterworth Low Pass Filter
![Page 11: Implementation and comparison of Low pass filters in Frequency domain](https://reader035.fdocuments.net/reader035/viewer/2022070512/589cdbb61a28ab43388b73b1/html5/thumbnails/11.jpg)
Result of Gaussian Low Pass Filter
![Page 12: Implementation and comparison of Low pass filters in Frequency domain](https://reader035.fdocuments.net/reader035/viewer/2022070512/589cdbb61a28ab43388b73b1/html5/thumbnails/12.jpg)
Result of Butterworth Low Pass Filter Result of Gaussian Low Pass Filter
Original Image Result of Ideal Low Pass Filter
Fourier Spectrum of Bird Image
![Page 13: Implementation and comparison of Low pass filters in Frequency domain](https://reader035.fdocuments.net/reader035/viewer/2022070512/589cdbb61a28ab43388b73b1/html5/thumbnails/13.jpg)
Result of Butterworth Low Pass Filter Result of Gaussian Low Pass Filter
Original Image Result of Ideal Low Pass Filter
Spectrum of Bird Image
![Page 14: Implementation and comparison of Low pass filters in Frequency domain](https://reader035.fdocuments.net/reader035/viewer/2022070512/589cdbb61a28ab43388b73b1/html5/thumbnails/14.jpg)
IMPLEMENTATION OF ALL TYPES OF LPF
EXAMPLE 2 - SIBERIAN HUSKY FOX IMAGE
![Page 15: Implementation and comparison of Low pass filters in Frequency domain](https://reader035.fdocuments.net/reader035/viewer/2022070512/589cdbb61a28ab43388b73b1/html5/thumbnails/15.jpg)
Original Image of Siberian Husky Fox image
![Page 16: Implementation and comparison of Low pass filters in Frequency domain](https://reader035.fdocuments.net/reader035/viewer/2022070512/589cdbb61a28ab43388b73b1/html5/thumbnails/16.jpg)
Result of Ideal Low Pass Filter
![Page 17: Implementation and comparison of Low pass filters in Frequency domain](https://reader035.fdocuments.net/reader035/viewer/2022070512/589cdbb61a28ab43388b73b1/html5/thumbnails/17.jpg)
Result of Butterworth Low Pass Filter
![Page 18: Implementation and comparison of Low pass filters in Frequency domain](https://reader035.fdocuments.net/reader035/viewer/2022070512/589cdbb61a28ab43388b73b1/html5/thumbnails/18.jpg)
Result of Gaussian Low Pass Filter
![Page 19: Implementation and comparison of Low pass filters in Frequency domain](https://reader035.fdocuments.net/reader035/viewer/2022070512/589cdbb61a28ab43388b73b1/html5/thumbnails/19.jpg)
Result of Butterworth Low Pass Filter Result of Gaussian Low Pass Filter
Original Image Result of Ideal Low Pass Filter
Fourier Spectrum of Siberian Husky Fox Image
![Page 20: Implementation and comparison of Low pass filters in Frequency domain](https://reader035.fdocuments.net/reader035/viewer/2022070512/589cdbb61a28ab43388b73b1/html5/thumbnails/20.jpg)
Result of Butterworth Low Pass Filter Result of Gaussian Low Pass Filter
Original Image Result of Ideal Low Pass Filter
Spectrum of Siberian Husky Fox Image
![Page 21: Implementation and comparison of Low pass filters in Frequency domain](https://reader035.fdocuments.net/reader035/viewer/2022070512/589cdbb61a28ab43388b73b1/html5/thumbnails/21.jpg)
IMPLEMENTATION OF ALL TYPES OF LPF
EXAMPLE 3 - ROSE FLOWER IMAGE
![Page 22: Implementation and comparison of Low pass filters in Frequency domain](https://reader035.fdocuments.net/reader035/viewer/2022070512/589cdbb61a28ab43388b73b1/html5/thumbnails/22.jpg)
Original Image of Rose Flower image
![Page 23: Implementation and comparison of Low pass filters in Frequency domain](https://reader035.fdocuments.net/reader035/viewer/2022070512/589cdbb61a28ab43388b73b1/html5/thumbnails/23.jpg)
Result of Ideal Low Pass Filter
![Page 24: Implementation and comparison of Low pass filters in Frequency domain](https://reader035.fdocuments.net/reader035/viewer/2022070512/589cdbb61a28ab43388b73b1/html5/thumbnails/24.jpg)
Result of Butterworth Low Pass Filter
![Page 25: Implementation and comparison of Low pass filters in Frequency domain](https://reader035.fdocuments.net/reader035/viewer/2022070512/589cdbb61a28ab43388b73b1/html5/thumbnails/25.jpg)
Result of Gaussian Low Pass Filter
![Page 26: Implementation and comparison of Low pass filters in Frequency domain](https://reader035.fdocuments.net/reader035/viewer/2022070512/589cdbb61a28ab43388b73b1/html5/thumbnails/26.jpg)
Result of Butterworth Low Pass Filter Result of Gaussian Low Pass Filter
Original Image Result of Ideal Low Pass Filter
Fourier Spectrum of Rose Flower Image
![Page 27: Implementation and comparison of Low pass filters in Frequency domain](https://reader035.fdocuments.net/reader035/viewer/2022070512/589cdbb61a28ab43388b73b1/html5/thumbnails/27.jpg)
Result of Butterworth Low Pass Filter Result of Gaussian Low Pass Filter
Original Image Result of Ideal Low Pass Filter
Spectrum of Rose Flower Image
![Page 28: Implementation and comparison of Low pass filters in Frequency domain](https://reader035.fdocuments.net/reader035/viewer/2022070512/589cdbb61a28ab43388b73b1/html5/thumbnails/28.jpg)
IMPLEMENTATION OF ALL TYPES OF LPF
EXAMPLE 4 - CAT IMAGE
![Page 29: Implementation and comparison of Low pass filters in Frequency domain](https://reader035.fdocuments.net/reader035/viewer/2022070512/589cdbb61a28ab43388b73b1/html5/thumbnails/29.jpg)
Original Image of Wild Cat image
![Page 30: Implementation and comparison of Low pass filters in Frequency domain](https://reader035.fdocuments.net/reader035/viewer/2022070512/589cdbb61a28ab43388b73b1/html5/thumbnails/30.jpg)
Result of Ideal Low Pass Filter
![Page 31: Implementation and comparison of Low pass filters in Frequency domain](https://reader035.fdocuments.net/reader035/viewer/2022070512/589cdbb61a28ab43388b73b1/html5/thumbnails/31.jpg)
Result of Butterworth Low Pass Filter
![Page 32: Implementation and comparison of Low pass filters in Frequency domain](https://reader035.fdocuments.net/reader035/viewer/2022070512/589cdbb61a28ab43388b73b1/html5/thumbnails/32.jpg)
Result of Gaussian Low Pass Filter
![Page 33: Implementation and comparison of Low pass filters in Frequency domain](https://reader035.fdocuments.net/reader035/viewer/2022070512/589cdbb61a28ab43388b73b1/html5/thumbnails/33.jpg)
Result of Butterworth Low Pass Filter Result of Gaussian Low Pass Filter
Original Image Result of Ideal Low Pass Filter
Fourier Spectrum of Wild Cat Image
![Page 34: Implementation and comparison of Low pass filters in Frequency domain](https://reader035.fdocuments.net/reader035/viewer/2022070512/589cdbb61a28ab43388b73b1/html5/thumbnails/34.jpg)
Result of Butterworth Low Pass Filter Result of Gaussian Low Pass Filter
Original Image Result of Ideal Low Pass Filter
Spectrum of Wild Cat Image
![Page 35: Implementation and comparison of Low pass filters in Frequency domain](https://reader035.fdocuments.net/reader035/viewer/2022070512/589cdbb61a28ab43388b73b1/html5/thumbnails/35.jpg)
IMPLEMENTATION OF ALL TYPES OF LPF
EXAMPLE 5 - MOVIE POSTER IMAGE
![Page 36: Implementation and comparison of Low pass filters in Frequency domain](https://reader035.fdocuments.net/reader035/viewer/2022070512/589cdbb61a28ab43388b73b1/html5/thumbnails/36.jpg)
Original Image of Movie Poster image
![Page 37: Implementation and comparison of Low pass filters in Frequency domain](https://reader035.fdocuments.net/reader035/viewer/2022070512/589cdbb61a28ab43388b73b1/html5/thumbnails/37.jpg)
Result of Ideal Low Pass Filter
![Page 38: Implementation and comparison of Low pass filters in Frequency domain](https://reader035.fdocuments.net/reader035/viewer/2022070512/589cdbb61a28ab43388b73b1/html5/thumbnails/38.jpg)
Result of Butterworth Low Pass Filter
![Page 39: Implementation and comparison of Low pass filters in Frequency domain](https://reader035.fdocuments.net/reader035/viewer/2022070512/589cdbb61a28ab43388b73b1/html5/thumbnails/39.jpg)
Result of Gaussian Low Pass Filter
![Page 40: Implementation and comparison of Low pass filters in Frequency domain](https://reader035.fdocuments.net/reader035/viewer/2022070512/589cdbb61a28ab43388b73b1/html5/thumbnails/40.jpg)
Result of Butterworth Low Pass Filter Result of Gaussian Low Pass Filter
Original Image Result of Ideal Low Pass Filter
Fourier Spectrum of Movie Poster Image
![Page 41: Implementation and comparison of Low pass filters in Frequency domain](https://reader035.fdocuments.net/reader035/viewer/2022070512/589cdbb61a28ab43388b73b1/html5/thumbnails/41.jpg)
Result of Butterworth Low Pass Filter Result of Gaussian Low Pass Filter
Original Image Result of Ideal Low Pass Filter
Spectrum of Movie Poster Image
![Page 42: Implementation and comparison of Low pass filters in Frequency domain](https://reader035.fdocuments.net/reader035/viewer/2022070512/589cdbb61a28ab43388b73b1/html5/thumbnails/42.jpg)
DEMONSTRATION OF IMPLEMENTATION IN
MATLAB
![Page 43: Implementation and comparison of Low pass filters in Frequency domain](https://reader035.fdocuments.net/reader035/viewer/2022070512/589cdbb61a28ab43388b73b1/html5/thumbnails/43.jpg)
APPENDIX – MATLAB CODELow Pass Filter Function
H = lpfilter(type, M, N, D0, n)
[U, V] = dftuv(M, N);
D = sqrt(U.^2 + V.^2);
switch type
case 'ideal'
H = double(D <=D0);
case 'btw'
if nargin == 4
n = 1;
end
H = 1./(1 + (D./D0).^(2*n));
case 'gaussian'
H = exp(-(D.^2)./(2*(D0^2)));
otherwise
error('Unknown filter type.')
end
![Page 44: Implementation and comparison of Low pass filters in Frequency domain](https://reader035.fdocuments.net/reader035/viewer/2022070512/589cdbb61a28ab43388b73b1/html5/thumbnails/44.jpg)
APPENDIX – MATLAB CODEIdeal Low Pass Filter
fox=imread('fox.jpg');
fox=rgb2gray(fox);
imshow(fox)
PQ = paddedsize(size(fox));
D0 = 0.05*PQ(1);
H = lpfilter('ideal', PQ(1), PQ(2), D0);
F=fft2(double(fox),size(H,1),size(H,2));
LPFS_fox = H.*F;
LPF_fox=real(ifft2(LPFS_fox));
LPF_fox=LPF_fox(1:size(fox,1), 1:size(fox,2));
figure, imshow(LPF_fox, [])
Fc=fftshift(F);
Fcf=fftshift(LPFS_fox);
S1=log(1+abs(Fc));
S2=log(1+abs(Fcf));
figure, imshow(S1,[])
figure, imshow(S2,[])
![Page 45: Implementation and comparison of Low pass filters in Frequency domain](https://reader035.fdocuments.net/reader035/viewer/2022070512/589cdbb61a28ab43388b73b1/html5/thumbnails/45.jpg)
APPENDIX – MATLAB CODEButterworth Low Pass Filter
fox=imread('fox.jpg');fox=rgb2gray(fox);imshow(fox)PQ = paddedsize(size(fox));
D0 = 0.05*PQ(1);H = lpfilter('btw', PQ(1), PQ(2), D0);
F=fft2(double(fox),size(H,1),size(H,2));
LPFS_fox = H.*F;
LPF_fox=real(ifft2(LPFS_fox));
LPF_fox=LPF_fox(1:size(fox,1), 1:size(fox,2));figure, imshow(LPF_fox, [])
Fc=fftshift(F);Fcf=fftshift(LPFS_fox);S1=log(1+abs(Fc));S2=log(1+abs(Fcf));figure, imshow(S1,[])figure, imshow(S2,[])
![Page 46: Implementation and comparison of Low pass filters in Frequency domain](https://reader035.fdocuments.net/reader035/viewer/2022070512/589cdbb61a28ab43388b73b1/html5/thumbnails/46.jpg)
APPENDIX – MATLAB CODEGaussian Low Pass Filter
fox=imread('fox.jpg');fox=rgb2gray(fox);imshow(fox)PQ = paddedsize(size(fox));D0 = 0.05*PQ(1);H = lpfilter('gaussian', PQ(1), PQ(2), D0);F=fft2(double(fox),size(H,1),size(H,2));LPFS_fox = H.*F;LPF_fox=real(ifft2(LPFS_fox));LPF_fox=LPF_fox(1:size(fox,1), 1:size(fox,2));figure, imshow(LPF_fox, [])Fc=fftshift(F);Fcf=fftshift(LPFS_fox);S1=log(1+abs(Fc));S2=log(1+abs(Fcf));figure, imshow(S1,[])figure, imshow(S2,[])
![Page 47: Implementation and comparison of Low pass filters in Frequency domain](https://reader035.fdocuments.net/reader035/viewer/2022070512/589cdbb61a28ab43388b73b1/html5/thumbnails/47.jpg)
APPENDIX – MATLAB CODEMeshgrid Frequency Matrices.
function [U, V] = dftuv(M, N)
u = 0:(M-1);
v = 0:(N-1);
idx = find(u > M/2);
u(idx) = u(idx) - M;
idy = find(v > N/2);
v(idy) = v(idy) - N;
[V, U] = meshgrid(v, u);
![Page 48: Implementation and comparison of Low pass filters in Frequency domain](https://reader035.fdocuments.net/reader035/viewer/2022070512/589cdbb61a28ab43388b73b1/html5/thumbnails/48.jpg)
APPENDIX – MATLAB CODEPadding for Fourier Transform
function PQ = paddedsize(AB, CD, PARAM)
if nargin == 1
PQ = 2*AB;
elseif nargin == 2 & ~ischar(CD)
PQ = AB + CD - 1;
PQ = 2 * ceil(PQ / 2);
elseif nargin == 2
m = max(AB);
P = 2^nextpow2(2*m);
PQ = [P, P];
elseif nargin == 3
m = max([AB CD]);
P = 2^nextpow2(2*m);
PQ = [P, P];
else
error('Wrong number of inputs.')
end
![Page 49: Implementation and comparison of Low pass filters in Frequency domain](https://reader035.fdocuments.net/reader035/viewer/2022070512/589cdbb61a28ab43388b73b1/html5/thumbnails/49.jpg)
THANK YOU!