This topic explains how to create a custom time signal for a source. In this example, we create a signal with two gaussian shaped pulses. It's worth noting that creating a custom time signal is rarely required. If you are looking to simply modify the source bandwidth (ie. to create a longer, more narrow band pulse), see Changing the source bandwidth. For linear time-invariant systems, it is possible to use the impulse analysis to determine the response to an arbitrary time signal.
To create a custom source time signal, the setsourcesignal function requires a complex valued function. However, we typically only have a real valued signal. The script usr_custom_time_signal.lsf show how to convert a real valued function into a complex valued function using an fft.
The first part of the script shows how to define a real valued time signal. In this example, we simply use a sine wave with a dual-gaussian envelope. Next, the script shows how to convert a real valued signal into a complex valued signal. After that, the custom time signal is loaded into the source. Finally, we run a simulation and compare the specified pulse with the actual simulation results.
To reproduce the following figure, open the simulation file, then run the script.
This figure shows the Specified signal, the actual Source signal used in the simulation, and the resulting field profile as measured by a time monitor.
This is a zoomed in version of the same figure. We can see that the Specified signal and Source signal are very similar. The Signal from the time monitor is delayed by about 1/4 wavelength, as expected due to the spatial offset between the source and monitor.
Note: Custom source time signals and spectra
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.
Note: Auto shutoff and time signal length
By default, the auto shutoff function does not kick in until the specified time signal length is done. So one would see auto shutoff value stays at 1 even though the amount of remaining field is actually small in the simulation. For example, for the above custom time signal, the auto shutoff does not start to function until 600 fs (the time length specified in the script file), although the pulse is physically done at around 400 fs. In order to have the auto shutoff working ASAP, user should specify a minimum time length possible, say, 450 fs for this source.