## 3 Materials and Methods
### Methods for Checking the Integrity of the Watermarked Audio Recordings
#### 3.4.1 Identifying a Cut Region Larger Than One Second  
In this scenario it is considered that at least \(q\) seconds of unmodified recording exist before and after the cut. Larger values of \(q\) lead to greater confidence levels of the results. Both the extracted ENF variation and the auxiliary PRBS participate in this investigation. Firstly, the recording moment is found by determining the \(k_{\text{min}}\) index for which \(RSE_{L_{s}}(k_{\text{min}})\) is minimum. After this, \(N\) vectors are computed using:  
\[\mathbf{D}_{ENF,L_{s},N}=\Big{[}d_{k_{\text{min}}+N},d_{k_{\text{min}}+N+1} \cdots d_{k_{\text{min}}+N+l_{s}-1}\Big{]},\ N=\overline{-p,p},\ d_{i}=ENF_{i}- \widetilde{ENF}_{i-k_{\text{min}}-N+1}. \tag{9}\]  
where \(p\) is an integer parameter that defines the limits of a search window around the moment \(k_{\text{min}}\). From the \(N\) vectors it is selected the one in which the first at least \(q\) values are equal to zero, denoted with \(\mathbf{D}_{ENF,L_{s},N_{\text{start}}}\). Then, the actual consecutive trailing zeros from that vector are counted and the result represents the candidate for the starting moment of the cut, found using the ENF information and denoted with \(cut_{\text{start,ENF}}\). Next, the duration of the cut can be determined by finding in the \(N\) vectors the one has the last at least \(q\) values equal to zero, denoted with \(\mathbf{D}_{ENF,L_{s},N_{\text{end}}}\). The duration of the cut is found as the difference between \(N_{\text{end}}\) and \(N_{\text{start}}\). The same approach is followed using the extracted and reference PRBS, resulting the cut starting moment candidate denoted with \(cut_{\text{start,PRBS}}\). The identified cut moment is found as \(cut_{\text{start}}=\text{min}\big{\{}cut_{\text{start,ENF}},cut_{\text{start, PRBS}}\big{\}}\). To ease the understanding of this process, an example is shown in Figure 14.  
Figure 14: Signals involved in identifying a cut region larger than one second (**a**) The reference ENF signal. Three parts are highlighted: the part before the cut (yellow), the part that has been cut (green) and the part after the cut (magenta); (**b**) The ENF signal extracted from the mapered recording (the cut part is missing). (**c**) The \(\mathbf{D}_{ENF,L_{s},N_{\text{start}}}\) vector, \(N_{\text{start}}=-30\); (**d**) The \(\mathbf{D}_{ENF,L_{s},N_{\text{end}}}\) vector, \(N_{\text{end}}=0\). In the example shown in Figure 14, the detection of the placement and duration of a cut operation is demonstrated. It is considered that the original, unmodified recording has a duration of 20 minutes, for ease of understanding the process. The top panel in Figure 14, (a), shows the variation of the ENF recorded by a monitoring station as in [6] over an interval of 20 min, starting at the 1097506 th second of the year, meaning it is in the 12 th day of the year. This signal would have been extracted from an unmodified recording made at that time. Three parts were highlighted on this signal: the part before the cut, represented in yellow, the part that was removed from the signal (i.e., the cut part), shown in green, and the part after the cut, highlighted with magenta. The cut in this example was 30 s long, to make it visible on the plots. The (b) panel from Figure 14 shows the ENF variation extracted from the tampered recording. Formula (8) is applied to the reference ENF signal (the variation over one year) and the extracted signal, to find the moment of the recording, by finding \(k_{\text{min}}\). After this, \(2p+1\) vectors are computed using (9), denoted with \(\mathbf{D}_{ENF,L_{u},N}\), where \(N=\overline{-p,p}\), operation done to search the two vectors of great importance: \(\mathbf{D}_{ENF,L_{u},N_{\text{start}}}\) and \(\mathbf{D}_{ENF,L_{u},N_{\text{end}}}\), described above. The \(\mathbf{D}_{ENF,L_{u},N_{\text{start}}}\) vector was found for \(N=-30\), therefore \(N_{\text{start}}=-30\). The \(\mathbf{D}_{ENF,L_{u},N_{\text{end}}}\) vector was found for \(N=0\), thus \(N_{\text{end}}=0\).