Fabry–Pérot Cavity Simulation (FDTD): 1D Optical Resonator Tutorial
1. Introduction
A Fabry–Pérot cavity is one of the simplest and most important resonant structures in optics. It consists of two partially reflecting interfaces separated by a cavity region. This behaviour is shown clearly in ??, where narrow resonant features appear because only certain wavelengths build up efficiently inside the cavity.
The structure can be understood as two mirrors facing each other with a finite optical path between them, as illustrated in ?? and in the example structure shown in ??. When light reaches the first interface, part of it enters the cavity and part is reflected. The light trapped between the two mirrors makes repeated round trips, and these multiple reflections can add together coherently.
To obtain a strong resonance, the cavity length is chosen so that the round-trip optical phase is an integer multiple of \(2\pi\). At normal incidence this condition may be written as \(2nL = m\lambda\), where \(n\) is the refractive index of the cavity region, \(L\) is the cavity length, and \(m\) is an integer mode number. Under this condition the intracavity field builds up and the transmission and reflection change very strongly with wavelength.
In this tutorial, we use the Finite-Difference Time-Domain (FDTD) method to simulate a simple 1D system with the layout PML | air | mirror | cavity | mirror | air | PML. A broadband pulse is launched at normal incidence, and we measure the reflected and transmitted spectra. Later, we will extend this to higher dimensions, where the field behaviour becomes much richer, as illustrated in ??.
The key idea is that a Fabry–Pérot cavity is not simply “two reflections”, but a resonant optical structure in which only certain wavelengths satisfy the cavity phase condition and build up strongly inside the device. This is the simplest example of an optical resonator and provides a direct route to understanding standing waves, resonance peaks, and field enhancement.
2. Making a new simulation
Open the New simulation window and select the FDTD examples category (??). Then choose the Fabry–Pérot cavity (1D) example (??). This loads the main interface shown in ??.
3. Orienting yourself in the main window
After loading the simulation, the main window will appear as shown in ??. The structure is displayed in the 3D view in the Device structure tab. In this view, you can see the key elements of the simulation. On the left, the block of green arrows represents the FDTD source, where the excitation is applied. A purple line runs through the structure, representing the FDTD grid. In this case it is a 1D simulation, so the grid is a single line passing through the cavity.
You can also see a purple grid, which represents the input detector plane. Light from the source passes through this detector before reaching the cavity. The cavity itself is the central region bounded by two partially reflecting interfaces, forming the resonant structure at the centre of the simulation. On the right-hand side, there is a second detector plane shown in green. This is the output detector, which captures the light that has passed through the cavity.
It should be noted that the detectors do not interfere with the light itself; they simply measure the electromagnetic fields.
In a moment, we will run the simulation and observe how light travels through the structure and interacts with the cavity. You will see how the wave is partially reflected, how part of it enters the cavity and builds up between the mirrors, and how this behaviour is recorded by the two detectors on either side of the structure.
4. Running the simulation
Once you have saved the simulation and had a look around the structure, click the Run (▶) button to start the calculation. As the simulation runs, you can monitor its progress in the Terminal tab, shown in ??. This displays information such as the timestep, wavelength range, and backend being used. When the simulation has finished, switch to the Output tab, shown in ??. Here you will find the data generated during the run.
The key outputs for this tutorial are detector_0 and detector_1, which contain the signals recorded by the two detectors.
You can also open device to view the 3D geometry, and the snapshots/ directory to see how the electromagnetic fields evolve over time.
You should notice that this simulation runs very quickly. Because it is a 1D problem, typical run times are only a few seconds.
If the simulation is taking significantly longer than this, refer to the note above about saving the simulation on a fast local drive.
5. Viewing power density snapshots
Open the snapshots/ output directory (from the Output tab) and double-click to launch the snapshot viewer.
This allows you to view the simulation results as a function of time.
Click the + button once to add a dataset, then select Ey. In this simulation the field is excited in the
y-direction, so this component gives the most informative view of the wave propagation.
You can then use the slider bar to step through time and observe how the field evolves. Three representative snapshots are shown in
??–
??.
You will see a broadband pulse propagate through the input region, reach the first mirror, and partially enter the cavity. Once inside, the field reflects back and forth between the two mirrors and begins to form a standing-wave-like pattern. This provides a direct, time-domain view of how resonance and field buildup emerge from the wave dynamics.
You can also plot the power density if you prefer, which is proportional to the product of the electric and magnetic fields. More precisely, this corresponds to the Poynting vector, \(\mathbf{S} = \mathbf{E} \times \mathbf{H}\), which represents the flow of electromagnetic energy.
6. Viewing detector outputs
Returning to the Output tab (see
??),
you will see two detector folders, Detector0 and Detector1, which appear like small camera icons.
Detector0 is located on the source side of the cavity, while Detector1 is on the far side after the light has passed through the structure.
If you double-click on Detector0, you will see the contents shown in
??.
In this directory there are two files, lam_E.csv and power.csv.
For now, open power.csv, which shows the power passing through the detector as a function of time.
The result is shown in
??.
This is a plot of the power recorded at the input-side detector. You can see that a packet of light first reaches the detector
and is then followed by a more complicated response associated with reflections from the cavity.
You can now repeat the same process for Detector1. Opening power.csv in that folder gives the result shown in
??.
In this case, the transmitted signal appears after the light has crossed the cavity and is shaped by the resonant response of the structure.
You should also notice that the shape of the power signal changes as the wave interacts with the cavity. This reflects how a Fabry–Pérot resonator stores and re-emits electromagnetic energy over several round trips.
lam_E.csv and power.csv.
We can now move from the time-domain signals to the frequency-domain response. The signals shown previously can be
Fourier transformed to give the spectral content of the light passing through each detector. The frequency-domain data can be found in the file lam_E.csv inside both Detector0 and Detector1.
Input spectrum: The input-side spectrum is shown in ??. In this simulation, the source is a Gaussian pulse with a carrier wavelength of 500 nm, so the spectrum is centred around this value. This shows the frequency-domain representation of the signal recorded at Detector0. You can see a strong peak near 500 nm, corresponding to the main excitation. The surrounding structure in the spectrum, which may appear somewhat irregular or “messy”, arises from several effects. First, the pulse has a finite duration, which means it contains a range of wavelengths rather than a single frequency. Second, the reflected wave from the cavity interferes with the incoming wave at the input-side detector, producing additional structure in the spectrum. Finally, small oscillations can also arise from the finite simulation length and the discrete nature of the Fourier transform. In this case, the linear scale is the most useful, as it clearly shows the dominant excitation peak.
Output spectrum: The corresponding output-side spectrum is shown in
??.
This shows the spectral content of the light after it has passed through the Fabry–Pérot cavity. Compared to the input spectrum,
the most obvious feature is the appearance of narrow resonant peaks and dips.
This is the key effect of the cavity: it enhances transmission only at wavelengths that satisfy the resonant phase condition.
Away from resonance, the transmission is lower. It is often useful to switch the vertical axis to a logarithmic scale
(by pressing the l key while the graph is selected), as this makes it easier to see weaker features in the transmitted signal.
On a linear scale, the dominant resonances are clear, but the log scale reveals additional structure across the spectrum.
Input/output ratio: The key result is that although the system is excited over a range of wavelengths,
the output shows strong transmission only at wavelengths that satisfy the cavity resonance condition.
This means the Fabry–Pérot cavity is acting as a wavelength-selective resonator. To quantify this, we take the ratio of the output and input signals.
Since power is proportional to \(|E|^2\), this gives the transmission of the structure:
\(T(\lambda) = \frac{|E_{\mathrm{output}}(\lambda)|^2}{|E_{\mathrm{input}}(\lambda)|^2}\).
The result is shown in
?? and
??,
where the resonant transmission peaks are clearly visible. A logarithmic scale is often more useful here, as it shows the depth of the off-resonant suppression and weaker cavity features more clearly (press l with the graph selected to toggle between linear and log scale).
The spikes/oscillations in the \(T(\lambda)\) spectrum can be quite pronounced in places. These arise from the finite duration of the pulse, interference within the cavity, and the fact that the frequency-domain signal is constructed from a finite time window. They are a normal feature of this type of simulation. For a cleaner transmission spectrum, a separate reference simulation without the cavity can be used for normalisation, but this is not required to see the main effect here.
7. Experimenting with the cavity dimensions
To explore how the Fabry–Pérot behaviour depends on its structure, right-click on the cavity or one of the cavity-defining objects and select Edit object, as shown in ??. This opens the object editor, where the size and repetition of the structure can be controlled.
The Offset fields define the position of the object in \(x\), \(y\), and \(z\), while the geometric size fields define the physical cavity length. In this model, the distance between the mirrors sets the resonant condition. Increasing or decreasing this separation changes the wavelengths that satisfy the round-trip phase condition. In the example shown here, edit the cavity length parameter as shown in ??. After applying this change, the structure should look like ??, where the cavity spacing has been modified.
Now rerun the simulation and inspect the output spectrum. The result is shown in ??. You should see that the resonance positions shift because the optical path length of the cavity has changed. A shorter cavity gives a different set of resonant wavelengths than a longer one.
If you now increase the cavity length again, rerun the simulation, and examine the output spectrum, you will obtain a result similar to ??. In this case, the resonance positions move back and the cavity response becomes correspondingly different again.
8. Changing the mirror spacing or reflectivity
You can also control the strength and sharpness of the cavity resonances by changing the spacing between the mirrors or the mirror properties. Right-click on the relevant object and select Edit object as before. Ensure that the cavity remains centred, but now change the mirror separation or mirror thickness, as shown in ??.
After applying this change, rerun the simulation and inspect the output detector spectrum. The result is shown in ??.
You should see that the resonance spacing and sharpness have changed compared to the previous case. This is because the Fabry–Pérot response depends on both the cavity optical length and the mirror reflectivity: changing these parameters alters the wavelengths that resonate and the strength of the field buildup inside the cavity.
9. Extending to 2D
One of the strengths of the FDTD method is that it is straightforward to extend simulations to higher dimensions. So far, we have considered a 1D problem, where the fields vary only along the propagation direction. We will now extend this to 2D and observe how the fields behave when variation in a second spatial dimension is allowed.
To do this, go to the Optical ribbon, shown in ??, and click on the optical mesh editor.
This will open the mesh editor, where the spatial discretisation of the simulation is defined. The current setup only includes variation along the z direction. To extend the simulation to 2D, click on the x dimension tab, as shown in ??. This activates variation in the x-direction and expands the simulation domain from 1D to 2D.
After enabling the x dimension, rerun the simulation. You will notice that the runtime increases significantly (typically from a few seconds to several minutes). This is expected: increasing the dimensionality increases the number of grid points and therefore the computational cost. This is the trade-off in FDTD—greater physical realism comes at the cost of longer simulation times.
Once the simulation has completed, open the snapshots/ directory and view the results. Example field
distributions are shown in
??–
??.
Using the slider bar, you can step through time and observe how the fields propagate, interfere, and localise in two dimensions.
Compared to the 1D case, the fields now exhibit lateral spreading and more complex interference patterns. This highlights an important point: while 1D simulations capture the basic physics of Fabry–Pérot resonance, higher-dimensional simulations reveal additional effects such as diffraction, lateral leakage, and spatial mode structure. These become essential when modelling real devices.