I'am trying to make a low pass butterworth filter for an image. I try to find a relation between dct coefficients and cutoff frequency.
I know that the low frequencies are top left side in dct, high frequencies are right down side. What is the frequency of the dct basis? The basises are sum of the cos waves but what is this basis freq. I mean can I describe this as cut off for low pass filter?
After zigzag in dct domain, I can select the coefficient that are the highest values, and I can say make the others zero lower than this coefficient. And is this coefficients frequency is the cutoff of a low pass filter. If this is true than what is that frequency corresponds to that dct2 coefficient.
Can you help me please?
step =0.3;
xmin = 26;
xmax = 44.6;
ymin = 35;
ymax = 43;
q=fix(((xmax-xmin)/step)+1);
p=fix(((ymax-ymin)/step)+1);
for a=1:p
for b=1:q
U(a,b)=46-0.3*(ymin+(p-a+1)*step)-0.3*(xmin+(b-1)*step)+0.5*cos(1.5*(xmin+(b-1)*step)-(ymin+(p-a+1)*step));
end
end
ux=dct2(U);
figure,imshow(log(abs(ux)),\[\])
colormap(gca,jet(64)),colorbar