This topic explains how to create a custom source spectrum. First, we must design a time signal with the desired spectrum. Next, we set the source to use this custom time signal with the setsourcesignal function. Finally, we confirm the spectrum with a time monitor.
Note: Custom source time signals and spectrums
Customizing the source time signal or spectrum is an advanced feature. In the vast majority of simulations, it is best to simply specify the frequency/wavelength range of interest and let the software calculate the best source time signal. It is usually far easier and more efficient to model a particular source time signal or spectrum (ie. the solar spectrum) during data post processing. For more information, see Using the impulse response to calculate the systems response to an arbitrary input or the Solar source spectrum page. Non-linear simulations are the one application area where custom time signals may be necessary.
Before implementing a custom source time signal or spectrum, we strongly recommend visiting the Support Center to discuss your needs.
Use usr_custom_spectrum.lsf to create a source with a specified power spectrum.
Specify the desired spectral shape in the first section of the script file. In this example, we specify a sloped-wall top-hat function.
The time signal length must be specified in the Setup section of the script file. In this example, the source length is 30 fs. This figure shows the time signal we have calculated.
The figure on the left shows the specified spectrum, and the actual spectrum that we expect, based on the above time signal. Notice they are not identical. The calculated spectrum will converge to the specified spectrum as the time signal length is increased.
Test source in FDTD simulation
The final section of the script file loads the time signal into the source and runs a simple simulation. We can calculate the actual spectrum of the source in the FDTD simulation with the sourcepower function. It would also be possible to confirm the spectrum with a time monitor, if there are no structures in the simulation. Structures in the simulation will create reflections that will interfere with the source pulse. This interference would alter the spectrum that the time monitor measures.
This figure shows the actual time signal used by the source in the FDTD simulation. Notice the phase offset as compared to the calculated time signal. By adjusting the source phase setting, the phase of the fdtd time signal could be matched to the calculated signal.
This figure shows the actual source spectrum obtained with the sourcepower function. Once again, the spectrum is similar to the Specified and Expected spectrums, but slightly different. The difference between the FDTD and the calculated spectrum occurs because the fdtd simulation uses a larger dt than the calculated spectrum.