Copyright 2015 by D.G. Long at Brigham Young University. All rights reserved. Source code may be used for non-commerical purposes so long as paper is cited. Matlab source that demonstrates 2d reconstruction from variable aperture irregular sampling described in D.G. Long and R. Franz, Bandlimited Signal Reconstruction from Irregular Samples with Variable Apertures, IEEE Trans. Geosci. Remote Sensing, 2015. ************************************************************** Key files: demo_irregrecon2d.m : demonstrates 2d sampling and reconstruction w/o aperture demo_irregrecon2dAp.m : demonstrates 2d sampling and reconstruction w/aperture irregrecon2d.m : 2d reconstruction w/o aperature irregrecon2dAp.m : 2d reconstruction w/aperature test_sampling2d.m : test 2d sampling checkrankD.m : generates and tests rank of D1 matrix w/o aperture checkrankD_Ap.m : generates and test rank of Dv matrix (D1 w/aperture) Support files: Dm.m : compute 1d M-order Dirichlet function Dm2d.m : compute 2d M1,M2-order Dirichlet function ApDm2d.m : compute 2d aperture-filtered M1,M2-order Dirichlet function plotlocs.m : plot 2d sample locations myfigure.m : matlab routine to provide functionality similar to figure.m randsample1d.m : 1d sampling routine randsample2d.m : 2d sampling routine README.txt : this file ************************************************************** Matlab notes: Two dimensional arrays in Matlab can sometimes be confusing so the following simple examples and notes are provided. Note that Matlab images by default have their origin at the upper left corner, which matches the Matlab matrix convention used below. By convention in this Matlab implemenation, M1 and N1 are associated with the column (x or I) axis, while M2 and N2 are associated with the row (y or J) axis. An N1xN2 array A is thus dimensioned A=zeros([N2,N1]). Note that Matlab uses column-first indexing for one-dimensional indexing of two-dimensional arrays. Thus, >> A=[1 4; 2 5; 3 6] % semi-colons separate rows on entry A = % {x,cols -> y,rows \/} 1 4 2 5 3 6 >> [N2,N1]=size(A) N2 = 3 N1 = 2 >> A(3,2) % A(row=3,col=2) ans = 6 >> A(:) % produces a column vector ans = 1 2 3 4 5 6 >> x=floor((A-1)/N2)+1 % x (col) [N1] cordinate location is x = 1 2 1 2 1 2 >> y=mod(A-1,N2)+1 % y (row) [N2] coordinate location is y = 1 1 2 2 3 3 >> [y,x]=ind2sub([N2,N1],A) % equivalent to two previous statements y = 1 1 2 2 3 3 x = 1 2 1 2 1 2 >> y(:) % produces a column vector ans = 1 2 3 1 2 3 >> x(:) % produces a column vector ans = 1 1 1 2 2 2 >> A=sub2ind([N2,N1],y,x) A = 1 4 2 5 3 6 >> A=y+(x-1)*N2 % equvalent to previous statement A = 1 4 2 5 3 6 > [y,x]=ind2sub([N2,N1],A(:)) % produces column vectors y = 1 2 3 1 2 3 x = 1 1 1 2 2 2 >> sub2ind([N2,N1],y(:),x(:)) % produces column vectors ans = 1 2 3 4 5 6 >> cols=[1 2]; rows=[1 2 3]; % for cubic lattice locations >> [x,y]=meshgrid(cols,rows) x = 1 2 1 2 1 2 y = 1 1 2 2 3 3 >> x=repmat(cols,length(rows),1) % equiv to previous line >> y=repmat(rows',1,length(cols)) x = 1 2 1 2 1 2 y = 1 1 2 2 3 3