% Chapter 11, Example 11.1, Fig.11.3 % Eric Dubois, updated 2018-12-24 % Plot unit cells of reciprocal lattices for upsampling % Required functions: Lattice_Points_2d, ds2nfu clear all close all %sampling matrices of reciprocal lattices and portion of R^2 to plot VLs = [0.5 0; 0 0.625]; VGs = [0.5 0; -0.625 1.25]; UL = [-0.5 -0.625]'; LR = [0.5 0.625]'; %get the points of the lattices in the desired region xoutLs = Lattice_Points_2d(VLs,UL,LR); xoutGs = Lattice_Points_2d(VGs,UL,LR); %create the plot %set the plot size and font figure %plot the points points = plot(xoutLs(:,1),xoutLs(:,2),'k.',xoutGs(:,1),xoutGs(:,2),'ks'); points(1).MarkerSize= 9; points(2).MarkerSize= 8; axis equal axis off set(gca,'ydir','reverse'); hold on %plot the unit cells rectangle('Position',[-.25,-.3125,.5,.625]); diamond = polyshape([0 .5 0 -.5],[-.625 0 .625 0]); plot(diamond,'Facecolor','white') %label unit cells strPL = '$$\mathcal{P}_{\Lambda^*}$$'; text(.35,.35,strPL,'Interpreter','latex'); strPG = '$$\mathcal{P}_{\Gamma^*}$$'; text(-.6,-.1,strPG,'Interpreter','latex'); [aGx,aGy] = ds2nfu([-.48 -.35],[.1 .07]); annotation('arrow',aGx,aGy,'headlength',4,'headwidth',4); [aLx, aLy] = ds2nfu([.33 .2],[-.3 -.25]); annotation('arrow',aLx,aLy,'headlength',4,'headwidth',4); % Label filter values text(.15,-.2,'c'); text(.1,-.4,'0'); text(.1,.4,'0'); text(-.37,.1,'0'); text(.35,.1,'0'); %create the axes %u axis from -.6 to .6 [xaxx,xaxy] = ds2nfu([-.6 .65], [0 0]); annotation('arrow',xaxx,xaxy,'headlength',5,'headwidth',5); %y axis from -.7 to .7 [yaxx,yaxy] = ds2nfu([0.0 0.0],[.7 -.75]); annotation('arrow',yaxx,yaxy,'headlength',5,'headwidth',5); text(.7,-0.05,'\itu') text(-0.1, .75, '\itv') %insert axis labels strX = '$$1/2X$$'; text(0.45,-.07,strX,'Interpreter','latex') strY = '$$\frac{1}{2Y}$$'; text(0.03,.65,strY,'Interpreter','latex'); set(gcf,'Color',[1 1 1]);