Question: digital image processing : Title: 2D DFT/FFT and its properties. 1) In MATLAB, write the function myDFT2 which takes as input a (complex) matrix X

digital image processing : Title: 2D DFT/FFT and its properties.

1) In MATLAB, write the function myDFT2 which takes as input a (complex) matrix X and outputs the 2D DFT of X: Y = myDFT2(X);

Your function should compute the 2D DFT by computing the 1D DFT along the rows and then along the columns (or vice-versa).

You should therefore also write the function myDFT which takes as input a vector and outputs the 1D DFT of the vector.

**have to use Input X = single(rand(2^i,1)) + j * single(rand(2^i,1)); where i = 1 to 16

possible solution:

% Computes the discrete Fourier transform (DFT) of the given vector. % input 'X' can be a row vector or a column vector. % The returned output is the same type of vector with the same dimensions. % function output = myDFT(X) n = length(X); output = zeros(size(X)); for k = 0 : n - 1 % For each output element s = 0; for t = 0 : n - 1 % For each input X element s = s + X(t + 1) * exp(-2i * pi * t * k / n); end output(k + 1) = s; end end 

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!