# # get data from sweep - must specify V range # iV=getsweepdata("voltage","v_index"); V = linspace(0,1,length(iV)); tx=getsweepresult("voltage","TX"); Efield=getsweepresult("voltage","Efield"); # # One period of finger profile # period_y = getnamed('tx yperiod','y') - getnamed('source2','y'); # # Loss directly from transmission # loss_dB_cm = -10*log10(tx.T)/(period_y*100); plot(V,loss_dB_cm,"Voltage (V)","Loss (dB/cm)"); # # Calculate phase assuming TE mode, average phase # at mid-point (z) of the waveguide # imidx = find(Efield.x >-1e-9); imidx = imidx(1); imidz = find((Efield.z > 0) & (Efield.z < 220e-9)); Ex_mid = pinch(Efield.E(imidx,1,imidz,1,1:length(V),1)); phase = matrix(length(V),1); for (j = 1:length(V)) { phase(j) = mean(angle(Ex_mid(1:length(imidx),j))); } dphase = phase - phase(1); # # Vpi-L calculation # a = dphase/pi; Lpi = period_y/a*100; VpiLpi = V*Lpi; VpiLpi(1) = 0; plot(V(2:length(V)),VpiLpi(2:length(V)),"Voltage (V)","Vpi-L (V-cm)");