## 2 In-Cavity Pulse Shaping
### Tailored Pulse Waveform Generation  
As an illustration of the general pulse-shaping principle described above, we consider here the generation of five different amplitude functions [34], which represent some examples of interesting optical waveforms for applications in optical signal processing and manipulation [35]. We use a bright parabolic pulse-shaping filter with \(r(t)=\sqrt{1-(t/\tau)^{2}}\theta(\tau-|t|)\), \(\tau=1\) ps; a dark parabolic pulse shaper, such that \(r(t)=(1-|t/\tau|)\theta(\tau-|t|)\) with \(\tau=1\) ps; a flat-top pulse shaper where \(r(t)=\theta(\tau-|t|)\) with \(\tau=0.75\) ps; a triangular pulse shaper where \(r(t)=\sqrt{1-|t/\tau|}\theta(\tau-|t|)\) with \(\tau=1\) ps; and a saw-tooth pulse shaper, where we define \(r(t)=\sqrt{1-t/\tau}\) in \(t\in[0,\tau]\), \(r(t)=0\), otherwise, with \(\tau=1.5\) ps. Here,  
Figure 2: Temporal intensity and chirp profiles (**left**) and spectral intensity profiles (**right**) of the output pulse from the laser (blue) for a (**a**) bright parabolic, (**b**) dark parabolic, (**c**) flat-top, (**d**) triangular and (**e**) saw-tooth impulse response of the spectral pulse shaper. Also shown are the target profiles (red dotted) and the profiles at the exit of the gain fibre (black). \(\theta(x)\) is the Heaviside function. The spectral filter can be realised in a variety of ways, such as a fibre Bragg grating or even a programmable liquid-crystal-on-silicon (LCoS) optical processor, which offers the additional advantage of being easily reconfigurable [29]. The pulse solutions obtained for the different amplitude profiles applied on the filter and net GVD of 0.008 \(\mathrm{ps}^{2}\) are shown in Figure 2. It is seen that the desired pulse shapes are obtained at the output of the laser. In the case of flat-top and saw-tooth waveform functions, because of the sharp edges of these pulse shapes, an additional Gaussian bandpass filter with a bandwidth at FWHM of 1.7 THz is included in the pulse shaper to make the top of the resulting pulse ripple-free and to smooth the formed pulse shape, respectively. The generated pulses are nearly transform-limited. However, as opposed to the chirp (instantaneous frequency shift) profile targeted by the filter, the chirp profile of the generated pulses may exhibit a small ripple. This indicates that generating pulses with a well-defined phase profile by use of the method described here is not as straightforward. The pulse evolution, illustrated in Figure 3a by plots of the FWHM pulse duration and spectral bandwidth as functions of position in the cavity, highlights the basis of the pulse-shaping mechanism being used. The evolution shown for the triangular pulse-shaping regime is representative of those observed for the other shaping regimes, too, in which the typical pulse parameters evolve in a closely-similar fashion along the cavity, though small quantitative differences may exist. It is seen that the nonlinear evolution in the gain fibre is monotonic with the growth of temporal and spectral widths, while the pulse acquires a positive (normal) chirp. The filter compensates for temporal and spectral broadening and cancels the temporal phase accumulation in the fibre. Although the SA is not significant in shaping the pulse, it improves the stability of the laser by attenuating low-amplitude wings that can grow over many cavity round trips. The peak nonlinear phase shift \(\phi^{\mathrm{NL}}=\int\!\mathrm{d}z\,\gamma P_{p}(z)\) (\(P_{p}\) is the pulse peak power), which the pulse accumulates in the gain fibre (also known as the \(B\)-integral), is approximately 12 rad in the example of Figure 3a. This is accommodated by a spectral breathing factor (defined as the ratio of the spectral width at FWHM at the input and the output of the filter) of approximately nine. This confirms that the intended pulse shaping in our laser design is achieved through enhanced spectral filtering of a nonlinearly-broadened pulse in the cavity [34].