11-speech encryption and decryption

19
A Paper Presentation on (SPEECH ENCRYPTION AND DECRYPTION) Presented by : Radhika Ravikrindi(1V B-TECH, ECE) Shanti Nalluri (IV B-TECH, ECE ) Contact us at: [email protected] [email protected]

Transcript of 11-speech encryption and decryption

Page 1: 11-speech encryption and decryption

A Paper Presentation on

(SPEECH ENCRYPTION AND DECRYPTION)

Presented by :

Radhika Ravikrindi(1V B-TECH, ECE)

Shanti Nalluri (IV B-TECH, ECE )

Contact us at:

[email protected]@yahoo.com

VIGNAN’S ENGINEERING COLLEGE ,Vadlamudi, GUNTUR .

Page 2: 11-speech encryption and decryption

ABSTRACT

Digital signal is a numerical representation of the analog signal. It may be easier and more cost

effective to process these signals in the digital world. One of the main advantages of digital signal

is that it can be stored and manipulated easily. To do this several processes are in use. Of these,

Digital Signal Processor plays a leading role.This is used in various applications like

instrumentation & measurement, communications , audio & video processing ,graphics , image

enhancement , navigation , radars ,control-robotics, machine vision ,guidance etc.

The objective is to encrypt the speech signal. That is to convert the speech signal into an unknown

form and then the scrambled speech signal is transmitted. The person who know, how the speech signal is

encrypted can decrypt (i.e.,converting the scrambled speech signal into original signal) the signal. Thus security of

sending speech message is done.

For encryption and decryption of the signal, we develop a software program in assembly language

programming techniques of ADSP 2181. In this paper, encryption and decryption of the speech

signal is done using the Digital Signal Processor ADSP 2181.

Page 3: 11-speech encryption and decryption

CONTENTS

1. INTRODUCTION

2. DIGITAL SIGNAL PROCESSING

3. DIGITAL SIGNAL PROCESSOR

4. ADVANTAGES

5. ENCRYPTION & DECRYPTION

6. CONCLUSION

7. REFERENCES

Page 4: 11-speech encryption and decryption

INTRODUCTION

In recent trends, cell phone, voice chat, etc., is the main topic of the communication. But it is not

possible to speak secretly through them. Our objective is to speak secretly, i.e., to maintain security of

certain important information. So for that we are going for a technology using digital signal processor.

Our paper also deals with storing and retrieval of speech signal using digital signal processor. We

have used ADSP processor 2181. This is 16 bit fixed point processor.

Here the voice signals is acquired and then digitally coded and stored in the memory of

processor. Using FFT (Fast Fourier Transform) and IFFT (Inverse Fast Fourier Transform) techniques,

speech signal is scrambled. Then it is decoded to obtain the same speech signal and now the original

speech is confused. Then it is transmitted using transmitter. The coding and decoding is done with

CODEC.

In the receiver side, if the receiver knows how the speech signal is scrambled, then the receiver would

descramble the scrambled signal and get the original speech signal. The programming is done on the

assembly language of the ADSP 2181 processor

DIGITAL SIGNAL PROCESSING

In general signal carries information, and the objective of signal processing is to extract this information.

Signal processing is the method of extracting information from the signal. Thus signal processing is

concerned with representing in mathematical terms and extracting the information by carrying out

algorithmic operations on the signal.

Analog signal are real world signals that you and I experience everyday- sound, light, temperature,

pressure. A digital signal is a numerical representation of the analog signal. We can convert the analog

signal into digital signal through our analog to digital conversion process, process the signals, and if

needed, bring the signal back out to analog world through the digital to analog converter.

Page 5: 11-speech encryption and decryption

The basic explanation of DSP is the processing of signal by digital systems, to improve the signal. The

improvement may be clearer sound, sharper images, or faster data. The digital systems are software and

hardware. In digital processing of signal consists of a number of mathematical operations as specified by

a software program.

HARDWARE BLOCK DIAGRAMHARDWARE BLOCK DIAGRAM

From PC

MIC

speaker

DIGITAL SIGNAL PROCESSOR

A digital signal processor is a type of microprocessor that is incredibly fast and powerful. They are

specifically designed to handle digital processing tasks. As a broad generalization, traditional

microprocessors, such as the Pentium, primarily directed at data manipulation. Similarly, DSPs are

designed to perform the mathematical calculations needed in digital signal processing.

A DSP is unique because it processes data in real time. To start we need to distinguish between offline

and real time processing.

RS 232 UART

ADSP-2181CLOCK

24.576Mhz

CODEC

ROM16K

WORD

PM/ROM8K WORD

24 bits14 bit (A)

DM/ROM8K WORD

24 bits14 bit (A)

Page 6: 11-speech encryption and decryption

OFFLINE PROCESSING :

In this processing, the entire input signal resides in the computer at the time of

manipulation, for example, in medical imaging such as tomography, the data is acquired while the

patient is inside the machine, but the image reconstruction may be delayed until a later time. The key

point is all the information is simultaneously available to the processing program.

REAL TIME PROCESSING:

Signal is produced at the same time that the input signal is being acquired. This real time

capability makes the DSP perfect for applications that cannot tolerate any delays. For example, did you

ever talk on a cell phone where two people couldn’t talk at once? You had to wait until the other person

finished talking. If you both spoke simultaneously, the signal will be cut. You couldn’t hear the other

person. With today’s digital cell phones, which use DSP, you can talk normally. The DSP processors

inside cell phones process sounds so rapidly you hear them as quickly as you can speak in real time.

ADVANTAGES OF DSPs OVER OTHER MICROPROCESSORS:

Data easily stored

Real time performance

Flexibility

Reliability

Increased system performance

Reduced system cost

CIRCULAR BUFFER :

To calculate the output sample, we must have access to a certain number of the most recent samples

from the input. Let a0,a1,…,a7 be the value of the 8 most recent samples from the input signal. These 8

samples must be stored in memory and x[n],x[n-1],…,x[n-7] continually updated as new samples are

acquired.

The best way to manage the stored samples is circular buffering.

Page 7: 11-speech encryption and decryption

Circular buffers are used to store the most recent values of a continually updated signal. The fig shows

how an eight sample circular buffer might appear at some instant of time.

Figure illustrates an eight sample circular buffer. Consider that we have placed this circular buffer in

eight consecutive memory locations, 20041 to 20048. Fig shows how the eight samples from the input

might be stored at one particular instant of time.

The idea of circular buffering is that the end of this linear array is connected to its beginning; memory

location 20041 is viewed as being next to 20048, just as 20044 is next to 20045. You keep track of the

array by a pointer (a variable whose value is an address) that indicates where the most recent sample

resides. For instance in the fig the pointer contains the address 20044, while it contains 20045 after the

arrival of next sample. When a new sample is acquired, it replaces the oldest sample in the array, and the

pointer is moved one address ahead.

Circular buffers are efficient because only one value needs to be changed when a new sample is

acquired. Four parameters are needed to manage the circular buffer.

MEMORY

ADDRESS

STORED

VALUES

SAMPLES

20041 -0.225768 X [N-3]

20042 -0.210768 X [N-2]

20043 -0.105768 X [N-1]

20044 -0.225108 X [N]

20045 -0.225768 X [N-7]

20046 -0.235768 X [N-6]

20047 -0.224568 X [N-5]

20048 -0.345768 X [N-4]

Page 8: 11-speech encryption and decryption

There must be a pointer that indicates the start of the circular buffer in memory (in

this example, 20041).

There must be a pointer indicating the end of the array (e.g. 20048) or a variable

that holds its length (e.g. 8).

The step size of the memory addressing must be one. Example: address 20043

contains one sample; address 20044 contains the next sample and so on.

The above three values define the size and configuration of the circular buffer, and will not change

during the program operation.

The pointer to the most recent sample must be modified as each new sample is

acquired.

In other words, there must be program logic that controls how this fourth value is updated based on the

value of the first three values. While this logic is quite simple, it must be very fast. This is the whole

point of this discussion; DSPs must be optimized at managing circular buffers to achieve the highest

possible execution speed.

BASIC BLOCK DIAGRAM :

SPEECH ENCRYPTION :

Speech signal scrambled signal

ADC FFT SCRAM-

BLING

IFFT DAC

Page 9: 11-speech encryption and decryption

SPEECH DECRYPTION :

Scrambled signal Speech signal

DISCRETE FOURIER TRANSFORM:

The Discrete Fourier Transform (DFT) of a discrete time signal x(n) is a finite duration discrete

frequency sequence. DFT is obtained by sampling one period of the Fourier Transform X () of the

signal x (n) at a finite number of frequency points.

The FT of a discrete time signal is a continuous function of and so can’t be processed by

digital system. Hence we go for DFT, which converts continuous function of into a discrete one,

allowing us to perform frequency analysis on a digital computer.

DFT is important here because

It allows us to determine frequency content of a signal, to perform spectral

analysis.

To perform filtering operations in frequency domain.

FAST FOURIER TRANSFORM:

It is an algorithm for computing DFT with reduced number of calculations. The computational

efficiency is achieved by a divide and conquer approach, which is based on the decomposition of N-

point DFT into successively smaller DFT’s. In an N-point sequence if N=rm , then the sequence can be

decimated into r-point sequences. Here ‘r’ is called the radix. If r=2 it is called radix-2 FFT. The

decimation can be done in two ways namely Decimation In Time (DIT) and Decimation In Frequency

(DIF). Here we use Radix-2 DIT FFT algorithm.

ADC FFTDESCRA-

MBLING

IFFT DAC

Page 10: 11-speech encryption and decryption

INVERSE FAST FOURIER TRANSFORM:

The IDFT of the sequence is computed using the IFFT. The FFT serves the evaluation of both direct

and inverse DFT’s.

SCRAMBLING AND DESCRAMBLING :

Scrambling means make confusion. After doing FFT in assembly language program in

ADSP-2181, the signal is converted into spikes and it is in frequency domain. The signal spikes are

stored in the memory. Using the circular buffers, the spikes positions are interchanged. Now the original

signal is scrambled. This is called scrambling. Again if the spikes are placed into its original position,

then we get original signal. This is called descrambling and is also done with the use of circular buffer.

GRAPHICAL REPRESENTATION :

SPEECH SIGNAL SCRAMBLED SIGNAL

a b c d p q r s p q r s a b c d

Page 11: 11-speech encryption and decryption

FLOW CHART:

ALGORITHM :

ENCRYPTION :

1) First the speech signal (analog signal) is converted into digital signal by passing

through the CODEC. Now the signal is in time domain and it is sent to the ADSP

2181 processor.

2) By running 128-point FFT algorithm using computer (system is connected to the

processor) on ADSP 2181, the signal which is in time domain is converted into

START

Storing digital signal in memory of DSP

Divided into 128 samples

Bit reverse of samples

FFT

Scrambling and descrambling

IFFT

Return

Return Input from CODEC

Output to CODEC

Page 12: 11-speech encryption and decryption

frequency domain. Now the signal is sampled into 128 samples and it is stored in

the processor memory.

3) By doing assembly language program on ADSP 2181, first 64 samples are

displaced into next 64 samples position and vice versa. This is called scrambling.

4) Now the original signal is scrambled and by doing IFFT algorithm on ADSP

2181, the scrambled signal, which is in frequency domain, is converted into time

domain.

5)By CODEC scrambled signal which is a digital signal is converted into analog signal and then it is

transmitted.

DECRYPTION :

Received signal (scrambled signal) is converted into digital signal by CODEC and it is sent to the

processor.

1) By 128-point FFT algorithm, the signal in time domain is converted into frequency

domain as done in the encryption part.

2) By doing assembly language program on ADSP 2181, the displaced 64 samples are

placed to its original position. This is called descrambling.

3) Now the scrambled signal is descrambled and we get the original signal.

4) By doing IFFT, the original signal, which is in frequency domain, is converted into time

domain and by CODEC we get original analog signal (speech signal).

The assembly language program was executed for the speech signal and the output

was checked. Encryption and Decryption is highly realized.

We have stored the speech signal in the memory in encoded form. We decode the

same to get the analog output. For coding and decoding, CODEC is used.

Page 13: 11-speech encryption and decryption

CONCLUSION :

We can use this technique in military for sending secret messages. We can use this

technique wherever we want security. What we have done is storing the speech signal for a period of few

milli seconds. This can be increased if we extend the memory size and select that through a decoding

switch.

REFERENCES :

Sanjit K. Mitra, “Digital signal processing”

Alan V.Oppenheiim and Allan Willsky, “Signals and Systems”

P.Ramesbabu , “Digital signal processing”

“ADSP-218X DSP Instruction Set Reference”

WEBSITES:

www.analogdevice.com

www.DSPguide.com