An Ideal Low Pass Filter in frequency domain

[M N] = size(img)
filter=zeros(M,N);
d0= ' insert value her for the cutoff frequency';
for a=1:10
for i=1:M
for j=1:N
if ((i-M/2)^2 + (j-N/2)^2 == d0^2 ) %changing values in this changes the resultant blurring effect , ringing effect can be observed
filter(i,j)=1;
end
end
end
end