# Adaptive and Blind Audio Watermarking Algorithm Based on Chaotic Encryption in Hybrid Domain
## 2 Watermarking Algorithm in Hybrid Domain
### The Design of the Adaptive Embedding Depth  
The signal-to-noise ratio (SNR) can be used as a performance index to evaluate the quality of the watermarked audio for evaluating the performance of the watermarking algorithm, and it can be expressed as:  
\[\text{SNR}(A,A^{\prime})=1\text{log}\left\{\frac{\sum\limits_{k=1}^{K}A^{2}}{ \sum\limits_{k=1}^{K}\left(A^{\prime}-A\right)^{2}}\right\} \tag{25}\]where \(A\) and \(A\prime\) denote the original and watermarked audio signals, respectively. Bit error rate (BER) can be used to evaluate the robustness of the proposed algorithm when resisting various attacks, and it can be expressed as:  
\[\text{BER}(w,w^{\prime})=\frac{\sum\limits_{q=1}^{L}w(q)\oplus w(q)^{\prime}}{L} \times 100\% \tag{26}\]  
where \(\oplus\) stands for the exclusive-OR operator, and \(w(q)\) and \(w(q)^{\prime}\) are the original watermark and the extracted watermark respectively, and \(L\) is the watermark length. The similarity between the original picture and the extracted picture can be tested by the normalized correlation (NC) coefficient shown as Formula (27). \[NC(w,w^{\prime})=\frac{\sum\limits_{q=1}^{L}w(q)\times w^{\prime}(q)}{\sqrt{ \sum\limits_{q=1}^{L}w(q)^{2}\sum\limits_{q=1}^{L}w^{\prime}(q)^{2}}} \tag{27}\]  
According to the watermark embedding principle in Section 2.2, this algorithm conceals the watermark by modifying \(C_{1}(r,j)\) and \(C_{2}(r,j)\) in which a small variation means that the algorithm makes minor modifications to the audio signal, which indicates that the imperceptibility of this algorithm is good. When \(w(q)=1\), since the values of \(M_{l}\), \(M_{c1}\) and \(M_{c2}\) are almost equal in the same audio segment, the variations of \(C_{1}(r,j)\) and \(C_{2}(r,j)\) can be expressed as:  
\[\Delta C_{1}(r,j)=C_{1}^{\prime}(r,j)-C_{1}(r,j),=C_{1}(r,j)[\frac{(1+\lambda) M_{l}}{M_{c1}}-1]\approx\lambda C_{1}(r,j) \tag{28}\]  
\[\Delta C_{2}(r,j)=C_{2}^{\prime}(r,j)-C_{2}(r,j)=C_{2}(r,j)[\frac{(1-\lambda) M_{l}}{M_{c2}}-1]\approx-\lambda C_{2}(r,j) \tag{29}\]  
It can be seen that those two variations are determined by the embedding depth and their own amplitudes. The smaller \(\lambda\) is, the smaller \(\Delta C_{1}(r,j)\) and \(\Delta C_{2}(r,j)\) are, and the better the imperceptibility is. When \(w(q)=-1\), the analysis process and results are similar to those mentioned above. The extraction principle in Section 2.3 shows that the extraction process is achieved by comparing the average amplitudes of \(C_{1}^{\prime}(r,j)\) and \(C_{2}^{\prime}(r,j)\). The larger the average amplitude difference between \(C_{1}^{\prime}(r,j)\) and \(C_{2}^{\prime}(r,j)\) is, and the better the robustness of the algorithm. When \(w(q)=1\), the average amplitude difference between \(C_{1}^{\prime}(r,j)\) and \(C_{2}^{\prime}(r,j)\) is:  
\[\Delta M^{\prime}=\left|M_{1}^{\prime}-M_{2}^{\prime}\right|=|(1+\lambda)M_{ l}-(1-\lambda)M_{l}|=2\lambda M_{l} \tag{30}\]  
It can be seen that \(\Delta M^{\prime}\) is determined by two factors: the embedding depth \(\lambda\) and the overall average amplitude \(M_{l}\). The bigger \(\lambda\) is, then the larger \(\Delta M^{\prime}\), and the better the robustness. When \(w(q)=-1\), the analysis process and results are similar to those mentioned above. In conclusion, \(\lambda\) has an important influence on SNR and BER of this algorithm. In practical applications, when \(M_{l}\) is larger, a smaller \(\lambda\) can be chosen to obtain better imperceptibility, On the other hand, a larger \(\lambda\) can be chosen to obtain stronger robustness when \(M_{l}\) is smaller, which can balance SNR and BER of this algorithm. The influence of \(\lambda\) on SNR and BER can be tested by the following experiments. Divide the original audio into \(M\) audio segments with 256 sample points, and perform 4-level DWT on each audio segment. Calculate \(M_{l}\) of each audio segment according to the embedding principle in Section 2.2.