This page describes how to calculate the quality factor (Q) of resonance peaks in a resonant cavity.
There are two classes of cavities for Q factor calculations, low Q cavities and high Q cavities. The 2D example file includes both the standard (high) Q analysis object, and the low Q analysis object. The 3D example only includes the standard analysis object because the quality factor of this cavity is too high for the low Q object. Both simulation files contain a cavity that supports two modes, and a Q analysis group to compute the Q factor. The high and low Q analysis groups can also be inserted into your simulation from the object library in the resonators section.

A cavity is called a low Q cavity when the electromagnetic fields decay completely from the simulation in a time that can be simulated reasonably by FDTD. In this case, the quality factor can be determined from the Fourier transform of the field by finding the resonance frequencies of the signal and measuring the full width half maximum (FWHM) of the resonant peaks. We can then use Q = fR/Δf where fR is the resonant frequency and Δf is the FWHM.
The low Q analysis group contained in the quality_factor_2D.fsp simulation uses this method to find the Q factor of resonance frequencies. Run the simulation file. Then choose to edit the low Q analysis object and press the RUN ANALYSIS button. The analysis script output will contain the location of the resonance frequencies and their corresponding Q factors.
Resonance 1:
frequency = 230.727THz, or 1299.34 nm
Q = 156.883 +/ 0.82616
Resonance 2:
frequency = 205.814THz, or 1456.62 nm
Q = 77.498 +/ 0.226738
The analysis script also creates two plots. The plot shown below to the left contains one of the field components (Hz). You can see that the fields have decayed by the end of the simulation time. The second plot shows the location and relative amplitude of the resonance peaks.
Note that the initial transients of the source are neglected by setting the "start time" for the time monitors to 200fs. The "start time" for the time monitors is the time at which the monitors begin recording data. This setting can be changed in the user properties for the analysis group. Also, note that in the analysis group, it is possible to use one time monitor or an array of time monitors for the Q factor calculation. The problem with using one time monitor is that if the one monitor is placed at or near a null of the cavity mode, then due to the fact that the field intensity is very low, the Q factor can have a large uncertainty (if it is even possible to obtain a meaningful result).
The quality_factor_3D.fsp simulation file contains a 3D version of the low Q analysis object. This object can also be added from the object library.
A cavity is considered to be a high Q cavity when the electromagnetic fields cannot completely decay from the simulation in a time that can be simulated reasonably by FDTD. In this case, we cannot determine Q from the frequency spectrum because the FWHM of each resonance in the spectrum is limited by the time of simulation, Tsim, by FWHM ~ 1/Tsim. Instead, the quality factor should be determined by the slope of the envelope of the decaying signal using the formula
$$Q=\frac{2 \pi_f{R} \log _{10}(e)}{2 m}$$
where fR is the resonant frequency of the mode, and m is the slope of the decay in SI units.
The quality factor (Q) is defined as
$$Q=\frac{\omega_{r}}{F W H M}$$
where wr is the resonant frequency ( ωr=2π fR) and FWHM is the full width half max of the resonance intensity spectrum. The time domain signal of the resonance is described by
$$E(t)=e^{r\left(\alphai \omega_{r}\right)} u(t)$$
where α is the decay constant. The Fourier transform of E(t) is easy to calculate
$$E(\omega)^{2}=\frac{1}{\alpha^{2}+\left(\omega\omega_{r}\right)^{2}}$$
The maximum value of E( ω)^2 is clearly 1/α^2, at ω= ωr. With a little more work, we can determine that the half max frequencies occurs at ω= ωr + α and ω= ωr  α. Therefore, FWHM = 2α. Substituting this value into the original Q formula and solving for α gives
$$\alpha=\frac{\omega_{r}}{2 Q}$$
Now that we know how to relate α to Q, we must determine how the slope of the time signal decay is related to Q. We must take the log of the time signal to make the envelope a linear function.
$$\log _{10}(E(t))=\frac{\omega_{r} t}{2 Q} \log _{10}(e)=m t$$
where m is the slope of the log of the time signal envelope. Solving for Q, we get
$$Q=\frac{\omega_{r} \log _{10}(e)}{2 m}$$
Calculation of the Q factor for high Q cavities is complicated because
• separating the decay of the envelope from the underlying sinusoidal signal is difficult since the fields are typically realvalued
• if there are multiple resonant modes, they will interfere with each other in the time domain, making it hard to estimate the decay rate.
By opening the edit dialog box for the Q factor analysis object located in quality_factor_3D.fsp, you can see that the analysis object solves these problems by
•accurately calculating the envelope of the timedomain field signal
•isolating each resonance peak in the frequency domain using a Gaussian filter, and then taking the inverse Fourier transform to calculate the time decay separately for each peak. The slope of the time decay is then used to calculate the Q factor and obtain an error estimate.
In addition, note that:
•the Q analysis object has setup variables that allow you to choose how many time monitors to use to calculate the Q factor. It is often a good idea to add a few point monitors at different locations to reduce the chances that a monitor is placed at a node in the mode profile of a cavity mode yielding a weak signal.
•in the analysis tab, there is a parameter that can be set to choose how many resonant peaks to look for
•all the field components that are available are used to calculate the Q factor
•it is possible to change other parameters, such as the Gaussian filter width and resolution in the frequency domain. These parameters are set in the analysis script.
•in the script, only the part of the time signal lying in 4060% of the time signal collected is used for the slope calculation. These percentages can easily be changed. However, setting the upper limit to anything greater than 90% can lead to errors due to the fact that Fourier transforms, and inverse transforms were used when the Gaussian filter was used to isolate the peak. The Fourier transforms introduce errors to the end of the time signal due to the fact that discrete Fourier transforms assume periodicity of the signal.
Next, run the simulation. When the simulation is complete, choose to edit the analysis object and press RUN ANALYSIS button. The analysis script output will contain the location of the resonance frequencies and their corresponding Q factors.
Resonance 1:
frequency = 178.786THz, or 1676.82 nm
Q = 306.279 +/ 1.41318
Resonance 2:
frequency = 227.307THz, or 1318.89 nm
Q = 274.874 +/ 4.50921
The analysis object also produces the following plots (by modifying make_plots=0 to make_plots=1 before running the analysis).
The quality_factor_2D.fsp simulation file contains a 2D version of the Q analysis object.