I want to apply 2d DFT to a N by N image. However, image is vectorized such that it is NxN by 1. How can i find the matrix form of 2d DFT such that resulting vector from multiplication is the vectorized NxN by 1 2d DFT of my N by N image?


1 Answer 1


In matrix form, we can write the 2-D DFT of an Image $\mathbf X$ via $\hat{\mathbf{X}} = \mathbf F \mathbf X \mathbf F^{\rm T}$.

This expression can be vectorized with the help of the Kronecker product. Using [*], we obtain $$\hat{{\mathbf{x}}} = {\rm vec}\{\hat{\mathbf{X}}\} = (\mathbf F \otimes \mathbf F) \cdot \mathbf{x}.$$

This shows that the matrix you need is $\mathbf F \otimes \mathbf F$.

  • $\begingroup$ thank you very much. Works like a charm! I cannot upvote due to my reputation though :/ Have a nice day! $\endgroup$
    – strahd
    Commented Jul 9, 2019 at 9:47
  • $\begingroup$ You're welcome! Glad to hear it helped. You should be able to accept it as an answer though. ;-) $\endgroup$
    – Florian
    Commented Jul 9, 2019 at 10:56
  • $\begingroup$ how about the inverse 2D-DFT? $\endgroup$
    – mlbj
    Commented Apr 6, 2023 at 14:40
  • 2
    $\begingroup$ @mlbj: it would be quite similar, you would only need to replace $\mathbf F$ by its complex conjugate (and adjust for the scaling, depending on your preferred scaling convention), since $\mathbf F \mathbf F^{\rm H}$ is a scaled identity if $^{\rm H}$ denotes the conjugate (Hermitian) transpose. $\endgroup$
    – Florian
    Commented Apr 11, 2023 at 9:35
  • $\begingroup$ thank you very much! $\endgroup$
    – mlbj
    Commented Apr 11, 2023 at 11:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.