# 计算4x4 MMI 的phase error

Member Posts: 2
edited January 11

emesweep;

Hyb_SMatrix = getemesweep ('S');

G3_span = Hyb_SMatrix.group_span_3;

S21 = Hyb_SMatrix.s21;

S31 = Hyb_SMatrix.s31;

S41 = Hyb_SMatrix.s41;

S51 = Hyb_SMatrix.s51;

Phi1 = unwrap(angle (S21));

Phi2 = unwrap(angle (S31));

Phi3 = unwrap(angle (S41));

Phi4 = unwrap(angle (S51));

Phase1 = mod(Phi1-Phi4,pi);

Phase1 = (Phase1-round(Phase1/pi)*pi)/pi*180;

Phase2 = mod(Phi2-Phi3,pi);

Phase2 = (Phase2-round(Phase2/pi)*pi)/pi*180;

Phase = unwrap(mod((Phi1+Phi4)/2-(Phi2+Phi3)/2+pi/2,2*pi));

Phase = (Phase-round(mean(Phase)/pi)*pi)/pi*180;

plot(G3_span*1e6,Phase,Phase1,Phase2,'Hybrid Length (micron)','Phase error (degree)');#FOR length

legend('Phase IQ', 'phase I', 'Phase Q');

Phase = mod((Phi1+Phi4)/2-(Phi2+Phi3)/2+pi/2,2*pi);

Phase = (Phase-round(mean(Phase)/pi)*pi)/pi*180;

plot(G3_span*1e6,Phase,Phase1,Phase2,'Hybrid Length (micron)','Phase error (degree)');#FOR length

legend('Phase IQ', 'phase I', 'Phase Q');

Tagged: