DelayFidelity ============= ```{function} DelayFidelity(nf2ff, port, path, weight_theta, weight_phi, theta, phi, f_lo, f_hi, varargin) ``` Full definition: ```{code-block} matlab [delay, fidelity] = DelayFidelity(nf2ff, port, path, weight_theta, weight_phi, theta, phi, f_lo, f_hi, varargin) ``` This function calculates the time delay from the source port to the phase center of the antenna and the fidelity. The fidelity is the similarity between the excitation pulse and the radiated pulse (normalized scalar product). The resolution of the delay will be equal to or better than ((f_0 + f_c)*Oversampling)^-1 when using Gaussian excitation. Oversampling is an input parameter to InitFDTD. The rows of delay and fidelity correspond to theta and the columns to phi. input: - nf2ff: return value of CreateNF2FFBox. - port: return value of AddLumpedPort - path: path of the simulation results. - weight_theta: weight of the E_theta component - weight_phi: weight of the E_phi component -> with both (possibly complex) parameters any polarization can be examined - theta: theta values to be simulated - phi: phi values to be simulated - f_0: center frequency of SetGaussExcite - f_c: cutoff frequency of SetGaussExcite variable input: - 'Center': phase center of the antenna for CalcNF2FF - 'Radius': radius for CalcNF2FF - 'Mode': mode CalcNF2FF example: theta = [-180:10:180] * pi / 180; phi = [0, 90] * pi / 180; % use circular right handed polarization [delay, fidelity] = DelayFidelity2(nf2ff, port, Sim_Path, -1i, 1, theta, phi, f_0, f_c, 'Mode', 1); figure polar(theta.', delay(:,1) * 3e11); % delay in mm figure polar(theta', (fidelity(:,1)-0.95)/0.05); % last 5 percent of fidelity Author: Georg Michel