## 2 Materials and Methods
### Characteristics of the Measured CER Spectra  
The CER spectra were measured with the observation system by changing the RF phase between the RF gun and accelerator tube. The movable mirror of the interferometer was scanned at a step interval of 10 \(\upmu\)m in a length of \(\pm\)0.3 mm around the zero optical path length. The signal was measured four times for one position and the average values were used as the power of the interferometer. The relative standard deviation of the averaged signals was only 0.64%. Figure 3a shows the measured CER spectra for some RF phase differences. As the spectral measurements were performed in air, dips appeared owing to the absorption of water vapor at the frequencies of 0.56, 0.75, 0.99, 1.1-1.3, 1.4, and 1.6-1.7 THz in the CER spectra [17]. The CER spectra rapidly decreased below 0.2 THz. This decrease was caused by a diffraction loss of the optical system for the CER beam [18]. In this experiment, the cutoff frequency \(f_{\mathrm{c}}\) of the diffraction loss was as high as 0.2 THz owing to the misalignment of the detector [12]. As shown in Figure 3a, the intensity of the  
Figure 2: Relationship between the RF phase difference and the measured FEL macropulse. CER beam was maximized at the RF phase difference near the crest, and the maximum of the CER spectrum on the crest appeared at a frequency of 0.6 THz. The high frequency component of the CER spectrum decreased as the RF phase difference \(\Delta\) increased in the region of \(\Delta>0\), and the CER spectrum at \(\Delta=15^{\circ}\) closed to the previously reported CER spectrum when the electrons in the bunch were Gaussian distribution [12]. Therefore, assuming that the electron bunch shape was the Gaussian distribution, we evaluated the bunch length based on the measured spectrum at \(\Delta=+15^{\circ}\). The CER spectrum irradiated on the flat mirror, \(U_{CER}(\omega)\), and the observed CER spectrum, \(O(\omega)\), had the following relationship:  
\[O(\omega)=\bigg{[}1-\mathrm{e}^{-(\frac{\omega}{2\pi f})^{2}}\bigg{]}S(\omega )T(\omega)U_{CER}(\omega) \tag{1}\]  
where \(S(\omega)\) and \(T(\omega)\) are the sensitivity of the detector and transmittance of the optical transport system, respectively [12]. The pyroelectric energy meter used in the experiment had a flat sensitivity in the frequency range of 0.3-3 THz where the CER beam was not affected by the diffraction loss. Therefore, the effect of \(S(\omega)\) on the observed CER spectrum is negligible. In addition to absorption by water vapor, it is necessary to consider the z-cut crystal quartz window and the black polyethylene film for the transmittance of the optical transport system. The crystal quartz has a substantially constant transmittance of 0.78 in the frequency range of 3 THz or less [19]. The transmittance of the black polyethylene gradually decreases with increasing frequency to 0.6 at 3 THz [20,21]; thus, it contributes to the frequency dependence of the spectrum \(O(\omega)\). Using the number of electrons in a bunch (\(N\)), \(U_{CER}(\omega)\) can be expressed using the following equation [22]:  
\[U_{CER}(\omega)=N(N-1)f(\omega)U_{ER}(\omega)\approx N^{2}f(\omega)U_{ER}(\omega) \tag{2}\]  
Figure 3: (**a**) Relationship between the RF phase difference and measured CER spectrum. (**b**) Fitting curve (red dotted curve) applying the least squares approximation to the measured CER spectrum (black solid curve) for \(\Delta=+15^{\circ}\). where \(U_{ER}(\omega)\) is the spectrum of edge radiation irradiated on the flat mirror and can be calculated using the theory of edge radiation considering the shape of the flat mirror [10]. The form factor \(f(\omega)\) is calculated using the Fourier transform of the normalized longitudinal electron distribution \(S(z)\) within the bunch [23],  
\[f(\omega)=\left|\int_{-\infty}^{\infty}\exp\Bigl{(}i\frac{\omega}{c}z\Bigr{)}S( z)dz\right|^{2} \tag{3}\]  
where \(c\) is speed of light.