Compute the 2D Discrete Fourier Transform (2D DFT) of a complex-valued signal stored on the GPU.
Given a 2D complex input signal of shape M × N, compute its 2D DFT spectrum
using the row-column decomposition: apply a 1D DFT along each row, then a 1D DFT along each
column of the result. All values are 32-bit floating point.
solve function signature must remain unchangedspectrumx[m, n] has its real part at index
2*(m*N + n) and imaginary part at index 2*(m*N + n) + 1
Input: M = 2, N = 2
Signal \(x[m, n]\) (real part):
\[
\begin{bmatrix}
1.0 & 0.0 \\
0.0 & 0.0
\end{bmatrix}
\]
Signal \(x[m, n]\) (imaginary part):
\[
\begin{bmatrix}
0.0 & 0.0 \\
0.0 & 0.0
\end{bmatrix}
\]
Output:
Spectrum \(X[k, l]\) (real part):
\[
\begin{bmatrix}
1.0 & 1.0 \\
1.0 & 1.0
\end{bmatrix}
\]
Spectrum \(X[k, l]\) (imaginary part):
\[
\begin{bmatrix}
0.0 & 0.0 \\
0.0 & 0.0
\end{bmatrix}
\]
M, N ≤ 4096M = 2,048, N = 2,048