0% found this document useful (0 votes)
13 views

DSP Project Report

Uploaded by

B53S.Mahathi
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
13 views

DSP Project Report

Uploaded by

B53S.Mahathi
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 18

PROJECT REPORT

DIGITAL SIGNAL PROCESSING (EC 301)

AUDIO STEGANOGRAPHY USING PHASE CODING

SUBMITTED TO:

Dr. Ravi Kumar Jatoth


Professor, Electronics and Communication Engineering

National Institute of Technology, Warangal

SUBMITTED BY:
Potluri Satya Sri Varsha -21ECB0B44

Sarvepalli Mahathi - 21ECB0B53

Vattam Sai Sharanya- 21ECB0B63

B.Tech in Electronics and Communication Engineering

National Institute of Technology, Warangal


ABSTRACT

Steganography, the art of covert communication, plays a crucial role in securing


information by concealing it within seemingly innocuous carriers. This project explores
audio steganography, focusing on the Phase Encoding Technique to embed secret
messages within audio signals. Leveraging the principles of Hermitian symmetry and
phase manipulation, the method ensures seamless integration of hidden information
without perceptible distortions. The implementation involves dividing the audio signal
into segments, encoding binary data in the phase spectrum, and maintaining the integrity
of the original signal through inverse Fourier transformations. The proposed approach
achieves a balance between robust concealment and minimal impact on audio quality.
Experimental results demonstrate the effectiveness of the technique in securely
embedding and extracting hidden messages, contributing to the realm of covert
communication in audio domains.

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.

In the realm of steganography, audio exhibits certain advantages when compared to


image and video formats. Sound recordings are typically larger than image files, providing
more space to accommodate a greater amount of encoded messages. On the other hand,
video formats, while comparatively larger in size, suffer from reduced practicality as they
lack the necessary algorithms to effectively manage and process their extensive content.

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.

3. The phase difference between adjacent matrices is calculated and stored.

4. The message is converted into its binary form (ascii values).

5. The secret message is inserted in the phase vector of the first signal segment as follows:

Phase_new = π/2 if message bit = 0

−π/2 if message bit = 1

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.

8. Concatenated the audio segment to the original audio file.


2.2 EXTRACTING:

The process of extraction is used to get the data that is previously incorporated into the
audio. The steps for extraction are as follows:

1. Obtained the starting segment of the audio file.

2. Applied FFT on it and obtained phase values.

3. Phase values are observed and data bits are extracted as follows:

Data = 0 if phase > 0

1 if phase > 1

4. The obtained binary data is converted into characters using ascii to binary
conversion.

2.3 FAST FOURIER TRANSFORM (FFT)

It is an efficient algorithm for computing the Discrete Fourier Transform (DFT) of a


sequence. It breaks down the DFT computation into smaller subproblems, significantly
reducing the number of operations.

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.

FFT of first 8 samples:

First 8 samples of audio signal are obtained and radix 2 FFT algorithm is used to compute
discrete fourier transform.
3. IMPLEMENTATION

3.1 PREPROCESSING OF AUDIO SIGNAL


Initially we started by taking 8 bit mono .wav file in MATLAB and converted it into .txt
format using MATLAB. To reduce computations, we downsampled our audio signal from
44100 to 2940 i.e. 15 times downsampled using the below code.
The text file “audio_samples.txt” created consists of downsampled signal values.

3.2 PHASE ENCODING


The data bits of the message text are encoded in the phase spectrum of the audio signal.
This is performed by first converting each character in the message text into an 8 bit
binary number, and embedding each character into one segment of the fourier transform
of the signal.

In a given segment, each bit is encoded into one phase value by changing the phase value.
This is done as follows:

Phase_new = π/2 if message bit = 0

−π/2 if message bit = 1

Let us consider i as signalLength, m as textLenth*8 and N as i/L. Where L is the length of


each segment(Here 32). N represents the number of segments(Here 1). First NxL samples
from input signal are reshaped into matrix of size NxL i.e 1x32. Note that the size of input
signal is taken only 32 due to size constraint of Arduino Uno.

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.

3.3 PHASE DECODING

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.

To extract the encoded bits,we use the below method:

Binary bit = (0, if phase > 0

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

An audio signal of frequency 44100 Hz was considered for steganographing a message of


ascii characters. The audio signal was downsampled to 2980 Hz, to reduce the number of
samples while maintaining the same quality of signal. Matlab was used for reading the
samples of audio from the mono.wave input signal and efficiently reducing the number
of samples.

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.

While this report provides a successful implementation of phase coding steganography,


it is essential to acknowledge that the effectiveness of any steganographic technique is
contingent upon various factors, including the sophistication of potential adversaries and
the specific requirements of the application. Future work could explore the robustness of
the proposed method against more advanced steganalysis techniques and evaluate its
performance in diverse audio environments. Nonetheless, the presented system stands
as a promising example of leveraging phase coding for covert communication within
audio signals.
REFERENCES

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

You might also like