Question
Digital Image processing . Title: 2D DFT/FFT and its properties: 1) Write five MATLAB scripts that use your myDFT to demonstrate properties 2, 3 and
Digital Image processing . Title: 2D DFT/FFT and its properties:
1) Write five MATLAB scripts that use your myDFT to demonstrate properties 2, 3 and 8, in Table 4.1. That is, show that the left-hand-side is equal to the right-hand-side for some random image(s) (properties 2 and 3) or specific signal (properties 8).
Table4.1:
Below is an example of how to demonstrate property 6 which is the convolution theorem. Your scripts should be similarly structured.
Example For property 6:
clear all;
M = 10;
N = 5;
f = rand(M,M);
h = rand(N,N);
% Demonstrate the convolution theorem.
% Compute left-hand-side of property: LHS = conv2(f, h, 'same');
% Compute right-hand-side of property:
% Need to zero-pad to M+N-1.
P = M+N-1;
f_zp = zeros(P,P);
f_zp(1:M,1:M) = f;
h_zp = zeros(P,P);
h_zp(1:N,1:N) = h;
% Compute DFT of f and h. assume you have this mydft2 function already
F_DFT = mydft2(f_zp);
H_DFT = mydft2(h_zp);
% Multiply in frequency domain.
G_DFT = F_DFT .* H_DFT;
% Compute inverse DFT.
g_zp = ifft2(G_DFT);
% Crop. Valid for odd N only.
RHS = g_zp(1+(N-1)/2:M+(N-1)/2,1+(N-1)/2:M+(N-1)/2);
% Compute sum-of-squared-difference.
d = norm(LHS(:)-RHS(:));
fprintf(1,'difference between LHS and RHS is %e ', d );
%***************************Script END*******************
output from this code is: difference between LHS and RHS is 9.087538e-014
(the difference is very small, therefore left side is equal to right side)
I also attached the example code as picture:
TABLE 4.1 Spatial Domain Frequency Domain Some symmetry properties of the f(r, y) rea F (u v) F(-u 2-D DFT and its inverse. R(u, v) f (x, y) imaginary F (-u, 3- F(u, v) and I u, v) are the real and imaginary 3) f(r, y) real R(u, v) even; I (ut, v) odd parts of F (u, v), f (x, y) imaginary u, v) odd: 1 (u. v) even respectively. The term complex f (-x, y) real F (u, v) complex indicates that a function has f x, -y) complex (-u, -v) complex nonzero real and f x, y) complex F (-u v) complex imaginary parts f(x, y) real and even ll, v) real and even fox, y) real and odd F v) imaginary and odd 10) f (x. y) imaginary and even li, v) imaginary and even f (r. y) imaginary and odd li. v) real and odd 11) 12) f (r. y) complex and even F(u, v) complex and even f(x, y) complex and odd F(u. v) compiex and odd 13) Recall hat y.u. and v are discrete (integer) variables. with r and u in the range 10. M I. and y, and in the range N ll. To say that a complex function is even means that its real and imaginary parts are even. and similarly for an odd complex function
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started