# Audio steganography using phase encoding technique

I referred the below papers to understand the working of Phase Encoding,but the explanation is not proper.Just a few steps have been given in brief.

ijcsi.org

www.ijarcce.com

Can someone please explain the concept of how Audio Steganography using Phase Encoding works?

• – endolith May 29 '14 at 16:26

Here is the algorithm:

1. Divide an input signal $S$ into $n$ consecutive blocks $S_i$ ($i\in\{1,\ldots,n\}$) of length $l$ each

2. Compute magnitude $A_i$ and phase $\phi_i$ of each block using FFT where A(i)=abs(fft(S{i})) and Phi(i)=angle(fft(S{i})) in MATLAB.

For example, here are the first 3 elements of $\phi$: (Recall that FFT of real signal has odd symmetry which is clearly visible on plots)

3. Compute phase differences $\Delta\phi_i=\phi_i-\phi_{i-1}$ for $i\in\{2,\ldots,n\}$

4. To encode your binary data $d$ of length $m:m<l$ assign $$\phi_{data}[i]= \begin{cases} \pi/2,& d_i=0\\ -\pi/2,& d_i=1 \end{cases}$$ for $i\in\{1,\ldots,m\}$.

5. Replace following elements of first phase sequence, ${\phi_1}$, with ${\phi _{data}}[i]$ for $i\in\{1,\ldots,m\}$ as: $${\phi '_1}[ {L/2 - m + i}] = {\phi _{data}}[i]\,$$ To maintain odd symmetry property of DFT, repeat same progress as: $${\phi '_1}[{L/2 + 1 + i}] = - {\phi _{data}}[{m + 1 - i}]$$

6. To maintain phase differences sequentially reassign $\phi '_i=\phi_{i-1}+\Delta\phi_i$ for $i\in\{2,\ldots,n\}$
Here are the first 3 elements of $\phi '$ after this step: (Note how encoded $d$ has affected next blocks)

7. Reconstruct the signal using inverse FFT applied to each block $A_i exp(j \phi '_i)$ (where $j$ is imaginary unit) and joining all blocks together.

Explanations to many details like the length of blocks and why particular steps are taken are given in the documents you and endolith linked to.

A minimal IPython Notebook version: github.com/danylo-dubinin/secret_in_wav.

• What an awesome answer! – kdrtkl Feb 26 '17 at 18:48
• Would love to see a toy implementation of this! – Petrus Theron May 24 '18 at 9:34
• @PetrusTheron, cool! Thanks for being interested :) I have a minimal IPython Notebook version here github.com/danylo-dubinin/secret_in_wav. It's without the graphs which i showed in this answer because they are from Mathematica version of this program which I didn't publish back then. I can publish it later too though if you want :) Should be still somewhere on the old laptop. – Dan Oak May 25 '18 at 13:38
• Hi @danoak, thanks! I'm a Clojure guy, so Mathematica version would be much appreciated :) – Petrus Theron May 25 '18 at 18:45