I have an $N \times N$ image say $x$. Its Fourier transform is $X$, same size $N \times N$.
Now I have a mask $M$ applied to $X$. By "applied" I mean element wise multiplication.
According to convolution theorem, this is equivalent to convolving $m$ with $x$, where $m$ is the inverse Fourier transform of $M$ and $x$ is the inverse Fourier transform of $X$.
In this case, both $x$ and $m$ are of same size $N \times N$. So I am wondering in this case, how do we do convolution between $x$ and $m$ ? Thanks a lot.
You need to apply 2D circular convolution, if your image is large enough and your filter is small enough (at least its energy is mostly localized) you may also survive with linear convolution (with some degradations along image borders).