1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44
| x=1:col; theta1=[0,pi/2,pi,3*pi/2]; I1=127.5+127.5*sin(theta1(1)+2*pi*x/L1); I2=127.5+127.5*sin(theta1(2)+2*pi*x/L1); I3=127.5+127.5*sin(theta1(3)+2*pi*x/L1); I4=127.5+127.5*sin(theta1(4)+2*pi*x/L1); f11=repmat(I1,row,1); f12=repmat(I2,row,1); f13=repmat(I3,row,1); f14=repmat(I4,row,1);
F1=atan2((f14-f12),(f11-f13)); F1(F1<0)=F1(F1<0)+2*pi; figure,subplot(2,3,1),imshow(F1,[]),title('相位1主值');
theta2=[0,pi/2,pi,3*pi/2]; I21=127.5+127.5*sin(theta2(1)+2*pi*x/L2); I22=127.5+127.5*sin(theta2(2)+2*pi*x/L2); I23=127.5+127.5*sin(theta2(3)+2*pi*x/L2); I24=127.5+127.5*sin(theta2(4)+2*pi*x/L2); f21=repmat(I21,row,1); f22=repmat(I22,row,1); f23=repmat(I23,row,1); f24=repmat(I24,row,1);
F2=atan2((f24-f22),(f21-f23)); F2(F2<0)=F2(F2<0)+2*pi; subplot(2,3,2),imshow(F2,[]),title('相位2主值');
theta1=[0,pi/2,pi,3*pi/2]; I31=127.5+127.5*sin(theta1(1)+2*pi*x/L3); I32=127.5+127.5*sin(theta1(2)+2*pi*x/L3); I33=127.5+127.5*sin(theta1(3)+2*pi*x/L3); I34=127.5+127.5*sin(theta1(4)+2*pi*x/L3); f31=repmat(I31,row,1); f32=repmat(I32,row,1); f33=repmat(I33,row,1); f34=repmat(I34,row,1);
F3=atan2((f34-f32),(f31-f33)); F3(F3<0)=F3(F3<0)+2*pi; subplot(2,3,3),imshow(F3,[]),title('相位3主值');
|