######################################################## # file: ring_group_delay_fdtd.lsf # # Description: Extract Hz from a time monitor # to calcualte group delay caused by the ring # # Copyright 2013, Lumerical Solutions, Inc. ######################################################## #extract data from a time monitor Hz = pinch(getdata("t_through","Hz")); t = getdata("t_through","t"); plot(t*1e12,Hz, "t (ps)","H-Field"); #fourier transform and extract the phase f = linspace(c/1600e-9,c/1500e-9,50000); w = 2*pi*f; Hw = czt(Hz,t,w)/sourcenorm(f); phi = unwrap(angle(Hw)); plot(c/f*1e9,phi,"Wavelength(nm)","phase"); #differentiate phase w.r.t frequency w2 = 0.5*(w(2:length(w))+w(1:length(w)-1)); l2 = c/(w2)*2*pi; gd = phi(2:length(phi))-phi(1:length(phi)-1); gd = gd / (w(2:length(w))-w(1:length(w)-1)); plot(l2*1e9,gd*1e12,"Wavelength (nm)","Group delay (ps)");