DSP Project Report
DSP Project Report
SUBMITTED TO:
SUBMITTED BY:
Potluri Satya Sri Varsha -21ECB0B44
1. INTRODUCTION
Audio steganography involves concealing a secret message within an audio file, known as
the carrier audio, by manipulating the audio signal. This technique takes advantage of the
limitations of the human auditory system, exploiting the challenge in distinguishing
between low and loud sounds, where a louder sound can potentially overshadow a softer
one.
Windows Audio-Visual (WAV) is one of the most widely used audio file formats that can
be used to conceal information. The storage environment and the digital representation
of the intended signal are the two primary areas of change in a WAV file for data
embedding.
The encoding techniques that are commonly employed to conceal data in this format
include phase coding, spread spectrum, low-bit-encoding, and echo data hiding.
In this project we used the phase coding technique for embedding data in an audio signal.
2. METHODOLOGY
The phase coding method operates by replacing the phase of an initial audio segment
with a reference phase that corresponds to the data. The phase of subsequent segments
is adjusted to maintain the relative phase between segments. In terms of the signal-to-
perceived noise ratio, phase coding is among the most effective coding techniques.
2.1 EMBEDDING
The embedding process is done by inserting the data bits into the first segment of the
audio as a cover. The steps for embedding are as follows:
1. The audio signal is broken down into segments with a signal length that is
sufficient to encode the secret message.
2. The Fast Fourier Transform (FFT) is applied to each segment to create a matrix of the
phases and magnitudes.
5. The secret message is inserted in the phase vector of the first signal segment as follows:
6. A new phase matrix is created using the new phase of the first segment and the original
phase differences.
7. Audio signal is generated using new phase matrix and original magnitude matrix by
applying IFFT.
The process of extraction is used to get the data that is previously incorporated into the
audio. The steps for extraction are as follows:
3. Phase values are observed and data bits are extracted as follows:
1 if phase > 1
4. The obtained binary data is converted into characters using ascii to binary
conversion.
The direct computation of the N-point DFT involves pairwise multiplications and additions
for each element in the sequence with the total number of operations (complex
multiplications and additions) is proportional to N^2. The FFT algorithm, on the other
hand, significantly reduces the number of operations compared to the direct DFT
computation. For a Cooley-Tukey Radix-2 FFT, the number of operations is approximately
proportional to N log N. This represents a substantial reduction in computational
complexity, especially for large N.
Radix-2 FFT is a variant of the Fast Fourier Transform (FFT) designed for sequences with
sizes that are powers of 2. It employs a divide-and-conquer strategy, recursively breaking
down the Discrete Fourier Transform (DFT) into smaller subproblems. The algorithm's
efficiency is particularly notable for power-of-two input sizes, utilizing butterfly
operations to combine DFT values.
First 8 samples of audio signal are obtained and radix 2 FFT algorithm is used to compute
discrete fourier transform.
3. IMPLEMENTATION
In a given segment, each bit is encoded into one phase value by changing the phase value.
This is done as follows:
Now we calculated fast fourier transform of each segment obtained. The output of FFT
function is an array of real and imaginary values. Using these, phase and magnitude are
calculated and stored in Phin[N][L] and s[N][L].
The phase values are calculated in radians and range from -180 to +180 degrees. Next
step is to calculate phase difference of adjacent segments as the phase shift between
consecutive segments is easily detected. We only change the values of phase but not the
relative difference between them and store them in Deltaphi [N][L]. We converted our
text into binary sequence of length 8*textlength. An array of size PhiData[m] stores PI/2
if corresponding ith bit is 0 else it stores -PI/2 in radians.
Hermitian symmetry, also known as conjugate symmetry, refers to a property where the
values of a function or signal have a specific relationship with their complex conjugates.
It is being used to ensure that the modified phase data maintains a symmetric pattern
when applied to the Fourier-transformed segments of the audio signal.The purpose of
maintaining Hermitian symmetry in this context is likely related to the fact that the input
signal is real-valued. For real-valued signals, the magnitude spectrum is symmetric, and
the phase spectrum exhibits Hermitian symmetry. When modifying the phase
information, it's important to ensure that the resulting signal remains a valid, real-valued
signal after the inverse Fourier transform.. So add Phidata to the first segment of Phin
from L/2-m to L/2-1 and from L/2+1 to L/2+1+m. Next were created phase matrices by
adding the phase differences matrix and Phin matrix.
We now have our new phase matrix. Next we re-created our audio signal by doing IDFT
using new phase matrix and original amplitude matrix. We only took NxL values for
encoding and now we combined these values to the rest of the signal and stored in
output. This gives us our steganographed audio signal.
Now we convert .txt file which contain values of steganographed signal back into ,wav
audio file using the following Matlab code.
In the above sample, the bit sequence 01001000 was encoded in the segment and the
phase values of the spectrum were modified accordingly.
To decode the spectrum and extract the bit sequence, we first perform the fourier
transform of the steganographed audio signal.
1, if phase < 0)
I.e., if the phase for a particular frequency is negative, the bit corresponding to that
position is 1, else 0.
The follow code segment achieves the above calculations and extracts the message signal
from the coded phase spectrum
4. RESULTS
The samples were then stored on Arduino uno (ATMega328P controller) to perform
offline phase coding on the spectrum of the audio samples.
These audio samples were then converted back into mono.wave format through matlab.
Another code then processes the encoded audio samples on the arduino and extracts
back the message signal through the decoding algorithm of phase-coding steganography.
Phase spectrum before and after Phase Encoding: (In MATLAB)
The following are respectively the waveforms of steganographed and original audio
signals in the time domain.
There is an insignificant distortion in the waveforms of the original and encoded signals.
Phase coding is a steganography algorithm which encodes the message into the frequency
domain. Compared to other techniques, it offers more encoding capacity, reduced
susceptibility to steganalysis and improved perpetual transparency as the human ear is
not less sensitive to phase shifts in the audio signal.
5. FUTURE SCOPE
-Due to limited memory of Arduino UNO we are using very less samples of audio signal to
encode the text. The size of text to be encoded is currently limited to one character. Our
future plan is to use SD card for storing large amount of audio data and phase code it.
-The algorithm can also be implemented on controllers such as Arduino Mega which have
larger sizes of RAM.
-A combination of Phase coding and another steganography algorithm can be used to
make it more secure. Message signal can also be encrypted prior to encoding for more
secure transmission.
6. CONCLUSION
In conclusion, the implementation of phase coding steganography on an audio signal has
proven to be effective in concealing a message within the frequency domain. The decision
to downsample the audio signal to 2980 Hz while maintaining signal quality demonstrates
a thoughtful trade-off between reducing computational load and preserving the essential
information for steganographic purposes.
The integration of Matlab and an Arduino Uno, specifically utilizing the ATMega328P
controller, showcases a practical approach to embedding and extracting hidden
information in an offline setting. The inconspicuous distortion observed in the waveforms
of the original and encoded signals in the time domain indicates a successful
implementation, highlighting the potential for maintaining audio quality during the
steganographic process.
https://ieeexplore.ieee.org/document/7423319
https://doi.org/10.2991/978-94-6463-084-8_8
https://github.com/ktekeli/audio-steganography-algorithms/tree/master/04-
Phase-Coding