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?
Asked
Active
Viewed 2,604 times
1 Answers
8
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$.
Florian
- 2,463
- 1
- 6
- 16
-
thank you very much. Works like a charm! I cannot upvote due to my reputation though :/ Have a nice day! – strahd Jul 09 '19 at 09:47
-
You're welcome! Glad to hear it helped. You should be able to accept it as an answer though. ;-) – Florian Jul 09 '19 at 10:56
-
how about the inverse 2D-DFT? – mlbj Apr 06 '23 at 14:40
-
2@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. – Florian Apr 11 '23 at 09:35
-
thank you very much! – mlbj Apr 11 '23 at 11:32