How to perform a gaussian blur using FFT?
Here is the working code,

clear all; close all; clc;

I = double(imread('Cameraman.tif'))/255; % Divide only if image value in [0-255] range
figure,imshow(I);title('Cameraman original')
%I=rgb2gray(I);  % NOTE: This is only for RGB images, commented otherwise
sigma=3;
[M,N,s]=size(I);
f1=-fix(M/2):ceil(M/2)-1;
f2=-fix(N/2):ceil(N/2)-1;
[fx,fy]=meshgrid(f1,f2);

X=exp(-2*pi*pi*sigma*sigma*((fx/M).^2+(fy/N).^2));
If=fft2(I);
If=fftshift(If);
If=If.*X;
If=ifftshift(If);
I=real(ifft2(If));
figure,imshow(I);title(['filtered image with \sigma =', num2str(sigma)])