Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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
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