## 2 Principle and Simulation
Comparing Equation (12) with Equation (5), the relationship between frequency and phase satisfies the requirement for triangular waveform generation, and the desired full-duty triangular pulse train is successfully obtained. Again, we adjust the modulation depth of two DDMZMs to satisfy the following Bessel function: \(r_{1/3}=J_{1}(2\beta)/J_{3}(2\beta)=3\). As shown in Figure 2, the modulation index is set as \(2\beta=2.30\). The optical signal at the output of PD is as follows:  
\[ \begin{array}{ll}I(t)&=I_{1}(t)+I_{2}(t)\\ &=\frac{\Re}{2}|E_{in}|^{2}J_{1}(2\beta)&\Big{\{}I_{DC}+\sin(\Omega t+\frac{ \pi}{2})+\frac{1}{3}\sin(3\Omega t+\frac{3\pi}{2})\\ &&+\sin(\Omega t+\frac{\pi}{2}+\delta)+\frac{1}{3}\sin(3\Omega t+\frac{3\pi}{2 }+3\delta)\ \big{\}}\end{array}  \tag{13}\]  
Then, simply let \(\delta=0\), and Equation (13) can be simplified as follows:  
\[ \begin{array}{ll}I(t)=\Re|E_{in}|^{2}J_{1}(2\beta)\{I_{DC}+\sin\Big{(}\Omega t +\frac{\pi}{2}\Big{)}+\frac{1}{3}\sin\!\left(3\Omega t+\frac{3}{2}\pi\right)\} \end{array}  \tag{14}\]  
Figure 2: Bessel function and modulation index. Comparing Equation (14) with Equation (5), the relationship between frequency and phase satisfies the requirement for square waveform generation, and the desired full-duty square pulse train is successfully obtained. According to the theoretical analysis, a simulation system is built to verify the method. The parameter settings are shown in Table 1.  
According to the discussion above, we set the modulation depth of DDMZM1 at 1.73, and the modulation depth of DDMZM2 at 2.30; meanwhile, the RF phase difference between the two DDMZMs is set at 45\({}^{\circ}\). The output optical spectrum in DDMZM1 is shown in Figure 3a, which constitutes the odd order component of the sawtooth wave. In addition, Figure 3b shows the optical spectrum at the output of DDMZM2, which constitutes the even order component of the sawtooth wave. Figure 3c shows the output waveform spectrum after PD. In this spectrum, the even harmonic power is 6.0 dB lower than the fundamental frequency power, and the third harmonic power is 9.5 dB lower than the fundamental frequency power, which is consistent with the spectrum characteristics of a theoretical sawtooth waveform. Figure 3d is the output signal waveform in the time domain, which is consistent with the waveform of the sawtooth signal with a full duty cycle and a repetition frequency of 8 GHz (0.125 ns). The simulation results on triangular and square waveforms can be seen in Figure 4a shows the output of the triangular waveform spectrum after PD. As we can see, the third harmonic power is 19.1 dB lower than the fundamental frequency power, which is consistent with the spectrum characteristics of the theoretical triangular waveform. Figure 4b is the output signal waveform in the time domain, which is consistent with the waveform of the triangular signal with a full duty cycle and a repetition frequency of 8 GHz (0.125 ns). Similarly, Figure 4c shows the generated square waveform. The third harmonic power is 9.5 dB lower than the fundamental frequency power, which is consistent with the theoretical calculation. Figure 4d is the output signal waveform in the time domain.