/tomo/dfi

To get this branch, use:
bzr branch http://darksoft.org/webbzr/tomo/dfi

« back to all changes in this revision

Viewing changes to simple_interpolate.m

  • Committer: Suren A. Chilingaryan
  • Date: 2013-03-22 00:21:41 UTC
  • Revision ID: csa@dside.dyndns.org-20130322002141-40r2i2pfmza3lpfc
Initial release

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
function [res]=interpolate(f, angle_step, oversample_multiply,cutof_freq)
 
2
    n = size(f,1);
 
3
    full = n * oversample_multiply;
 
4
    full2 = full / 2;
 
5
 
 
6
    [a,b]=meshgrid(-full2:(full2-1),-full2:(full2-1));
 
7
    rad_step=degtorad(angle_step);
 
8
 
 
9
    c2=zeros(full,full);
 
10
    c1=atan2(b,a);
 
11
    c2(c1<0)=pi + c1(c1<0);
 
12
    c2(c1>0)=c1(c1>0);
 
13
    c=min(1 + (c2/rad_step), size(f,2));
 
14
 
 
15
    r = (n/2) + min((sqrt((a.*a)+(b.*b))/(oversample_multiply)),n/2);
 
16
 
 
17
    r2=r;
 
18
    r2(c1<0)=(n+1)-r(c1<0);
 
19
 
 
20
    res1=interp2(f,c,r2,'nearest');
 
21
    res=res1;
 
22
    res((r-(n/2))>=cutof_freq*n/2)=0;
 
23
end
 
24