## 3 Materials and Methods
### Methods for Checking the Integrity of the Watermarked Audio Recordings  
The methods for investigating the recording are based on the principles of the ENF criterion. Data extracted from the recording is compared with the reference, provided by a monitoring station as in [6]. The comparison is usually made using the cross-correlation function [7], computed using:  
\[XC_{L_{\mathrm{s}}}(k)=\left[\left(\widetilde{\mathbf{ENF}}-50\right)\hat{ \ast}\left(\mathbf{ENF}-50\right)\right](k)=\sum_{i=0}^{L_{\mathrm{s}}-1} \left(\widetilde{ENF}_{i}-50\right)\cdot\left(ENF_{i+k}-50\right), \tag{7}\]  
where \(\{\hat{\ast}\}\) is the correlation operator, \(\widetilde{\mathbf{ENF}}\) is the vector containing the estimated ENF values, \(L_{\mathrm{s}}\) is its length, \(\mathbf{ENF}\) is the vector containing the reference ENF values, \(\widetilde{ENF}_{i}\) and \(ENF_{i}\) represent the \(i^{\mathrm{th}}\) samples of the respective vectors. Therefore, \(\mathbf{XC}_{L_{\mathrm{s}}}\) is the vector that contains the samples of the cross-correlation function. The nominal value of the ENF (i.e., in this case 50 Hz) would dominate this result. To avoid this, it is subtracted from both sequences. The temporal index where the cross-correlation has the peak value is expected to indicate the moment when the recording was captured. In this case, the temporal resolution of the ENF data is one second, leading to poor localization results using cross-correlation, as can be observed in Figure 13. Three localization results are shown, for durations of the recorded signal equal to \(t_{\mathrm{ref}}=1200\) s (20 min), \(10\cdot t_{\mathrm{ref}}\), and \(100\cdot t_{\mathrm{ref}}\). It is clear that the latter two values are  
Figure 12: The flowchart for extracting the pseudorandom binary sequence carrying the auxiliary room identification information. unlikely to be found in real-world situations. They are used here only to demonstrate that in the case of the proposed system, the cross-correlation can locate the moment of the recording only when its length is in the range of hundreds of minutes. In this demonstration, the recorded signal had a cut equal to 2 s in it (i.e., two consecutive values of ENF were lost), and perfect ENF recovery was considered for the other values. Thus, using the cross-correlation to find the moment of the recording is disadvantageous because of the temporal resolution of the ENF (i.e., 1 s). However, the great advantage of the proposed system is that it uses ENF values that are discrete, with the representation resolution equal to \(10^{-3}\) Hz. If their transmission and extraction are done without errors, the extracted values and the corresponding reference values will be equal. Because of this, much better results are obtained if the recording moment is searched using the root-square-error (RSE), computed as:  
\[RSE_{L_{s}}(k)=\sqrt{\sum_{i=0}^{L_{s}-1}\bigl{(}\widetilde{ENF_{i}}-ENF_{i+k} \bigr{)}^{2}}. \tag{8}\]  
The resulted values are stored in a vector denoted with \(\mathbf{RSE}_{L_{s}}\). The start of the recording is given by the temporal index where the RSE is minimum. It can be observed in Figure 13 that it precisely locates the recording's starting moment, even when its duration is in the range of tens of minutes. In the same situation, the cross-correlation fails to locate the recording moment. The minimum value of the RSE is not equal to zero in this example case because of the aforementioned two-seconds cut in the recorded signal, determining the missing of two ENF values. The reference ENF sequence for this demonstration contained the variation over one year. Figure 13: The performance in localizing the moment of recording based on the cross-correlation function with various durations of the recording (\(t_{\text{ref}}=1200\) s = 20 min, \(10\cdot t_{\text{ref}}\), and \(100\cdot t_{\text{ref}}\)) and the localization performance obtained using the RSE. In all four cases, a two-seconds cut operation was considered in the recording.