Introduction - If you have any usage issues, please Google them yourself
To avoid boundary artifacts and estimate really the frequency content of the image (and not of the artifacts!), one needs to multiply M by a smooth windowing function h and compute fft2(M.*h). Use a sine windowing function. Can you interpret the resulting filter ?