MATLAB: Fouriertransformation on a picture using 1D DFT

dft

Hello, I'm new to this forum and unfortunately already have a question.
I have to transform a picture using a NxN DFT matrix I already constructed using matlab (for N=16 and a 1D signal f=cos((6πn/16)). Can I use the same N or do I need to adjust it to the picture? And then I have to transfer the picture to the frequency domain by applying first the column iteration and then the row iteration of the DFT, in order to save calculation time. Can someone please give me a hint on how to create the loop for this (for….end)?
Hopefully someone can help me with this Thank you already mark

Best Answer

Unless I'm missing something, if you have the DFT matrix, then multiply the image matrix by that DFT matrix, then take the transpose (without conjugating the entries!) and then multiply that result by the DFT matrix and tranpose that result (not conjugating)
So using fft() this is
x = randn(4,4);
xdft = fft(x); % equivalent to multiplying x by the DFT matrix.
ydft = fft(xdft.');
% equivalent to multiplying the xdft.' by DFT matrix
% finally
ydft = ydft.';
Compare the above to
fft2(x)