/tomo/dfi

To get this branch, use:
bzr branch http://suren.me/webbzr/tomo/dfi
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
function [res]=interpolate(f, angle_step, oversample_multiply,cutof_freq)
    n = size(f,1);
    full = n * oversample_multiply;
    full2 = full / 2;

    [a,b]=meshgrid(-full2:(full2-1),-full2:(full2-1));
    rad_step=degtorad(angle_step);

    c2=zeros(full,full);
    c1=atan2(b,a);
    c2(c1<0)=pi + c1(c1<0);
    c2(c1>0)=c1(c1>0);
    c=min(1 + (c2/rad_step), size(f,2));

    r = (n/2) + min((sqrt((a.*a)+(b.*b))/(oversample_multiply)),n/2);

    r2=r;
    r2(c1<0)=(n+1)-r(c1<0);

    res1=interp2(f,c,r2,'nearest');
    res=res1;
    res((r-(n/2))>=cutof_freq*n/2)=0;
end