2D DFT of an image

4 views (last 30 days)
Jake Cooper
Jake Cooper on 29 Jan 2021
Answered: Bjorn Gustavsson on 25 Feb 2021
Hi, how do we perform the 2D DFT of an image without using the built-in function fft2?
Please help with the algorithm giving in detail the steps that have to be performed.
Thanks
  2 Comments
Bjorn Gustavsson
Bjorn Gustavsson on 29 Jan 2021
Why would you want to do that?
If it is for learning and understanding the FFT algoritm, then why don't you want to do it yourself? If you use someone elses code as a black-box you will learn about as little as using the built-in fft.
Jake Cooper
Jake Cooper on 25 Feb 2021
I appreciate your concern. However, it would of help if you could answer my query.

Sign in to comment.

Answers (1)

Bjorn Gustavsson
Bjorn Gustavsson on 25 Feb 2021
OK, here's a solution that's computationally useless since 1965:
szIm = size(Im);
M1 = dftmtx(szIm(1));
M2 = dftmtx(szIm(2));
sft2Im = (M1*Im)*M2;
HTH

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!