## 3 Principle of the Watermarking Algorithm in Transform Domain  
### Principle of Watermark Embedding  
The multi-resolution analysis characteristic of DWT renders excellent robustness against most attacks, so DWT can be used in audio watermarking algorithm to decompose the audio signal into wavelet coefficients with different frequency bands used for carrying watermarks. The energy compression capability of DCT can concentrate the main energy of the audio signal on the low frequency coefficient of DCT. This study will take advantage of these two methods to develop a novel robust audio watermarking algorithm. Since the human auditory system is insensitive to minor changes in the high-frequency components of the audio signal, the watermark information can be hidden in these high-frequency components obtained by DWT and DCT on the carrier audio signal. Suppose that the carrier audio signal is \(A\), which has \(K\) sample points, and it can be expressed by the following formula:  
\[A\ =\ \left\{a(k),\,1\leq k\leq K\right\}, \tag{1}\]  
where \(a(k)\) is the \(k\)th sample value of this audio signal. \(A\) is divided into \(M\) audio fragments \(A_{l}\) (\(1\leq l\leq M\)) with \(N\) sample points, and then the \(r\)-level DWT is performed on \(A_{l}\) to obtain the wavelet coefficient \(D_{l}\) showed in Formula (2), including the approximation coefficient \(Ce(r)\) and the detail coefficients \(De(i)\) (\(i\ =\ 1,2,\cdots r\)):  
\[D_{l}\ =\ DWT(A_{l})\ =\ Ce(r)\oplus De(r)\oplus De(r-1)\cdots\oplus De(2) \oplus De(1), \tag{2}\]  
where \(Ce(r)\) is the \(r\)th level approximation coefficient decomposed by DWT, containing the lowest frequency component of the audio signal. The minor changes in \(Ce(r)\) will cause a significant drop in the audio quality, so usually watermarks cannot be embedded into this frequency-band. \(De(i)\) (\(i\ =\ 1,2,\cdots r\)) is the \(i\)th level detail coefficient. The smaller \(i\) is, the higher the frequency component contained in \(De(i)\) will be, and the smaller the impact of minor changes of \(De(i)\) on the audio quality will be. Therefore, the watermarks may be embedded into \(De(i)\). However, the high-frequency components are vulnerable to malicious attacks, so the detail components near the approximate components can be chosen to conceal watermark, which not only has little influence on the audio quality, but also can resist malicious attacks. In this study, the \(r\)th level detail coefficient \(De(r,n)\) (\(n\ =\ 1,2,\ldots,N/2^{r}\)) can be selected as the embedding frequency band. Divide \(De(r,n)\) into two packets respectively according to Formulas (3) and (4), including the former packet \(De_{1}(r,j)\) and the latter packet \(De_{2}(r,j)\) with the length of \(N/2^{r+1}\):  
\[D_{e1}(r,j)\ =\ D_{e}(r,j)\ j\ =\ 1,2,\ldots,N/2^{r+1}, \tag{3}\]  
\[D_{e2}(r,j)\ =\ D_{e}(r,\frac{N}{2^{r+1}}+j)\ j\ =\ 1,2,\ldots,N/2^{r+1}. \tag{4}\]  
Perform DCT on \(De_{1}(r,j)\) and \(De_{2}(r,j)\) to obtain two transform-domain coefficients \(C_{1}(r,j)\) and \(C_{2}(r,j)\) with the length of \(N/2^{r+1}\), and then connect \(C_{1}(r,j)\) and \(C_{2}(r,j)\) to form an array \(C(r,n)\) with the length of \(N/2^{r}\). Calculate the average amplitudes of \(|C(r,n)|\), \(|C_{1}(r,j)|\) and \(C_{2}(r,j)\) according to Formulas (5)-(7). The average amplitude of \(|C(r,n)|\) is  
\[M_{c}\ =\ \frac{2^{r}}{N}\sum_{n\ =\ 1}^{N/2^{r}}|C(r,n)|,\ n\ =\ 1,2,\ldots,N/2^{r}. \tag{5}\]  
The average amplitude of the former packet \(C_{1}(r,j)\) is  
\[M_{c1}\ =\ \frac{2^{r+1}\,N}{N}\sum_{j\ =\ 1}^{N/2^{r+1}}|C_{1}(r,j)|,\ j\ =\ 1,2,\ldots,N/2^{r+1}. \tag{6}\]  
The average amplitude of the latter packet \(C_{2}(r,j)\) is  
\[M_{c2}\ =\ \frac{2^{r+1}\,N}{N}\sum_{j\ =\ 1}^{N/2^{r+1}}|C_{2}(r,j)|,\ j\ =\ 1,2,\ldots,N/2^{r+1}. \tag{7}\]  
Suppose that the binary image watermark to be embedded is \(W\ =\ \left\{w(q),\,1\leq q\leq L\right\},\) where \(w(q)\in\left\{0,\,1\right\},L\) is the length of the watermarks, \(L\leq M\). The average amplitudes of the two packets are modified to embed the watermark.