Image Encryption - A Communication Perspective
Image Encryption - A Communication Perspective
ENCRYPTION
A Communication Perspective
www.allitebooks.com
IMAGE
ENCRYPTION
A Communication Perspective
www.allitebooks.com
www.allitebooks.com
IMAGE
ENCRYPTION
A Communication Perspective
www.allitebooks.com
MATLAB® is a trademark of The MathWorks, Inc. and is used with permission. The MathWorks does not
warrant the accuracy of the text or exercises in this book. This book’s use or discussion of MATLAB® soft-
ware or related products does not constitute endorsement or sponsorship by The MathWorks of a particular
pedagogical approach or particular use of the MATLAB® software.
CRC Press
Taylor & Francis Group
6000 Broken Sound Parkway NW, Suite 300
Boca Raton, FL 33487-2742
This book contains information obtained from authentic and highly regarded sources. Reasonable efforts
have been made to publish reliable data and information, but the author and publisher cannot assume
responsibility for the validity of all materials or the consequences of their use. The authors and publishers
have attempted to trace the copyright holders of all material reproduced in this publication and apologize to
copyright holders if permission to publish in this form has not been obtained. If any copyright material has
not been acknowledged please write and let us know so we may rectify in any future reprint.
Except as permitted under U.S. Copyright Law, no part of this book may be reprinted, reproduced, transmit-
ted, or utilized in any form by any electronic, mechanical, or other means, now known or hereafter invented,
including photocopying, microfilming, and recording, or in any information storage or retrieval system,
without written permission from the publishers.
For permission to photocopy or use material electronically from this work, please access www.copyright.
com (http://www.copyright.com/) or contact the Copyright Clearance Center, Inc. (CCC), 222 Rosewood
Drive, Danvers, MA 01923, 978-750-8400. CCC is a not-for-profit organization that provides licenses and
registration for a variety of users. For organizations that have been granted a photocopy license by the CCC,
a separate system of payment has been arranged.
Trademark Notice: Product or corporate names may be trademarks or registered trademarks, and are used
only for identification and explanation without intent to infringe.
Visit the Taylor & Francis Web site at
http://www.taylorandfrancis.com
www.allitebooks.com
Contents
P r e fa c e ix
About the A u t h o r s xi
C h a p t e r 1 I n t r o d u c t i o n 1
C h a p t e r 2 F u n d a m e n ta l s o f I m a g e E n c r y p t i o n 3
2.1 Introduction 3
2.2 Basic Concepts of Cryptography 4
2.2.1 Goals of Cryptography 4
2.2.2 Principles of Encryption 5
2.3 Classification of Encryption Algorithms 6
2.3.1 Classification According to Encryption Structure 6
2.3.2 Classification According to Keys 7
2.3.3 Classification According to Percentage of
Encrypted Data 8
2.4 Cryptanalysis 9
2.5 Features of Image Encryption Schemes 10
2.6 Conventional Symmetric Block Ciphers 11
2.6.1 Data Encryption Standard 11
2.6.2 Double DES 14
2.6.3 Triple DES 14
2.6.4 International Data Encryption Algorithm 15
2.6.5 Blowfish 16
2.6.6 RC5 Algorithm 16
2.6.6.1 RC5 Encryption Algorithm 17
2.6.6.2 RC5 Decryption Algorithm 17
2.6.6.3 RC5 Key Expansion 17
2.6.7 RC6 Algorithm 19
www.allitebooks.com
vi C o n t en t s
C h a p t e r 3 E n c r y p t i o n E va l uat i o n M e t r i c s 33
3.1 Introduction 33
3.2 Encryption Evaluation Metrics 34
3.2.1 Histogram Deviation 34
3.2.2 Correlation Coefficient 35
3.2.3 Irregular Deviation 35
3.2.4 Histogram Uniformity 36
3.2.5 Deviation from Ideality 36
3.2.6 Avalanche Effect 37
3.2.7 NPCR and UACI 37
3.3 Other Tests 38
3.3.1 Noise Immunity 38
3.3.2 The Processing Time 38
3.4 Testing the Evaluation Metrics 38
3.5 Summary 42
C h a p t e r 4 H o m o m o r p h i c I m a g e E n c r y p t i o n 43
4.1 Overview 43
4.2 Homomorphic Cryptosystem 43
4.3 Security Analysis and Test Results 45
4.3.1 Statistical Analysis 45
4.3.1.1 Histograms of Encrypted Images 46
4.3.1.2 Encryption Quality Measurements 47
4.3.2 Key Space Analysis 48
4.3.2.1 Exhaustive Key Search 48
4.3.2.2 Key Sensitivity Test 49
4.3.3 Differential Analysis 53
4.4 Effect of Noise 54
4.5 Summary 54
C h a p t e r 5 C h a o t i c I m a g e E n c r y p t i o n w i t h D i f f e r e n t
M o d e s o f O p e r at i o n 57
5.1 Overview 57
5.2 Chaotic Encryption with Modes of Operation 57
5.3 Implementation Issues 58
5.4 Simulation Examples and Discussion 60
5.5 Summary 68
www.allitebooks.com
C o n t en t s vii
C h a p t e r 6 D i f f u s i o n M e c h a n i s m f o r D ata E n c r y p t i o n
i n t h e ECB M o d e 71
6.1 Introduction 71
6.2 The Preprocessing Network 72
6.2.1 The Addition Part 72
6.2.2 The SPN 73
6.3 Implementation Issues 73
6.3.1 Effect of the Normalized Block Size on Diffusion 74
6.3.2 Effect of the Normalized Block Size on Block
Dependency 77
6.4 Simulation Examples 78
6.4.1 Encryption Quality 79
6.4.2 Diffusion 79
6.4.3 Encryption of Images with Few Details 82
6.5 Summary 88
C h a p t e r 7 O r t h o g o n a l F r e q u e n cy D i v i s i o n
M u lt ip l e x i n g 89
7.1 Introduction 89
7.2 Basic Principles of OFDM 90
7.2.1 Orthogonality 92
7.2.2 Frequency Domain Orthogonality 93
7.3 OFDM System Model 94
7.3.1 FFT-OFDM 94
7.3.2 DCT-OFDM 95
7.3.3 DWT–OFDM 95
7.3.4 Discrete Wavelet Transform 96
7.3.4.1 Implementation of the DWT 96
7.3.4.2 Haar Wavelet Transform 98
7.4 Guard Interval Insertion 99
7.5 Communication Channels 100
7.5.1 Additive White Gaussian Noise Channel 100
7.5.2 Fading Channel 100
7.6 Channel Estimation and Equalization 101
www.allitebooks.com
viii C o n t en t s
C h a p t e r 9 S i m u l at i o n E x a m p l e s 133
9.1 Simulation Parameters 133
9.2 Simulation Experiments in the Presence of CFO 169
9.3 Simulation Experiments for Enhanced Algorithms 171
9.4 Simulation Experiments of PAPR Reduction Methods 187
9.5 Summary 223
R e f e r e n c e s 225
A pp e n d i x A 237
A pp e n d i x B 293
www.allitebooks.com
Preface
ix
www.allitebooks.com
x P refac e
xi
x ii A b o u t t he Au t h o rs
1
2 Im ag e En c ry p ti o n
2.1 Introduction
3
4 Im ag e En c ry p ti o n
C = E K e ( P ) (2.1)
P = DK d (C ) (2.2)
www.allitebooks.com
6 Im ag e En c ry p ti o n
Ke Kd
Recovered
Plaintext Ciphertext plaintext
Encryption Decryption
Public channel
K
K
Secret Secure
Key Channel
X
Cryptanalyst .G
The Source A
The Destination B
Message X Y X
Encrypt Decrypt Destination
source
.G
.H
Key pair
source
2.4 Cryptanalysis
Unlike text messages, image data have their special features, such as
high redundancy and high correlation among pixels. Also, they are usu-
ally huge in size. Together, these make traditional encryption methods
difficult to apply and slow to process. Sometimes, image applications
have their own requirements, like real-time processing, fidelity reser-
vation, image format consistency, data compression for transmission,
and so on. Simultaneous fulfillment of these requirements along with
high-security and high-quality demands has presented great chal-
lenges to real-time imaging practice. For studying image encryption,
F un da m en ta l s o f Im ag e En c ry p ti o n 11
32 1 2 3 4 5 6 7 8 9 10 11 12 32
48 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 48
algorithm and key of size 56 bits are used for both encryption and
decryption except for minor differences in the key schedule. The key
is usually expressed as a 64-bit number, but every eighth bit, one bit
is used for parity checking and is ignored. These parity bits are the
least-significant bits of the key bytes. The key can be any 56-bit num-
ber and can be changed at any time, although some selections can be
considered weak keys.
The DES is based on four basic operations: expansion, permutation,
XOR, and substitution. The data to be encrypted are first divided into
64-bit blocks and fed into an Initial Permutation (IP) stage, in which
each block is divided into two subblocks, each with a 32-bit length.
The right subblock is fed into a Feistel function (f-function), which is
depicted in Figure 2.4. It operates on half a block (32 bits) at a time
and consists of four stages as shown in Figure 2.5.
1. Expansion. The 32-bit half block is expanded to 48 bits using
the expansion permutation, denoted as E in the diagram, by
duplicating half of the bits. The output consists of eight 6-bit
(8 × 6 = 48 bits) pieces, each containing a copy of 4 corre-
sponding input bits plus a copy of the immediately adjacent
bit from each of the input pieces to either side.
2. Key mixing. The result is combined with a subkey using
an XOR operation. Sixteen 48-bit subkeys, one for each
round, are derived from the main key using a key-schedule
mechanism.
3. Substitution. After mixing with the subkey, the block is
divided into eight 6-bit pieces before processing by the
Substitution boxes (S-boxes). Each of the eight S-boxes
replaces its six input bits with four output bits according to
a nonlinear transformation, provided in the form of a lookup
table. The S-boxes provide the core of security of the DES.
F un da m en ta l s o f Im ag e En c ry p ti o n 13
Plaintext 64 bits
IP
For 16 rounds
FP
Ciphertext 64 bits
S S S S S S S S
www.allitebooks.com
16 Im ag e En c ry p ti o n
2.6.5 Blowfish
Ai–1 Bi–1
+ +
<<< <<<
+ S2i
+ S2i+1
Ai Bi
A = A+S [0];
B = B+S [1];
For i = 1 to r do
A = ((A ⊕ B) <<< B) +S [2i];
B = ((B ⊕ A) <<< A) +S [2i+1];
End
For i = r downto 1 do
B = ((B - S [2i+1]) >>> A) ⊕ A;
A = ((A - S [2]) >>> B) ⊕ B;
End
B = B-S [1];
A = A-S [0];
2.6.6.3 RC5 Key Expansion Key expansion expands the user’s secret
key K to fill the expanded key array S, which makes S similar to an
18 Im ag e En c ry p ti o n
( )
Pw = Odd ( e − 2 ) 2w (2.3)
( )
Qw = Odd ( φ − 1) 2w (2.4)
where
e = 2.718281828459....(base of natural logarithms)
ϕ = 1.618033988749....(golden ratio)
and Odd(x) is the odd integer nearest to x. For w = 16 and 32, these
constants are given in hexadecimal:
S [0] = PW;
For i = 1 to t-1 do
S [i] = S [i-1] + QW;
End
The last step is to mix the user secret key in three passes over the
arrays S and L as follows:
i = j = 0;
A = B = 0;
Do 3*max (t, c) times:
A = S [i] = (S [i] +A+B) <<<3;
B = L[j] = (L[j] + A+ B) <<< (A+B);
i = (i+1) mod (t);
j = (j+1) mod (c);
F un da m en ta l s o f Im ag e En c ry p ti o n 19
The RC6 block cipher is a modified version of RC5 that uses four
working registers instead of two and integer multiplication as an addi-
tional primitive operation. The integer multiplication process greatly
enhances the diffusion achieved per round, which leads to greater
security, fewer rounds, and increased throughput. The key schedule
of RC6-w/r/b is similar to the key schedule of RC5-w/r/b. The only
difference is that for RC6-w/r/b, more words are derived from the
user-supplied key for use during encryption and decryption. The user
supplies a key of b bytes, where 0 ≤ b ≤ 255. From this key, 2r + 4
words (w bits each) are derived and stored in the array S[0, … , 2r + 3].
This array is used in both encryption and decryption [12]. Generally,
RC6 consists of two Feistel networks whose data are mixed via data-
dependent rotations. The operations in a single round of RC6 con-
tain two applications of the squaring function f(x) = x(2x + 1) mod
232, two fixed 32-bit rotations, two data-dependent 32-bit rotations,
two XORs, and two additions modulo 232. The steps of RC6 encryp-
tion and decryption are summarized next, and the block diagrams of
RC6 encryption and decryption are shown in Figures 2.7 and 2.8,
respectively.
A B C D
+ S[0] + S[1]
+ <<< f + <<< f
lg w lg w
<<<
<<<
+ S[2i+2] + S[2r+3]
A B C D
A B C D
– S[2r+2] – S[2r+3]
– S[2i] – S[2i+1]
>>>
+ <<< f + <<< f
log(w) log(w)
– S[0] – S[1]
A B C D
by 32. The cipher key is similarly a rectangular array with four rows
and a number of columns equal to the key size divided by 32. The
number of rounds performed on the intermediate state is related to the
key size. For key sizes of 128, 192, and 256 bits, the number of rounds
is 10, 12, and 14, respectively. Each round consists of a fixed sequence
of transformations, except the first and the last round [16–18].
The AES consists of rounds. Any round, except the final one,
consists of SubBytes, ShiftRows, MixColumns, and AddRoundKey
operations. In the final round, no MixColumns operation is per-
formed. In the SubBytes step, a linear substitution for each byte is
performed according to Figure 2.9. Each byte in the array is updated
using an 8-bit S-box, which provides the nonlinearity in the cipher
system [16–18].
The S-box is derived from the multiplicative inverse over the finite
Galois field GF(28), known to have good nonlinearity properties. To
avoid attacks based on simple algebraic properties, the S-box is cho-
sen to avoid any fixed points and any opposite fixed points [16–18].
The ShiftRows step operates on the rows of the state. It cycli-
cally shifts the bytes in each row. For the AES, the first row is left
unchanged. Each byte of the second row is shifted a single byte to the
left. Similarly, the third and fourth rows are shifted by offsets of 2 and
3 bytes, respectively. For the block of size 128 bits and 192 bits, the
shifting pattern is the same [16–18].
In this way, each column of the output state of the ShiftRows step
is composed of bytes from each column of the input state. In the case
of the 256-bit blocks, the first row is unchanged, and the shifting for
b1 b2 b3 b4 d1 d2 d3 d4
b5 b6 b7 b8 SubBytes d5 d6 d7 d8
b1 b2 b3 b4 b1 b2 b3 b4
b5 b6 b7 b8 b6 b7 b8 b5
ShiftRows
b1 b2 b3 b4 d1 d2 d3 d4
b5 b6 b7 b8 d5 d6 d7 d8
MixColumns
C(x)
second, third, and fourth rows is 1 byte, 3 bytes, and 4 bytes, respec-
tively, as shown in Figure 2.10.
In the MixColumns step, the 4 bytes of each column of
the state are combined using an invertible linear transforma-
tion. The MixColumns function takes 4 bytes as input and out-
puts 4 bytes, where each input byte affects all 4 output bytes. With
ShiftRows, MixColumns provides diffusion in the cipher system.
Each column is treated as a p olynomial over GF(28) and is then
multiplied with a fixed polynomial C(x) = 3x 3 + x 2 + x + 2. The
MixColumns step can also be viewed as multiplication by a particu-
lar matrix as shown in Figure 2.11 [16–18].
In the AddRoundKey step, the subkey is combined with the state.
For each round, a subkey is derived from the main key using the
algorithm key schedule. Each subkey has the same size as the state.
24 Im ag e En c ry p ti o n
b1 b2 b3 b4 d1 d2 d3 d4
b5 b6 b7 b8 d5 d6 d7 d8
AddRoundKey
C(x)
k1 k2 k3 k4
k5 k6 k7 k8
The subkey is added by combining each byte of the state with the
corresponding byte of the subkey using a bitwise XOR [16–18]. The
AddRoundKey step is shown in Figure 2.12. We apply the AES with
a fixed block size of 128 bits and a key size of 128 bits.
Cj = EK (Pj) (2.5)
Pj = DK (Cj) (2.6)
where j = 1, 2, 3, ... ; EK is the encryption map with the key K; and DK
is the decryption map with the same key K.
The ECB mode has several advantages. There is no need to encrypt
a file progressively; the middle blocks can be encrypted first, then
the blocks at the end, and finally the blocks at the beginning. This is
important for encrypted files that are accessed randomly, like a data-
base. If a database is encrypted in the ECB mode, then any record can
be added, deleted, encrypted, or decrypted independently, assuming
that a record consists of independent encryption blocks.
The disadvantage of this mode is that identical plaintext blocks
are encrypted to identical ciphertext blocks; it does not hide data
patterns. The advantage is that error propagation is limited to a
single block. The disadvantage of the ECB mode appears in image
encryption if there is an image with large areas of the same color or
repeated patterns so that there are many blocks of the same plaintext.
www.allitebooks.com
26 Im ag e En c ry p ti o n
This may reveal much information about the original image from the
encrypted image. This disadvantage is treated in CBC, CFB, and
OFB modes.
The CBC mode uses an initialization vector (IV) of size equal to the
size of each block of pixels. In this mode, each block of plaintext is
XORed with the previous ciphertext block before being encrypted.
By this way, each ciphertext block is dependent on all plaintext
blocks up to that point. In decryption, the same XOR operation is
repeated so that its effect is cancelled. This mechanism is shown in
Figure 2.14.
The main disadvantage of the CBC mode is that an error in (or
attack on) one ciphertext block impacts two plaintext blocks on
decryption. On the other hand, if there is an image that has blocks
of the same input data, these blocks are encrypted to totally different
ciphertext data. So, the CBC mode is a better approach in encrypting
images in the spatial domain, especially when these images contain
large areas of the same activity. In the CBC mode, the encryption
algorithm is
P1 P2 P3
C0 = IV + + +
C1 C2 C3
Cj = Pj ⊕ Ij (2.10)
C 0 = IV (2.13)
2.7.4 The OFB Mode
C0 = IV EK I1 EK I2 EK I3
P1 P2 P3
+ + +
C1 C2 C3
I0 = IV EK I1 EK I2 EK I1
P1 P2 P3
+ + +
C1 C2 C3
continues until the last block. Changing the IV for the same plaintext
block results in different ciphertext blocks. Figure 2.16 shows the
OFB mode [16–18,49,50]. The encryption algorithm is
Cj = Pj ⊕ Ij (2.14)
and the decryption algorithm is
Pj = Cj ⊕ Ij (2.15)
Ij = EK(Ij-1), j = 1,2,3,..... (2.16)
I0 = IV (2.17)
Chaos theory has been established since the 1970s in many different
research areas, such as physics, mathematics, engineering, biology,
and others. The most well-known characteristics of chaos are the so-
called butterfly effect (sensitivity to initial conditions) and the pseudo-
randomness generated by deterministic equations. Many fundamental
properties of chaotic systems have their corresponding counterparts
in traditional cryptosystems. Chaotic systems have several significant
features favorable to secure communications, such as ergodicity, sen-
sitivity to initial conditions and control parameters, and random-like
behavior [38–40]. With all these advantages, scientists expected to
introduce new and powerful tools of chaotic cryptography. So, chaos
has become a new rich source of new ciphers [31–35].
Chaotic dynamic systems are dimensional nonlinear dynamic sys-
tems that are capable of complex and unpredictable behavior. Chaos
describes a system that is sensitive to initial conditions to generate an
apparently random behavior but at the same time it is completely deter-
ministic. These properties of chaos have much p otential for applications
F un da m en ta l s o f Im ag e En c ry p ti o n 29
Table 2.4 Similarities and Differences between Chaotic Systems and Cryptographic Algorithms
CHAOTIC SYSTEMS CRYPTOGRAPHIC ALGORITHMS
Set of real numbers Finite set of integers
Iterations Rounds
Parameters Key
Sensitivity to a change in initial conditions Diffusion
— Security
30 Im ag e En c ry p ti o n
map produces various random keys from various orbits of the map,
which guarantees the security. Based on the key, a binary sequence
is generated to control the encryption algorithm. The input image
of two dimensions is transformed into a 1D array and then divided
into various subblocks. Then, the position permutation and value per-
mutation are applied to each binary matrix representing a subblock.
Finally, the receiver uses the same subkeys to decrypt the encrypted
images. On the other hand, chaotic encryption with 2D maps like the
Baker map is different, as shown in the next section.
The Baker map stretches the image horizontally and then folds it
vertically. Repeating this process, the positions of all pixels of the
plainimage are changed [51,52,61]. Let B(n1, … , nk ) denote the dis-
cretized map, where the vector [n1, … , nk] represents the secret key
Skey. Defining N as the number of data items in one row, the secret key
is chosen such that each integer ni divides N, and n1 + … + nk = N.
Let Ni = n1 + … + ni. The data item at the indices (q, z) is moved to
the indices:
N N
B(n1 ,...,nk ) ( q , z ) = ( q − N i ) + z mod ,
ni ni
ni N
z − z mod + N (2.18)
ni
i
N
(a) (b)
Figure 2.17 (a) The 8 × 8 matrix divided into rectangles. (b) The matrix after applying the 2D
Baker map.
3.1 Introduction
33
34 IMAGE EN C RY P TI ON
d 0 + d 255
∑
254
+ di
2 i =1
DH = (3.1)
M×N
Although this metric gives good results about how the encrypted
image deviates from the original image, it cannot be used alone to
measure the quality of encryption as it has some limitations, explained
further in this chapter.
En c ry p ti o n E va luati o n M e t ric s 35
cov( x , y )
r xy = (3.2)
D(x ) D( y )
E (x ) = 1
L ∑ x (3.3)
l =1
l
D(x ) = 1
L ∑ (x − E(x )) (3.4)
l =1
l
2
cov( x , y ) = 1
L ∑ (x − E(x ))( y − E( y )) (3.5)
l =1
l l
www.allitebooks.com
36 IMAGE EN C RY P TI ON
∑
255
H D (i )
DI = i =0
(3.7)
M×N
The lower the value of DI, the better the encryption quality will be.
M×N
0 ≤ C I ≤ 255
H (C I ) = 256 (3.8)
0 elsewhere
En c ry p ti o n E va luati o n M e t ric s 37
255
∑ H (C ) − H (C )
CI =0
I
D= (3.9)
M×N
We can use the Avalanche effect metric [73,74] to test the efficiency
of the diffusion mechanism. A single bit change can be made in the
image P to give a modified image P’. Both P and P’ are encrypted to
give C and C’. The Avalanche effect metric is the percentage of differ-
ent bits between C and C’. If C and C’ differ from each other in half
of their bits, we can say that the encryption algorithm possesses good
diffusion characteristics.
NPCR =
∑ i, j
D(i , j )
× 100% (3.10)
M×N
UACI =
1
M × N ∑ i, j
C1 (i , j ) − C 2 (i , j )
255 × 100% (3.11)
where f (m, n) is the original image, and fd (m, n) is the decrypted image.
ciphering technique. The image size is 256 × 256 pixels. If we apply this
cipher on an image I to obtain the image J, then we will add a constant
offset to the pixel values such that the values exceeding 255 are rotated
back starting from the 0 level again. This is shown by the equation
J(m, n) = {I(m, n)+K(m, n)}mod 256, K(m, n) = 254 × I(m, n) + 255
(3.13)
where K is the cipher offset, and it is considered the key as well. We
choose the offset K of the Caesar cipher such that the location con-
taining a peak in the histogram of the original image contains a very
low value in the encrypted image, and the location containing a low
value in the original image contains a peak in the encrypted image as
shown in Figure 3.1.
Note here that the Caesar cipher is useless in image encryption,
because only a change in the image gray scale occurs keeping the
entire image features visible to the attacker, who does not know the
decryption key. It is noticed that the image was not actually encrypted.
Besides, this cipher does not possess any diffusion at all.
(a) (b)
1000
1000
900
900
800 800
700
Occurrence
700
Occurrence
600 600
500 500
400 400
300 300
200 200
100 100
0 0
(c) (d)
Figure 3.1 The Cameraman image: (a) original version; (b) flipped version; (c) original image
histogram; (d) flipped image histogram.
40 IMAGE EN C RY P TI ON
(a) (b)
18000 4500
16000 4000
14000 3500
Occurrence
12000 3000
Occurrence
10000 2500
8000 2000
6000 1500
4000 1000
2000 500
0 0
0 50 100 150 200 250 0 50 100 150 200 250
Gray Level Gray Level
(c) (d)
Figure 3.2 The Coin image: (a) original version; (b) encrypted version; (c) original image
histogram; (d) encrypted image histogram.
600
500
400
Occurrence
300
200
100
Figure 3.3 (a) The encrypted image with the RC6 algorithm; (b) the histogram.
It is obvious that the first two images were encrypted badly without
any diffusion characteristics, while the last image was encrypted well,
with good diffusion characteristics. The results of each evaluation
metric for every case are tabulated in Table 3.1, and the diffusion test
results are tabulated in Table 3.2.
From these results, we can see the following for the first case:
1. The histogram deviation gives a high result of 1.29, indicating
the good performance of the Caesar cipher, which is com-
pletely a wrong decision as the entire image features are still
visible. The histogram deviation depends on the difference
between the histograms of the plainimage and the cipherim-
age, which does not necessarily mean a good encryption.
2. The correlation coefficient of −1 means that the cipherimage
is the reverse of the plainimage, which is totally true.
3. The rest of the results, including the histogram uniformity,
have judged the bad performance of the Caesar cipher correctly.
4. For the diffusion tests, the results are almost zero because the
Caesar cipher does not possess any diffusion characteristics.
For the second case,
1. The histogram deviation, again, could not judge the encryption
performance correctly because the plainimage has a localized
histogram.
2. For the correlation coefficient, the result indicates that the
plainimage is uncorrelated with the cipherimage, which is
42 IMAGE EN C RY P TI ON
true, but this does not mean that the plainimage is encrypted
correctly.
3. The rest of the tests have judged the encryption quality
correctly.
4. For the ECB mode, the diffusion characteristics are bad, and
this is indicated correctly with the diffusion tests.
For the third case, all test results correctly judged the good encryp-
tion and diffusion characteristics of the CBC mode.
3.5 Summary
4.1 Overview
43
44 IMAGE EN C RY P TI ON
Encryption
HPF
Algorithm
Ln(r(m, n))
(a)
Ln(i(m, n))
LSB
Encrypted + exp Decrypted
Watermark
Image Decryption Image
Extraction
Algorithm
Ln(r(m, n))
(b)
Figure 4.1 Homomorphic image cryptosystem: (a) encryption subsystem and (b) decryption
subsystem.
1 1 1
1
× 1 1 1
9
1 1 1
The RC6 block cipher algorithm and the chaotic Baker map scram-
bling algorithm have been chosen as they are representatives of differ-
ent encryption families. The first one belongs to the family of diffusion
algorithms, and the second one belongs to the family of permutation
algorithms. The objective is to decide which family is more appropri-
ate for the homomorphic cryptosystem.
3000
2500
2000
Occurrence
1500
1000
500
0
0 50 100 150 200 250
Gray Scale
(a) (b)
www.allitebooks.com
46 IMAGE EN C RY P TI ON
2000
1500
Distribution
1000
500
Figure 4.4 Encrypted image using the homomorphic cryptosystem with the RC6 algorithm: (a)
encrypted image and (b) histogram.
2500
2000
Distribution
1500
1000
500
Figure 4.5 Encrypted image using the RC6 algorithm: (a) encrypted image and (b) histogram.
H o m o m o r p hic Im ag e En c ry p ti o n 47
4500
4000
3500
3000
Distribution
2500
2000
1500
1000
500
0
Figure 4.6 Encrypted image using the homomorphic cryptosystem with the chaotic Baker map
scrambling algorithm: (a) encrypted image and (b) histogram.
3000
2500
2000
Distribution
1500
1000
500
Figure 4.7 Encrypted image using the chaotic Baker map algorithm: (a) encrypted image and
(b) histogram.
4.3.2.1 Exhaustive Key Search For a secure image cryptosystem, the key
space should be large enough to make the brute-force attack i nfeasible
[88]. The RC6 algorithm is a 128-bit encryption scheme. An exhaus-
tive key search will take 2k operations to succeed, where k is the key
size in bits. An attacker simply tries all keys, one by one, and checks
whether the given plainimage encrypts to the given cipherimage.
For a practical use of the homomorphic cryptosystem, assume that
the secret key length is 128 bits. Therefore, an opponent may try to
bypass guessing the key and directly guess all the possible combina-
tions. The opponent will need about 2128 operations to successfully
determine the key. If an opponent employs a 1000-MIPS (million
instructions per second) computer to guess the key by the brute-force
attack, the computational load is then
2128
> 10.7902831 × 10 21 years (4.3)
1000 ×10 6 × 60 × 60 × 24 × 365
the number of possible keys is 10126 [52]. So, in this case, the compu-
tational load is then
10126
> 3.1710 × 10109 years (4.4)
1000 ×10 6 × 60 × 60 × 24 × 365
Figure 4.8 Key sensitivity test of the homomorphic cryptosystem with the RC6 algorithm:
(a) encrypted image A with a key of 32 zeroes hexadecimal; (b) encrypted image B with a key of 8
and 31 zeroes hexadecimal; and (c) encrypted image C with a key of 31 zeroes and 1 hexadecimal.
50 IMAGE EN C RY P TI ON
Figure 4.9 Key sensitivity test of RC6 algorithm: (a) encrypted image A with a key of 32 zeroes
hexadecimal: (b) encrypted image B with a key of 8 and 31 zeroes hexadecimal; and (c) encrypted
image C with a key of 31 zeroes and 1 hexadecimal.
H o m o m o r p hic Im ag e En c ry p ti o n 51
Figure 4.10 Key sensitivity test of the homomorphic cryptosystem with the chaotic Baker map
scrambling algorithm: (a) encrypted image A with key n; (b) encrypted image B with key n1; and
(c) encrypted image C with key n2.
Figure 4.11 Key sensitivity test of the chaotic Baker map algorithm: (a) encrypted image A with
key n; (b) encrypted image B with key n1; and (c) encrypted image C with key n2.
said that the correlation coefficients are worse than those obtained
using the homomorphic cryptosystem with the RC6 algorithm.
Similar results are obtained using the chaotic Baker map scrambling
encryption algorithm only, as shown in Figures 4.11a–4.11c and
Table 4.5.
Another test for the key sensitivity of the homomorphic image
cryptosystem using the RC6 encryption algorithm is performed
through the following steps:
1. A 512 × 512 image is encrypted using the secret test key of 32
zeroes.
2. The encryption key is changed by changing its LSB to be 31
zeroes and 1.
3. The two ciphered images are compared.
The result is that the image encrypted with the key of 31 zeroes and
1 is totally different from the image encrypted with the all-zeros key,
although there is only 1 bit difference in the two keys. Figure 4.12a
shows the difference image between the two ciphered images. A simi-
lar test was also applied to the RC6 encryption algorithm, and the
result is shown in Figure 4.12b.
H o m o m o r p hic Im ag e En c ry p ti o n 53
Figure 4.12 Difference image between the two ciphered images using (a) the homomorphic
cryptosystem with the RC6 algorithm, (b) the RC6 algorithm, (c) the homomorphic cryptosystem with
the chaotic Baker map algorithm, and (d) the chaotic Baker map scrambling algorithm.
The test for effect of noise has been performed by adding additive white
Gaussian noise (AWGN) to the encrypted image prior to decryption.
Test results showed that the RC6 and the homomorphic algorithm
with RC6 were significantly affected by the noise in the decryption
process. In other words, these algorithms can only be used in error-
free scenarios. The experiment results are shown in Figures 4.13a
and 4.13b.
For the chaotic Baker map encryption and the homomorphic
encryption with the chaotic Baker map, the results showed that
these algorithms were more robust to noise and could work in noisy
environments. The experimental results are shown in Figures 4.13c
and 4.13d. It is clear that the chaotic Baker map decryption pro-
cess was more robust to noise than the RC6 decryption process,
and this appears in Figure 4.14, which shows the variation of the
peak signal-to-noise ratio (PSNR) of the decrypted image with the
signal-to-noise ratio (SNR) of the encrypted image for all algorithms.
This is attributed to the fact that the RC6 algorithm has a diffusion
mechanism in its equation f(x) = x(2x + 1)(mod 2w), which leads to
less noise immunity.
4.5 Summary
Figure 4.13 Decrypted images for all encryption algorithms in the presence of noise with an SNR
of 50 dB: (a) the RC6 algorithm; (b) the homomorphic cryptosystem with the RC6 algorithm; (c) the
chaotic Baker map algorithm; and (d) the homomorphic cryptosystem with the chaotic Baker map
scrambling algorithm.
60
Homomorphic encryption using RC6
Homomorphic encryption using chaotic Baker map
50 RC6
Chaotic Baker map
40
PSNR
30
20
10
0
0 5 10 15 20 25 30 35 40
SNR
Figure 4.14 The variation of the PSNR of the decrypted image with the SNR of the encrypted
image for all encryption algorithms.
www.allitebooks.com
5
C haotic I mag e E n cryp ti on
with D ifferent M od es
o f O per ation
5.1 Overview
f(1,1) f(1,N)
f(M,1) f(M,N)
P1 P2 Pw–1 Pw
P1 P2 P3 Pw–1 Pw
C0 = IV
E E E E E
C1 C2 C3 Cw– Cw
(a)
C0 = IV
EK EK EK EK
P1 P2 P3 Pw–1 Pw
C1 C2 C3 Cw–1 Cw
(b)
C0 = IV
EK EK EK EK
Pw–1
P1 P2 P3 Pw
C1 C2 C3 Cw–1 Cw
(c)
Figure 5.2 Chaotic encryption implemented in (a) CBC mode, (b) CFB mode, (c) OFB mode.
Figure 5.3 Encrypted images using traditional cryptosystems: (a) encrypted image using the
chaotic Baker map cryptosystem; (b) encrypted image using the RC6 cryptosystem.
C h ao tic Im ag e En c ry p ti o n 61
S1
S2
S3
S4
S5
Figure 5.4 Encrypted images using chaotic encryption with different modes of operation and
different block sizes.
Figure 5.5 Decrypted images using the traditional cryptosystems at SNR = 5 dB: (a) decrypted
image using the chaotic Baker map cryptosystem; (b) decrypted image using the RC6 cryptosystem.
S1
S2
S3
S4
S5
Figure 5.6 Decrypted images using the chaotic algorithm with different modes of operation and
different block sizes at SNR = 5 dB.
Table 5.1 Numerical Evaluation Metrics for All Cryptosystems
CHAOTIC ENCRYPTION WITH MODES OF OPERATION
CBC CFB OFB
TEST S1 S2 S3 S4 S5 S1 S2 S3 S4 S5 S1 S2 S3 S4 S5 ENCRYPTION RC6
D 0.71 0.72 0.71 0.71 0.72 0.71 0.71 0.71 0.72 0.71 0.71 0.71 0.7 0.67 0.66 0 0.71
rxye 1.4 × 4.7 × 1.3 × 1.7 × −2 × 3.7 × 1.5 × 2× −6.5 × 7.4 × −7.1 × 2.5 × 2.3 × 13.5 × 41.8 × 10−4 1.3 ×
10−3 10−6 10−3 10−3 10−3 10−3 10−3 10−3 10−3 10−4 10−3 10−4 10−3 10−3 10−3 10−3
DI 0.71 0.7 0.71 0.71 0.7 0.71 0.71 0.71 0.7 0.71 0.7 0.71 0.73 0.74 0.95 0.98 0.71
rxyd 0.57 0.57 0.57 0.57 0.57 0.57 0.57 0.57 0.57 0.56 0.7 0.7 0.7 0.7 0.69 0.87 2.5 ×
10−3
Note: Decryption was performed in the presence of an AWGN with SNR = 5 dB.
C h ao tic Im ag e En c ry p ti o n
63
64 Im ag e En c ry p ti o n
34
32
30 S1
S2
28 S3
26 S4
PSNR S5
24
22
20
18
16
14
0 5 10 15 20 25 30 35 40
SNR
(a)
34
32
S1
30 S2
28 S3
S4
26 S5
PSNR
24
22
20
18
16
14
0 5 10 15 20 25 30 35 40
SNR
(b)
40
S1
35 S2
S3
S4
30 S5
PSNR
25
20
15
0 5 10 15 20 25 30 35 40
SNR
(c)
Figure 5.7 Variation of the PSNR of the decrypted image with the SNR of the encrypted image
in the chaotic encryption with different modes of operation for (a) the CBC mode, (b) the CFB mode,
(c) the OFB mode.
3000 3000
2500 2500
Occurrence
Occurrence
2000 2000
1500 1500
1000 1000
500 500
0 0
2500
2000
Occurrence
1500
1000
500
Figure 5.8 Histograms of the original image and the encrypted images with the traditional
cryptosystems.
C h ao tic Im ag e En c ry p ti o n 67
Occurrence
Occurrence
1500 1500 1500
0 0 0
0 50 100 150 200 250 0 50 100 150 200 250 0 50 100 150 200 250
Gray Level Gray Level Gray Level
S1
2500 2500 2500
Occurrence
Occurrence
1500 1500 1500
0 0 0
0 50 100 150 200 250 0 50 100 150 200 250 0 50 100 150 200 250
Gray Level Gray Level Gray Level
S2
2500 2500 2500
Occurrence
Occurrence
1500 1500 1500
0 0 0
0 50 100 150 200 250 0 50 100 150 200 250 0 50 100 150 200 250
Gray Level Gray Level Gray Level
S3
2500 2500 2500
Occurrence
Occurrence
0 0 0
0 50 100 150 200 250 0 50 100 150 200 250 0 50 100 150 200 250
Gray Level Gray Level Gray Level
S4
2500 2500 2500
Occurrence
Occurrence
0 0 0
0 50 100 150 200 250 0 50 100 150 200 250 0 50 100 150 200 250
Gray Level Gray Level Gray Level
S5
Figure 5.9 Histograms of the encrypted images using chaotic encryption with different modes
of operation and different block sizes.
68 Im ag e En c ry p ti o n
4 S5
2
S4
1
S3 S2 S1
0
8 16 32 64 128
Block Size
(a)
6
Normalized Processing Time
4 S5
1 S4
S3 S2 S1
0
8 16 32 64 128
Block Size
(b)
6
Normalized Processing Time
4 S5
2
S4
1
S3 S2 S1
0
8 16 32 64 128
Block Size
(c)
Figure 5.10 The normalized processing time for the chaotic image encryption with different
modes and block sizes: (a) CBC mode; (b) CFB mode; (c) OFB mode.
5.5 Summary
6.1 Introduction
71
72 Im ag e En c ry p ti o n
(a)
(b)
Figure 6.1 The suggested mechanism for encryption and decryption in the ECB mode:
(a) encryption; (b) decryption.
The objective of the addition process is to make the byte values func-
tions of their positions in the data stream. This process helps in elimi-
nating identical plaintext blocks. A function of the byte position is
added to the byte value as follows:
where i is the position of the byte in the data stream, and B is the byte
value.
The function f(i) is used because it satisfies the following conditions:
Here, we test three functions to find the one that satisfies the
given conditions:
f3 (i ) = fix ( )
7 × (i + 13)5 mod 256 (6.5)
where the fix function is used to round the value of its argument
toward the lower nearest integer.
The functions have been tested for values from 1 to 1024, and the
results are given in Figure 6.2. The probability density functions
(PDFs) of the outputs of these functions are shown in Figure 6.3.
From these figures, we can see that f 3(i) gives a random, irregular,
and nonperiodic output with a uniform PDF.
The SPN is used to diffuse the bytes of the data together after the
addition step. First, the data are divided into blocks of n bits. This
network block size n is different from the encryption algorithm block
size w. After that, a chain of XOR operations is performed as shown
in Figure 6.4. The subkey K1 works as an initial key for the first XOR,
and then the result is XORed with the next block up to the end of the
plaintext. Each block resulting from this chain of XORs is permuted
bit-by-bit as shown in Figure 6.5. A block-based permutation is per-
formed after that. Finally, another chain of XORs is implemented
beginning with a subkey K 2.
300
250
200
150
f(i)
100
50
0
0 200 400 600 800 1000 1200
i
(a)
300
250
200
150
f(i)
100
50
0
0 200 400 600 800 1000 1200
i
(b)
300
250
200
150
f(i)
100
50
0
0 200 400 600 800 1000 1200
i
(c)
Figure 6.2 Variation of (a) f1(i), (b) f2(i), (c) f3(i) with i.
Diffusion is simply hiding the relation between the plaintext and the
ciphertext. If a small change in the plaintext (one bit) makes a large
change in the ciphertext (half of its bits), then the Avalanche effect
is evident, and the algorithm has a powerful diffusion mechanism
[105–110]. This is guaranteed if we can ensure that a bit change in
Dif f usi o n M ec h a nism f o r Data En c ry p ti o n 75
× 10–3
4
3
Probability
0
0 50 100 150 200 250 300
f(i)
(a)
0.05
0.04
Probability
0.03
0.02
0.01
0
0 50 100 150 200 250 300
f(i)
(b)
× 10–3
6
5
4
Probability
3
2
1
0
0 50 100 150 200 250 300
f(i)
(c)
Figure 6.3 PDFs of the outputs of (a) f1(i), (b) f2(i), (c) f3(i).
76 Im ag e En c ry p ti o n
S1 S2 Si SL
K1
Q1 Q2 Qi QL
Bit permutation Bit permutation Bit permutation Bit permutation
K2
Qi
b1 b2 bh–1 bh
bh bh–1 b2 b1
S´i
the plaintext will affect at least one bit in each block of the input to the
encryption algorithm, and the diffusion mechanism in the encryption
algorithm will propagate this change through each block.
From Figure 6.6, we can see that if a change takes place in an SPN
block (Si), all the network blocks from Q'L-i+1 to Q'L will be affected,
where L is the number of network blocks. The output odd-number
Dif f usi o n M ec h a nism f o r Data En c ry p ti o n 77
S1 S2 Si SL–1 SL
K1
Change free
block
Block with
change
K2
Figure 6.6 Diffusion effect of the SPN on the data blocks before encryption.
blocks from Q'1 to Q'i will also be affected. The even-number blocks
up to Q'i will not be affected due to performing XORs between the
same patterns.
To ensure the propagation of changes in each block of the encryp-
tion algorithm, a proper choice of the SPN block size n is half the
encryption algorithm block size w, (n/w = 0.5). Because w in the cases
of the Advanced Encryption Standard (AES) and the RC6 algorithms
is 128 bits, the network block size used should be 64 bits.
This network has the ability to propagate the changes made in the
addition part and diffuse the bytes of the data together.
K2
K1
P1 Pi–1 Pi Pi+1 Pm
Figure 6.7 The error propagation due to the inversion of the SPN effect in the decryption process.
were received correctly. So, there is a need for a trade-off between the
block dependency and the error propagation.
If an encrypted block was received in error, the application of the
decryption algorithm on this block will propagate the error in two
neighboring network blocks in different manners. This is attributed
to the randomization of the diffusion mechanism in the decryption
algorithm. If an error occurs in an intermediate encrypted block, the
error spreads over three decrypted blocks. If this error occurs in the
first or the last encrypted block, the error spreads over two decrypted
blocks only. This is shown in Figure 6.7, where the shaded blocks
refer to network blocks with different errors, and white blocks refer to
the absence of errors. Every decrypted block of size w is represented
by two network blocks. From this figure, we can see that the block
dependency is ensured, but the error propagation slightly increases
compared to the CBC mode.
Several experiments have been performed to test the effect of the sug-
gested mechanism on image encryption in the ECB mode. Both the
AES and RC6 algorithms have been used as the encryption algo-
rithms. The Cameraman image shown in Figure 6.8 has been used in
these experiments.
Dif f usi o n M ec h a nism f o r Data En c ry p ti o n 79
1000
900
800
700
Occurrence
600
500
400
300
200
100
6.4.2 Diffusion
The diffusion metrics NPCR, UACI, and the Avalanche effect metric
have been evaluated for three cases: changing a single bit in the first
pixel, changing a single bit in the midpixel, and changing a single
80 Im ag e En c ry p ti o n
(d) (e)
Figure 6.9 The Cameraman image encrypted with the AES in (a) ECB mode with preprocessing,
(b) ECB mode, (c) CBC mode, (d) CFB mode, (e) OFB mode.
(d) (e)
Figure 6.10 The Cameraman image encrypted with the RC6 algorithm in (a) ECB mode with
preprocessing, (b) ECB mode, (c) CBC mode, (d) CFB mode, (e) OFB mode.
Dif f usi o n M ec h a nism f o r Data En c ry p ti o n 81
600
500
400
Occurrence
300
200
100
600 600
500 500
400 400
Occurrence
200 200
100 100
0 0
600 600
500 500
400
Occurrence
400
Occurrence
300 300
200 200
100 100
0 0
0 50 100 150 200 250 0 50 100 150 200 250
Gray Scale Gray Scale
(d) (e)
bit in the last pixel. The results of the diffusion tests are shown in
Table 6.2. From this table, we can see that the diffusion between the
blocks of data depends mainly on the mode of operation, not on the
encryption algorithm. The ECB and OFB modes do not possess any
diffusion characteristics. The ECB mode with the preprocessing net-
work gives the best results, unlike the CBC and CFB modes, which
has low values in the Avalanche effect metric, with the changes occur-
ring close to the end of the data.
82 Im ag e En c ry p ti o n
600
500
400
Occurrence
300
200
100
(a)
600
600
500 500
400 400
Occurrence
Occurrence
300 300
200 200
100 100
0 0
(b) (c)
600 600
500 500
400 400
Occurrence
Occurrence
300 300
200 200
100 100
0 0
(d) (e)
An image with few details has a large amount of adjacent pixels with
similar values. Examples of these images are the medical image in
Figure 6.13 and the logo image in Figure 6.14.
The encrypted versions of the medical image and the logo image
with both the AES and the RC6 algorithm in the ECB mode with
and without the preprocessing network are shown in Figures 6.15
Table 6.1 Encryption Quality Results
RC6 AES
METRIC CBC CFB OFB ECB ECB WITH PREPROCESSING CBC CFB OFB ECB ECB WITH PREPROCESSING
DI 0.602 0.596 0.597 0.597 0.598 0.601 0.603 0.603 0.606 0.604
D 0.0513 0.0486 0.0503 0.0452 0.046 0.0485 0.0458 0.0472 0.052 0.048
Dif f usi o n M ec h a nism f o r Data En c ry p ti o n
83
84
Avalanche Bit in the first pixel 50.07 49.96 ≅0 0.01 50.03 50.08 49.99 ≅0 0.011 50.03
effect metric Bit in the middle pixel 25.11 25.04 ≅0 0.01 50.11 25.09 25.15 ≅0 0.012 50.08
Bit in the last pixel 0.01 ≅0 ≅0 0.01 50.04 0.014 ≅0 ≅0 0.011 50.08
Dif f usi o n M ec h a nism f o r Data En c ry p ti o n 85
(a) (b)
(c) (d)
Figure 6.15 The medical image encrypted with (a) the RC6 algorithm in the ECB mode, (b) the
AES in the ECB mode, (c) the RC6 algorithm in the ECB mode with preprocessing, (d) the AES in the
ECB mode with preprocessing.
(a) (b)
(c) (d)
Figure 6.16 The logo image encrypted with (a) the RC6 algorithm in the ECB mode, (b) the AES
in the ECB mode, (c) the RC6 algorithm in the ECB mode with preprocessing, (d) the AES in the ECB
mode with preprocessing.
Dif f usi o n M ec h a nism f o r Data En c ry p ti o n 87
×104
4
3.5
3
Occurrence
2.5
2
1.5
1
0.5
0
0 50 100 150 200 250
Gray Scale
(a)
9000 10000
9000
8000
8000
7000
7000
Occurrence
Occurrence
6000
6000
5000 5000
4000 4000
3000 3000
2000 2000
1000 1000
0 Gr
aySc
ale 0
0 50 100 150 200 250 0 50 100 150 200 250
Gray Scale Gray Scale
(b) (c)
2500
2500
2000
2000
Occurrence
Occurrence
1500
1500
1000 1000
500 500
0 0
0 50 100 150 200 250 0 50 100 150 200 250
Gray Scale Gray Scale
(d) (e)
Figure 6.17 The histograms of the medical image: (a) original, (b) encrypted with the RC6 algo-
rithm, (c) encrypted with the AES, (d) encrypted with the RC6 algorithm in the ECB mode with
preprocessing, (e) encrypted in AES in the ECB mode with preprocessing.
88 Im ag e En c ry p ti o n
8000
7000
6000
Occurrence
5000
4000
3000
2000
1000
0
0 50 100 150 200 250
Gray Scale
(a)
1800
1600 1600
1400 1400
1200 1200
Occurrence
Occurrence
1000 1000
800 800
600 600
400 400
200 200
0 0
0 50 100 150 200 250 0 50 100 150 200 250
Gray Scale Gray Scale
(b) (c)
600
600
500
500
Occurrence
400
Occurrence
400
300
300
200 200
100 100
0 0
0 50 100 150 200 250 0 50 100 150 200 250
Gray Scale Gray Scale
(d) (e)
Figure 6.18 The histograms of the logo image: (a) original, (b) encrypted with the RC6 algorithm,
(c) encrypted with the AES, (d) encrypted with the RC6 algorithm in the ECB mode with preprocess-
ing, (e) encrypted in AES in the ECB mode with preprocessing.
6.5 Summary
7.1 Introduction
89
90 Im ag e En c ry p ti o n
0.8
0.6
0.4
TX Power
0.2
–0.2
–0.4
–10 –8 –6 –4 –2 0 2 4 6 8 10
Frequency Carrier Spacing
The closer the subcarriers are spaced, the more susceptible the OFDM
signal is to Doppler spread, so the different transmission modes in dig-
ital audio broadcasting (DAB) and HDTV allow a trade-off between
the amount of multipath protection (length of the guard period) and
the Doppler spread tolerance [113].
The OFDM signal has the spectrum shown in Figure 7.1. In the
frequency domain, each OFDM subcarrier has several sinc-shaped
frequency responses. The sinc shape has a narrow main lobe with many
side lobes that decay slowly with the magnitude of the frequency shift
away from the center. Each carrier has a peak at the center frequency
and nulls evenly spaced with a frequency gap equal to the carrier spac-
ing [114,115].
signal from baseband. There are several ways of looking at what makes
the subcarriers in an OFDM signal orthogonal and why this prevents
interference between them [116–119].
7.2.1 Orthogonality
∫ s (t ) s (t ) dt = {
0
i j
c
0
i= j
i≠ j (7.1)
7.3.1 FFT-OFDM
N −1 j 2 πkn
∑
1
x (n ) = X (k)e N , 0 ≤ t ≤ Ts (7.5)
N k =0
7.3.2 DCT-OFDM
N −1
πk ( 2n + 1)
x (n ) =
2
N ∑ X ( k )β ( k ) cos
k=0
2N , p = 0,..., N − 1 (7.6)
where X(k) is the kth symbol of the input signal. β(k) can be written
as follows:
1
k=0 (7.7)
β( k ) = 2
1 k = 1, 2,......., N − 1
The OFDM requires a cyclic prefix to remove ISI. This causes over-
head, and this overhead may sometimes be too large for the system
to be effective. The use of the wavelet transform reduces the ISI and
ICI [138, 141,142]. The structure of the discrete wavelet transform
96 Im ag e En c ry p ti o n
x(n ) = ∑ X (k)ϕ(t − kT )
k=0
(7.8)
H0(z) 2 2 G0(z)
X(z) + Y(z)
H1(z) 2 2 G1(z)
1
X1(z) is converted to { X 1 ( z ) + X 1 ( − z )} .
2
Thus, the expression for Y(z) is given by [142]
1 1
Y (z) = { X 0 ( z ) + X 0 ( − z )}G 0 ( z ) + { X 1 ( z ) + X 1 ( − z )}G1 ( z )
2 2
1
= X ( z ) { H 0 ( z )G 0 ( z ) + H 1 ( z )G1 ( z )}
2
1
+ X ( − z ) { H 0 ( − z )G 0 ( z ) + H 1 ( − z )G1 ( z )} (7.9)
2
This needs to be true for all z, and because the odd powers of z in
P(z)cancel with those in P(−z), it requires that p 0 = 1 and pk = 0 for
all n even and nonzero. The polynomial P(z) should be a zero-phase
polynomial to minimize distortion. In general, P(z) is of the follow-
ing form [142]:
where
1
Z=
2
( )
z + z −1 (7.15)
The Haar wavelet uses the simplest possible Pt(Z) with a single zero
at Z = −1. It is represented as follows [142]:
1
Pt(Z) = 1 + Z and Z =
2
( )
z + z −1 (7.16)
Thus,
1 1
P(z ) =
2
( )
z + 2 + z −1 = ( z + 1) 1 + z −1
2
( )
= G0 ( z ) H 0 (z) (7.17)
1
H 0 (z) =
2
( )
1 + z −1 (7.18)
G 0(z) = (z + 1) (7.19)
Using Equation (7.10) with a = 1, we obtain
1 1
G1 ( z ) = zH 0 ( − z ) =
2
( )
z 1 − z −1 = ( z − 1) (7.20)
2
N1
2πn
=
2
N 1 + 1
∑ sin Nπn cos 2πf
n =1
1
d cos t
N 1
1
+ cos(2πf d t )
N1 + 1
Reflected
Paths
N1
2πn
+j
2
N1 ∑ sin Nπn cos 2πf
n =1
1
d cos t
N 1
(7.25)
where the wave number of the incoming wave is N0, and N1 is given by
N1 = 1/2((N0/2) – 1) (7.26)
i1 i0
= A (7.28)
q1 q0
10 2 Im ag e En c ry p ti o n
A= ( a11
a21
a12
a22 ) (7.29)
The channel matrix is Toplitz with a11 = a22 and a12 = −a21. To per-
form channel equalization, we need to estimate the matrix A−1 as
follows [130]:
A −1 = 2
a +a
11
1
2
12
( a11
− a12
a12
a11 ) (7.30)
1
a11 = a 22 =
i1 + q1
(i0i1 + q0q1 ) (7.31)
1
a 21 = − a12 =
i1 + q1
(q0i1 + i0q1 ) (7.32)
8.1 Introduction
OFDM has been adopted in the European digital audio and video
broadcasting radio system and is being investigated for broad-
band indoor wireless communications. Standards such as High-
Performance Radio Local-Area Network (HIPERLAN2), Institute
of Electrical and Electronics Engineers (IEEE) 802.11a, and IEEE
802.11g have emerged to support services based on the Internet
Protocol (IP). Such systems are based on OFDM and are designed to
operate in the 5-GHz band [147].
Unfortunately, OFDM communication systems have two
primary problems: the high sensitivity to carrier frequency o ffsets
(CFOs) and the high peak-to-average power ratio (PAPR). The
sensitivity to CFOs breaks the subcarriers’ orthogonality, and the
high PAPR requires system components with a wide linear range
to accommodate for the signal variations. Otherwise, nonlinear
d istortion, which results in a loss of subcarrier orthogonal-
ity and hence a degradation in the system performance, occurs
[148–152].
Researchers have proposed various methods to combat the
intercarrier interference (ICI in OFDM systems. The existing
approaches that have been developed to reduce ICI can be catego-
rized into frequency domain equalization, time domain windowing,
and self-cancellation (SC) schemes. In addition, statistical approaches
have been explored to estimate and cancel ICI. In this chapter, the
effects of CFO and PAPR problems are studied with solutions to these
problems and to reduce their effects on the transmitted encrypted
images.
10 3
10 4 Im ag e En c ry p ti o n
j 2πnε
y (n ) = i (n ) exp + w (n ) (8.1)
N
N −1
j2πnε
exp( ) w(n)
N
i(n) y(n)
sin( π(l + ε − k )) 1
S (l − k ) = exp( jπ(1 − )(l + ε − k )) (8.3)
N sin( π(l + ε − k ) / N ) N
N −1 j 2 πnk
x(n ) =
1
N ∑k=0
X ( k )e Ts
, 0 ≤ n ≤ N − 1 (8.4)
j 2 πmε
r (n ) = x(n )e N + w(n ) (8.5)
N −1 −2 πnk
R( k ) = ∑ r (n)e
n=0
N
(8.6)
10 6 Im ag e En c ry p ti o n
N −1 2 πmε −2 πnk
R( k ) = ∑ x(n)e
n=0
N N
e + W (k)
N −1 N −1 2 πn ( l +ε − k ) (8.7)
∑ X (l )∑ e
1
= N
+ W (k)
N l =0 n=0
∑e
1
can expand N
using the geometric series as follows
N n=0
[151–153]:
N −1 j 2 πn ( l −ε− k )
1 1 − e ( j 2 π ( l +ε− k ))
1
∑
N
e = j 2 π ( l +ε− k )
N N
n=0
1 − e N
(8.8)
1 sin( π(l − k + ε ))
= e ( jπ ( l +ε− k )(1−1/ N ))
N sin( π(l − k − ε ) / N )
We obtain [151–153]
N −1
sin( π(l − k + ε ))
S (l − k + ε ) = e ( jπ ( l +ε− k )(1−1/ N )) (8.10)
M sin( π(l − k − ε ) / N )
OFDM Limitati o ns 10 7
N −1
x(n ) =
2
N ∑ X (k)β(k)cos πk(22nN+ 1) ,
k=0
p = 0,..., N − 1 (8.11)
where X(k) is the kth symbol of the input signal. β(k) can be written
as follows:
1
k=0
β( k ) = 2 (8.12)
1 k = 1, 2,......., N − 1
1
S (l , k , ζ ) = β kβl [ φ(l + k − ζ) + φ(l − k − ζ)
2N
+φ(l + k + ζ) + φ(l − k + ζ)] (8.13)
+ j [ Γ(l + k − ζ ) + Γ(l − k − ζ )
2
πx
sin
2
Γ( x ) = (8.14)
πx
sin
2 N
πx πx
sin cos
2 2
φ( x ) = (8.15)
π x
sin
2 N
x(n ) = ∑ X (k)ϕ(t − kT )
k=0
(8.16)
where φ(t) is the wavelet basis functors. Some attempts have been
made to predict the CFO effect on DWT-OFDM, but, as of yet, no
closed-form expression has been presented for this task.
There are many techniques that were developed to compensate for the
CFO in multicarrier communication systems. In this chapter, the com-
pensation process is carried out in the time domain. Mathematically,
for the OFDM system, the received sequence is multiplied by a time
j 2 πnε
−
domain sequence e N before the FFT/DCT/DWT processing. The
compensated signal can be formulated as follows for AWGN [151–153]:
j 2 πnε j 2 πnε
− −
rc (n ) = e N r (n ) = x (n ) + e N w(n ) (8.17)
the initial channel estimate when the first OFDM symbol of the
superframe is received. This symbol represents the pilot symbol known
to the receiver. After receiving the first OFDM symbol, the estimator
switches to the tracking mode. The channel estimates are refined and
tracked according to the gradient algorithm.
255 2
PSNR = 10 log10 (8.18)
MSE
80
40
30
20
10
0
0 1 2 3 4 5 6 7 8 9 10
Eb/N0(dB)
Figure 8.2 PSNR versus Eb /N0 for chaotic-encrypted image transmission with OFDM system over
a Raleigh channel.
OFDM Limitati o ns 111
80
FFT with CFO
70 DCT with CFO
DWT with CFO
60 FFT with PSE
DCT with PSE
DWT with PSE
50
PSNR(dB)
40
30
20
10
0
0 1 2 3 4 5 6 7 8 9 10
Eb/N0(dB)
Figure 8.3 PSNR versus Eb /N0 for chaotic-OFB-encrypted image transmission with OFDM sys-
tem over a Raleigh fading channel.
Figure 8.6 gives the output of the FFT-OFDM system for the
transmission of the chaotic-encrypted image over an AWGN channel
at N = 128 and G = 32.
Figure 8.7 gives the output of the FFT-OFDM system for the
transmission of the chaotic-encrypted image over a fading channel at
N = 128 and G = 32.
Figure 8.8 gives the output of the DCT-OFDM system for the
transmission of the original Cameraman image over an AWGN
channel at N = 128 and G = 32.
Figure 8.9 gives the output of the DCT-OFDM system for the
transmission of the original Cameraman image over a fading channel
at N = 128 and G = 32.
OFDM Limitati o ns 113
PAPR =
Ppeak
=
max xm ( ) 2
, m = 0,1,......., N − 1 (8.20)
N
Pavg
1/ N xm
2
∑
m=0
the CDF itself. The CCDF of the PAPR denotes the probability that
the PAPR of a data block exceeds a given threshold. In [153], a simple
approximate expression was derived for the CCDF of the PAPR of
a multicarrier signal; the real and imaginary values of x(t) follow a
Gaussian distribution. The CDF of the amplitude z of an OFDM
signal sample is given by
F(z) = 1 − e−z (8.21)
We need to derive the CDF of the PAPR for an OFDM data
block. Assuming that the signal samples are mutually independent
and uncorrelated, the CDF of the PAPR for an OFDM data block
can be found as
P(PAPR ≤ z) = F(z)N = (1 − e−z)N (8.22)
118 Im ag e En c ry p ti o n
The assumption made that the signal samples are mutually inde-
pendent and uncorrelated is not true when oversampling is applied.
Also, this expression is not accurate for a small number of subcar-
riers because the Gaussian assumption does not hold in this case
[156–159]. It was shown that the PAPR of an oversampled signal for
N subcarriers is approximated by the distribution for αN subcarriers
without oversampling, where α is larger than 1 [160]. In other words,
the effect of oversampling is approximated by adding a certain num-
ber of extra signal samples.
The CDF of the PAPR of an oversampled signal is thus given by
Clipping is the simplest method that can limit the amplitude of the
signal to some desired threshold value. It is a nonlinear process and
may cause in-band distortion and out-of-band radiation. This leads
to degradation in the BER performance [162,163]. In the clipping
method, when the amplitude exceeds a certain threshold, it is hard
clipped, while the phase is saved. Namely, when we assume the phase
of the baseband OFDM signal xm is ϕm and the threshold is A, the
output signal after clipping will be given as follows:
xm > A (8.25)
Ae jφm
xm =
xm xm ≤ A
OFDM Limitati o ns 121
where
V max = max( xm ) m = 0,1,.....N − 1
where μ is the companding coefficient, xc is the companded sample,
and xm is the original sample. The expansion process is simply the
inverse of Equation (8.26):
∧ V max x ln(1 + µ )
xm = [exp( c − 1)]sgn( xc )
µ V max
OFDM Limitati o ns 12 3
∧
where x m is the estimated sample after expansion.
Several experiments were carried out to test the effect of the PAPR
reduction methods on the process of encrypted image transmission
with OFDM. The compared PAPR reduction methods are the clip-
ping, companding, and hybrid clipping-and-companding methods.
The performance of the process of chaotic image transmission with
encrypted (FFT/DCT/DWT)-OFDM systems having N = 128 and
G = 32 over an AWGN is shown in Figures 8.16 to 8.18. From these
figures, it is clear that the PSNR performance of the chaotic-encrypted
image transmission with FFT/DCT/DWT-OFDM is better with
µ = 0.1 than that with µ = 4 at Eb /N0 ≥ 10 dB. At high SNR values,
it is possible to receive the chaotic encrypted images with a very large
PSNR if error-correction codes are utilized.
The performance of the process of encrypted image transmission
using the chaotic-OFB algorithm with (FFT/DCT/DWT)-OFDM
systems over an AWGN is shown in Figures 8.19 to 8.21. From these
figures, it is clear that the PSNR performance of the chaotic-OFB-
encrypted image transmission with FFT/DCT/DWT-OFDM is
better with µ = 0.1 than with µ = 4 at Eb /N0 ≥ 10 dB. At high SNR
OFDM Limitati o ns 12 5
100
Without coding
90 With clipping
With companding at µ = 0.1
80 With clipping + companding at µ = 0.1
With companding at µ = 4
70 With clipping + companding at µ = 4
PSNR(dB)
60
50
40
30
20
10
0 1 2 3 4 5 6 7 8 9 10
Eb/N0(dB)
Figure 8.16 PSNR versus Eb /N0 for chaotic-encrypted image transmission with FFT-OFDM sys-
tem over an AWGN channel. Convolutional coding is applied with all cases except the first one.
100
90 Without coding
With clipping
With companding at µ = 0.1
80 With clipping + companding at µ = 0.1
With companding at µ = 4
70 With clipping + companding at µ = 4
PSNR(dB)
60
50
40
30
20
10
0 1 2 3 4 5 6 7 8 9 10
Eb/N0(dB)
Figure 8.17 PSNR versus Eb /N0 for chaotic-encrypted image transmission with DCT-OFDM sys-
tem over an AWGN channel. Convolutional coding is applied with all cases except the first one.
12 6 Im ag e En c ry p ti o n
100
Without coding
90 With clipping
With companding at µ = 0.1
80
With clipping + companding at µ = 0.1
70 With companding at µ = 4
With clipping + companding at µ = 4
60
PSNR(dB)
50
40
30
20
10
0
0 1 2 3 4 5 6 7 8 9 10
Eb/N0(dB)
Figure 8.18 PSNR versus Eb /N0 for chaotic-encrypted image transmission with DWT-OFDM sys-
tem over an AWGN channel. Convolutional coding is applied with all cases except the first one.
100
Without coding
90 With clipping
With companding at µ = 0.1
80 With clipping + companding at µ = 0.1
With companding at µ = 4
70
With clipping + companding at µ = 4
60
PSNR(dB)
50
40
30
20
10
0
0 1 2 3 4 5 6 7 8 9 10
Eb/N0(dB)
Figure 8.19 PSNR versus Eb /N0 for chaotic-OFB-encrypted image transmission with FFT-OFDM
system over an AWGN channel. Convolutional coding is applied with all cases except the first one.
OFDM Limitati o ns 12 7
100
Without coding
90 With clipping
With companding at μ = 0.1
80
With clipping + companding at μ = 0.1
With companding at μ = 4
70
With clipping + companding at μ = 4
60
PSNR(dB)
50
40
30
20
10
0
0 1 2 3 4 5 6 7 8 9 10
Eb/N0(dB)
Figure 8.20 PSNR versus Eb /N0 for chaotic-OFB-encrypted image transmission with DCT-OFDM
system over an AWGN channel. Convolutional coding is applied with all cases except the first one.
100
Without coding
90
With clipping
With companding at μ = 0.1
80
With clipping + companding at μ = 0.1
70 With companding at μ = 4
With clipping + companding at μ = 4
60
PSNR(dB)
50
40
30
20
10
0
0 1 2 3 4 5 6 7 8 9 10
Eb/N0(dB)
Figure 8.21 PSNR versus Eb /N0 for chaotic-OFB-encrypted image transmission with DWT-OFDM
system over an AWGN channel. Convolutional coding is applied with all cases except the first one.
12 8 Im ag e En c ry p ti o n
Let us consider the reception of one standard OFDM block that has
passed through a nonflat fading channel. After removing the guard
interval, the observation window size is To = NT where N is the number
of subcarriers, T is the sampling period at the transmitter, and 1/To is
the spacing between two adjacent subcarriers. Consequently, the con-
tinuous-time received signal y N( a ) (t ) is written as follows:
y N( a ) (t ) = ∑d
k ∈Z
N .k g ( a ) (t − kT ) + v ( a ) (t ) (8.27)
y N (n ) = ∑d
m ∈Z
N ,n −m g ( a ) (mT + nδT ) + v(n ) (8.28)
65
FFT+clock offset
60
DCT+clock offset
DWT+clock offset
55
FFT+clock offset+ZP
50 DCT+clock offset+ZP
DWT+clock offset+ZP
45
PSNR(dB)
40
35
30
25
20
15
0 1 2 3 4 5 6 7 8 9 10
Eb/N0(dB)
Figure 8.22 PSNR versus Eb /N0 for chaotic-encrypted image transmission with OFDM system
over a Raleigh fading channel.
45
FFT + clock offset
DCT + clock offset
40
DWT + clock offset
FFT + clock offset + ZP
DCT + clock offset + ZP
35
DWT + clock offset + ZP
PSNR (dB)
30
25
20
15
0 1 2 3 4 5 6 7 8 9 10
Eb/N0(dB)
Figure 8.23 PSNR versus Eb /N0 for chaotic-OFB-encrypted image transmission with OFDM
system over a Raleigh fading channel.
OFDM Limitati o ns 131
13 3
13 4 Im ag e En c ry p ti o n
80
Original image
70 Chaotic image encryption
DES image encryption
60 AES image encryption
RC6 image encryption
50
PSNR(dB)
40
30
20
10
0
0 1 2 3 4 5 6 7 8 9 10
Eb/N0(dB)
Figure 9.1 PSNR vs. Eb /N0 in the FFT-OFDM system for an AWGN channel with N = 64.
80
Original image
70 Chaotic image encryption
DES image encryption
60 AES image encryption
RC6 image encryption
50
PSNR(dB)
40
30
20
10
0
0 1 2 3 4 5 6 7 8 9 10
Eb/N0(dB)
Figure 9.2 PSNR versus Eb /N0 in the FFT-OFDM system for an AWGN channel with N = 512.
80
Original image
70 Chaotic image encryption
DES image encryption
60 AES image encryption
RC6 image encryption
50
PSNR(dB)
40
30
20
10
0
0 1 2 3 4 5 6 7 8 9 10
Eb/N0(dB)
Figure 9.3 PSNR versus Eb /N0 in the FFT-OFDM system for an AWGN channel with N = 1024.
13 6 Im ag e En c ry p ti o n
9.3
9.2
9.1
8.9
PSNR(dB)
8.8
8.7
Original image
8.6
Chaotic image encryption
8.5 DES image encryption
AES image encryption
8.4 RC6 image encryption
8.3
0 1 2 3 4 5 6 7 8 9 10
Eb/N0(dB)
Figure 9.4 PSNR versus Eb /N0 in the FFT-OFDM system for a Raleigh channel with N = 64 before
PSE and equalization.
11
10.5
Original image
10 Chaotic image encryption
DES image encryption
PSNR(dB)
8.5
8
0 1 2 3 4 5 6 7 8 9 10
Eb/N0(dB)
Figure 9.5 PSNR versus Eb /N0 in the FFT-OFDM system for a Raleigh channel with N = 512
before PSE and equalization.
Simul ati o n E x a m p l e s 13 7
11
10.5
10
PSNR(dB)
9.5
9
Original image
Chaotic image encryption
8.5 DES image encryption
AES image encryption
RC6 image encryption
8
0 1 2 3 4 5 6 7 8 9 10
Eb/N0(dB)
Figure 9.6 PSNR versus Eb /N0 in the FFT-OFDM system for a Raleigh channel with N = 1024
before PSE and equalization.
80
Original image
70 Chaotic image encryption
DES image encryption
60 AES image encryption
RC6 image encryption
50
PSNR(dB)
40
30
20
10
0
0 1 2 3 4 5 6 7 8 9 10
Eb/N0(dB)
Figure 9.7 PSNR versus Eb /N0 in the FFT-OFDM system for a Raleigh channel with N = 64 after
PSE and equalization.
13 8 Im ag e En c ry p ti o n
80
Original image
70 Chaotic image encryption
DES image encryption
60 AES image encryption
RC6 image encryption
50
PSNR(dB)
40
30
20
10
0
0 1 2 3 4 5 6 7 8 9 10
Eb/N0(dB)
Figure 9.8 PSNR versus Eb /N0 in the FFT-OFDM system for a Raleigh channel with N = 512 after
PSE and equalization.
80
Original image
70 Chaotic image encryption
DES image encryption
60 AES image encryption
RC6 image encryption
50
PSNR(dB)
40
30
20
10
0
0 1 2 3 4 5 6 7 8 9 10
Eb/N0(dB)
Figure 9.9 PSNR versus Eb /N0 in the FFT-OFDM system for a Raleigh channel with N = 1024
after PSE and equalization.
Simul ati o n E x a m p l e s 13 9
50
PSNR(dB)
40
30
20
10
0
0 1 2 3 4 5 6 7 8 9 10
Eb/N0(dB)
Figure 9.10 PSNR versus Eb /N0 in the FFT-OFDM system for an AWGN channel with G = 0.
80
Original image
70 Chaotic image encryption
DES image encryption
60 AES image encryption
RC6 image encryption
50
PSNR(dB)
40
30
20
10
0
0 1 2 3 4 5 6 7 8 9 10
Eb/N0(dB)
Figure 9.11 PSNR versus Eb /N0 in the FFT-OFDM system for an AWGN channel with G = 16.
14 0 Im ag e En c ry p ti o n
80
Original image
70 Chaotic image encryption
DES image encryption
60 AES image encryption
RC6 image encryption
50
PSNR(dB)
40
30
20
10
0
0 1 2 3 4 5 6 7 8 9 10
Eb/N0(dB)
Figure 9.12 PSNR versus Eb /N0 in the FFT-OFDM system for an AWGN channel with G = 32.
11
Original image
10.5 Chaotic image encryption
DES image encryption
AES image encryption
10 RC6 image encryption
PSNR(dB)
9.5
8.5
8
0 1 2 3 4 5 6 7 8 9 10
Eb/N0(dB)
Figure 9.13 PSNR versus Eb /N0 in the FFT-OFDM system for a Raleigh channel with G = 0 with-
out PSE and equalization.
11
Original image
10.5 Chaotic image encryption
DES image encryption
AES image encryption
10 RC6 image encryption
PSNR(dB)
9.5
8.5
8
0 1 2 3 4 5 6 7 8 9 10
Eb/N0(dB)
Figure 9.14 PSNR versus Eb /N0 in the FFT-OFDM system for a Raleigh channel with G = 16
without PSE and equalization.
14 2 Im ag e En c ry p ti o n
11
Original image
10.5 Chaotic image encryption
DES image encryption
AES image encryption
10 RC6 image encryption
PSNR(dB)
9.5
8.5
8
0 1 2 3 4 5 6 7 8 9 10
Eb/N0(dB)
Figure 9.15 PSNR versus Eb /N0 in the FFT-OFDM system for a Raleigh channel with G = 32
without PSE and equalization.
80
Original image
70 Chaotic image encryption
DES image encryption
60 AES image encryption
RC6 image encryption
50
PSNR(dB)
40
30
20
10
0
0 1 2 3 4 5 6 7 8 9 10
Eb/N0(dB)
Figure 9.16 PSNR versus Eb /N0 in the FFT-OFDM system for a Raleigh channel with G = 0 with
PSE and equalization.
Simul ati o n E x a m p l e s 14 3
80
Original image
70 Chaotic image encryption
DES image encryption
60 AES image encryption
RC6 image encryption
50
PSNR(dB)
40
30
20
10
0
0 1 2 3 4 5 6 7 8 9 10
Eb/N0(dB)
Figure 9.17 PSNR versus Eb /N0 in the FFT-OFDM system for a Raleigh channel with G = 16 with
PSE and equalization.
80
Original image
70 Chaotic image encryption
DES image encryption
60 AES image encryption
RC6 image encryption
50
PSNR(dB)
40
30
20
10
0
0 1 2 3 4 5 6 7 8 9 10
Eb/N0(dB)
Figure 9.18 PSNR versus Eb /N0 in the FFT-OFDM system for a Raleigh channel with G = 32 with
PSE and equalization.
14 4 Im ag e En c ry p ti o n
9.3
9.2
9.1
8.5
8.4
8.3
0 1 2 3 4 5 6 7 8 9 10
Eb/N0(dB)
Figure 9.19 PSNR versus Eb /N0 in the FFT-OFDM system with ZP and hybrid G for a Raleigh
channel with N = 128 and G = 32 without PSE and equalization.
Simul ati o n E x a m p l e s 14 5
80
Original with HGI
70 Chaotic with HGI
DES with HGI
AES with HGI
60
RC6 with HGI
Original with ZP
50 Chaotic with ZP
DES with ZP
PSNR(dB)
AES with ZP
40 RC6 with ZP
30
20
10
0
0 1 2 3 4 5 6 7 8 9 10
Eb/N0(dB)
Figure 9.20 PSNR versus Eb /N0 in the FFT-OFDM system with ZP and HGI for a Raleigh channel
with N = 128 and G = 32 with PSE and equalization.
Figure 9.25 gives the output of the FFT-OFDM system for the
transmission of the DES-encrypted image over an AWGN channel
at N = 128 and G = 32.
Figure 9.26 gives the output of the FFT-OFDM system for the
transmission of the DES-encrypted image over a fading channel at
N = 128 and G = 32.
Figure 9.27 gives the output of the FFT-OFDM system for the
transmission of the AES-encrypted image over an AWGN channel
at N = 128 and G = 32.
Figure 9.28 gives the output of the FFT-OFDM system for the
transmission of the AES-encrypted image over a fading channel at
N = 128 and G = 32.
Simul ati o n E x a m p l e s 147
Figure 9.29 gives the output of the FFT-OFDM system for the
transmission of the RC6-encrypted image over an AWGN channel
at N = 128 and G = 32.
Figure 9.30 gives the output of the FFT-OFDM system for the
transmission of the RC6-encrypted image over a fading channel at
N = 128 and G = 32.
Figures 9.31 to 9.33 illustrate the variation of the PSNR of a
decrypted image with the SNR in the channel (Eb /N0) for the DCT-
OFDM system with different encryption algorithms in an AWGN
channel for different numbers of subcarriers. These figures show that
as the number of subcarriers is increased, the quality of the decrypted
images improved.
14 8 Im ag e En c ry p ti o n
system at G = 0 are the best compared with those with G = 16 and 32.
The chaotic-encrypted image gives the best PSNR values.
Figures 9.43 to 9.45 illustrate the variation of the PSNR with
the Eb /N0 for the DCT-OFDM with G = [0, 16, 32], with different
encryption algorithms in a frequency-selective channel. Without PSE,
it is shown that fading disrupts the PSNR performance of the DCT-
OFDM system, regardless of the encryption algorithm. However,
Figures 9.46 to 9.48 show that, with PSE, the PSNR performances of
all systems were better than those without PSE.
The different types of guard intervals were studied. A comparison
study between the HGI, which is composed of a CP and zero samples,
and the ZP guard interval with the different encryption algorithms in
a frequency-selective channel is illustrated in Figures 9.49 and 9.50.
15 0 Im ag e En c ry p ti o n
80
Original image
70 Chaotic image encryption
DES image encryption
60 AES image encryption
RC6 image encryption
50
PSNR(dB)
40
30
20
10
0
0 1 2 3 4 5 6 7 8 9 10
Eb/N0(dB)
Figure 9.31 PSNR versus Eb /N0 in the DCT-OFDM system for an AWGN channel with N = 64.
80
Original image
70 Chaotic image encryption
DES image encryption
60 AES image encryption
RC6 image encryption
50
PSNR(dB)
40
30
20
10
0
0 1 2 3 4 5 6 7 8 9 10
Eb/N0(dB)
Figure 9.32 PSNR versus Eb /N0 in the DCT-OFDM system for an AWGN channel with N = 512.
15 6 Im ag e En c ry p ti o n
80
Original image
70 Chaotic image encryption
DES image encryption
60 AES image encryption
RC6 image encryption
50
PSNR(dB)
40
30
20
10
0
0 1 2 3 4 5 6 7 8 9 10
Eb/N0(dB)
Figure 9.33 PSNR versus Eb /N0 in the DCT-OFDM system for an AWGN channel with N = 1024.
11
Original image
10.5 Chaotic image encryption
DES image encryption
AES image encryption
10 RC6 image encryption
PSNR(dB)
9.5
8.5
8
0 1 2 3 4 5 6 7 8 9 10
Eb/N0(dB)
Figure 9.34 PSNR versus Eb /N0 in the DCT-OFDM system for a Raleigh channel with N = 64
without PSE and equalization.
Simul ati o n E x a m p l e s 15 7
11
Original image
Chaotic image encryption
10.5 DES image encryption
AES image encryption
RC6 image encryption
10
PSNR(dB)
9.5
8.5
8
0 1 2 3 4 5 6 7 8 9 10
Eb/N0(dB)
Figure 9.35 PSNR versus Eb /N0 in the DCT-OFDM system for a Raleigh channel with N = 512
without PSE and equalization.
11
Original image
Chaotic image encryption
10.5 DES image encryption
AES image encryption
RC6 image encryption
10
PSNR(dB)
9.5
8.5
8
0 1 2 3 4 5 6 7 8 9 10
Eb/N0(dB)
Figure 9.36 PSNR versus Eb /N0 in the DCT-OFDM system for a Raleigh channel with N = 1024
without PSE and equalization.
15 8 Im ag e En c ry p ti o n
80
Original image
70 Chaotic image encryption
DES image encryption
60 AES image encryption
RC6 image encryption
50
PSNR(dB)
40
30
20
10
0
0 1 2 3 4 5 6 7 8 9 10
Eb/N0(dB)
Figure 9.37 PSNR versus Eb /N0 in the DCT-OFDM system for a Raleigh channel with N = 64 with
PSE and equalization.
80
Original image
70 Chaotic image encryption
DES image encryption
60 AES image encryption
RC6 image encryption
50
PSNR(dB)
40
30
20
10
0
0 1 2 3 4 5 6 7 8 9 10
Eb/N0(dB)
Figure 9.38 PSNR versus Eb /N0 in the DCT-OFDM system for a Raleigh channel with N = 512
with PSE and equalization.
Simul ati o n E x a m p l e s 15 9
80
Original image
70 Chaotic image encryption
DES image encryption
60 AES image encryption
RC6 image encryption
50
PSNR(dB)
40
30
20
10
0
0 1 2 3 4 5 6 7 8 9 10
Eb/N0(dB)
Figure 9.39 PSNR versus Eb /N0 in the DCT-OFDM system for a Raleigh channel with N = 1024
with PSE and equalization.
80
Original image
70 Chaotic image encryption
DES image encryption
60 AES image encryption
RC6 image encryption
50
PSNR(dB)
40
30
20
10
0
0 1 2 3 4 5 6 7 8 9 10
Eb/N0(dB)
Figure 9.40 PSNR versus Eb /N0 in the DCT-OFDM system for an AWGN channel with G = 0.
16 0 Im ag e En c ry p ti o n
80
Original image
70 Chaotic image encryption
DES image encryption
AES image encryption
60
RC6 image encryption
50
PSNR(dB)
40
30
20
10
0
0 1 2 3 4 5 6 7 8 9 10
Eb/N0(dB)
Figure 9.41 PSNR versus Eb /N0 in the DCT-OFDM system for an AWGN channel with G = 16.
80
Original image
70 Chaotic image encryption
DES image encryption
60 AES image encryption
RC6 image encryption
50
PSNR(dB)
40
30
20
10
0
0 1 2 3 4 5 6 7 8 9 10
Eb/N0(dB)
Figure 9.42 PSNR versus Eb /N0 in the DCT-OFDM system for an AWGN channel with G = 32.
Simul ati o n E x a m p l e s 161
11
Original image
Chaotic image encryption
10.5 DES image encryption
AES image encryption
RC6 image encryption
10
PSNR(dB)
9.5
8.5
8
0 1 2 3 4 5 6 7 8 9 10
Eb/N0(dB)
Figure 9.43 PSNR versus Eb /N0 in the DCT-OFDM system for a Raleigh channel with G = 0
without PSE and equalization.
11
Original image
Chaotic image encryption
10.5 DES image encryption
AES image encryption
RC6 image encryption
10
PSNR(dB)
9.5
8.5
8
0 1 2 3 4 5 6 7 8 9 10
Eb/N0(dB)
Figure 9.44 PSNR versus Eb /N0 in the DCT-OFDM system for a Raleigh channel with G = 16
without PSE and equalization.
16 2 Im ag e En c ry p ti o n
11
Original image
Chaotic image encryption
10.5 DES image encryption
AES image encryption
RC6 image encryption
10
PSNR(dB)
9.5
8.5
8
0 1 2 3 4 5 6 7 8 9 10
Eb/N0(dB)
Figure 9.45 PSNR versus Eb /N0 in the DCT-OFDM system for a Raleigh channel with G = 32
without PSE and equalization.
80
Original image
70 Chaotic image encryption
DES image encryption
AES image encryption
60
RC6 image encryption
50
PSNR(dB)
40
30
20
10
0
0 1 2 3 4 5 6 7 8 9 10
Eb/N0(dB)
Figure 9.46 PSNR versus Eb /N0 in the DCT-OFDM system for a Raleigh channel with G = 0 with
PSE and equalization.
Simul ati o n E x a m p l e s 16 3
80
Original image
70 Chaotic image encryption
DES image encryption
AES image encryption
60
RC6 image encryption
50
PSNR(dB)
40
30
20
10
0
0 1 2 3 4 5 6 7 8 9 10
Eb/N0(dB)
Figure 9.47 PSNR versus Eb /N0 in the DCT-OFDM system for a Raleigh channel with G = 16 with
PSE and equalization.
80
Original image
70 Chaotic image encryption
DES image encryption
AES image encryption
60
RC6 image encryption
50
PSNR(dB)
40
30
20
10
0
0 1 2 3 4 5 6 7 8 9 10
Eb/N0(dB)
Figure 9.48 PSNR versus Eb /N0 in the DCT-OFDM system for a Raleigh channel with G = 32 with
PSE and equalization.
16 4 Im ag e En c ry p ti o n
9.3
9.2
9.1
8.9
PSNR(dB)
8.8
Original with HGI
8.7 Chaotic with HGI
DES with HGI
8.6 AES with HGI
RC6 with HGI
8.5 Original with ZP
Chaotic with ZP
DES with ZP
8.4 AES with ZP
RC6 with ZP
8.3
0 1 2 3 4 5 6 7 8 9 10
Eb/N0(dB)
Figure 9.49 PSNR versus Eb /N0 in the DCT-OFDM system with ZP and HGI for a Raleigh channel
with N = 128 and G = 32 without PSE and equalization.
80
AES with ZP
40
RC6 with ZP
30
20
10
0
0 1 2 3 4 5 6 7 8 9 10
Eb/N0(dB)
Figure 9.50 PSNR versus Eb /N0 in the DCT-OFDM system with ZP and HGI for a Raleigh channel
with N = 128 and G = 32 with PSE and equalization.
Simul ati o n E x a m p l e s 16 5
PSE and equalization, it is shown that fading disrupts the PSNR per-
formance of the DWT-OFDM systems regardless of the encryption
algorithm. However, Figures 9.76 to 9.78 show that, with PSE and
equalization, the PSNR performances of all systems were better than
those without PSE and equalization.
The DES, AES, and RC6 provide lower PSNR performance for
the DWT-OFDM system than the chaotic algorithm because these
algorithms have a diffusion mechanism that highly reduces the noise
immunity. On the other hand, the chaotic algorithm was more robust
to noise.
The different types of guard intervals were studied. A comparison
study between the HGI and the ZP guard interval with the different
encryption algorithms in a frequency-selective channel is illustrated
16 6 Im ag e En c ry p ti o n
Figure 9.91 illustrates the variation of the PSNR with the Eb/N0 for
the FFT-OFDM, DCT-OFDM, and DWT-OFDM systems with
different encryption algorithms. A symbol rate of 250,000 symbols
per second, ε = 0.1, N = 128, and AWGN channel are assumed. This
figure shows that the PSNR performance of all systems with different
encryption algorithms deteriorates due to the presence of the CFO
because the CFO disrupts the orthogonality between subcarriers and
gives rise to the intercarrier interference (ICI), which leads to perfor-
mance degradation. This figure also shows that the CFO compensa-
tion process can avoid the impact of the CFO and produce high-quality
17 0 Im ag e En c ry p ti o n
were the best compared with those of the DCT-OFDM and DWT-
OFDM systems.
The DES, AES, and RC6 provide lower PSNR p erformance for
all OFDM systems compared with the chaotic algorithm because
these algorithms have a diffusion mechanism that reduces the noise
immunity. On the other hand, the chaotic algorithm is more robust
to noise.
80
Original image
70 Chaotic image encryption
DES image encryption
60 AES image encryption
RC6 image encryption
50
PSNR(dB)
40
30
20
10
0
0 1 2 3 4 5 6 7 8 9 10
Eb/N0(dB)
Figure 9.61 PSNR versus Eb /N0 in the DWT-OFDM system for an AWGN channel with N = 64.
Simul ati o n E x a m p l e s 17 5
80
Original image
70 Chaotic image encryption
DES image encryption
AES image encryption
60
RC6 image encryption
50
PSNR(dB)
40
30
20
10
0
0 1 2 3 4 5 6 7 8 9 10
Eb/N0(dB)
Figure 9.62 PSNR versus Eb /N0 in the DWT-OFDM system for an AWGN channel with N = 512.
80
Original image
70 Chaotic image encryption
DES image encryption
60 AES image encryption
RC6 image encryption
50
PSNR(dB)
40
30
20
10
0
0 1 2 3 4 5 6 7 8 9 10
Eb/N0(dB)
Figure 9.63 PSNR versus Eb /N0 in the DWT-OFDM system for an AWGN channel with N = 1024.
17 6 Im ag e En c ry p ti o n
11
Original image
10.5 Chaotic image encryption
DES image encryption
AES image encryption
10 RC6 image encryption
PSNR(dB)
9.5
8.5
8
0 1 2 3 4 5 6 7 8 9 10
Eb/N0(dB)
Figure 9.64 PSNR versus Eb /N0 in the DWT-OFDM system for a Raleigh channel with N = 64
without PSE and equalization.
11
10.5
10 Original image
Chaotic image encryption
PSNR(dB)
8.5
8
0 1 2 3 4 5 6 7 8 9 10
Eb/N0(dB)
Figure 9.65 PSNR versus Eb /N0 in the DWT-OFDM system for a Raleigh channel with N = 512
without PSE and equalization.
Simul ati o n E x a m p l e s 17 7
11
10.5
10
PSNR(dB)
9.5
9
Original image
Chaotic image encryption
8.5 DES image encryption
AES image encryption
RC6 image encryption
8
0 1 2 3 4 5 6 7 8 9 10
Eb/N0(dB)
Figure 9.66 PSNR versus Eb /N0 in the DWT-OFDM system for a Raleigh channel with N = 1024
without PSE and equalization.
80
Original image
70 Chaotic image encryption
DES image encryption
AES image encryption
60 RC6 image encryption
50
PSNR(dB)
40
30
20
10
0
0 1 2 3 4 5 6 7 8 9 10
Eb/N0(dB)
Figure 9.67 PSNR versus Eb /N0 in the DWT-OFDM system for a Raleigh channel with N = 64
with PSE and equalization.
178 Im ag e En c ry p ti o n
80
Original image
70 Chaotic image encryption
DES image encryption
60 AES image encryption
RC6 image encryption
50
PSNR(dB)
40
30
20
10
0
0 1 2 3 4 5 6 7 8 9 10
Eb/N0(dB)
Figure 9.68 PSNR versus Eb /N0 in the DWT-OFDM system for a Raleigh channel with N = 512
with PSE and equalization.
80
Original image
70 Chaotic image encryption
DES image encryption
60 AES image encryption
RC6 image encryption
50
PSNR(dB)
40
30
20
10
0
0 1 2 3 4 5 6 7 8 9 10
Eb/N0(dB)
Figure 9.69 PSNR versus Eb /N0 in the DWT-OFDM system for a Raleigh channel with N = 1024
with PSE and equalization.
Simul ati o n E x a m p l e s 179
80
Original image
70 Chaotic image encryption
DES image encryption
60 AES image encryption
RC6 image encryption
50
PSNR(dB)
40
30
20
10
0
0 1 2 3 4 5 6 7 8 9 10
Eb/N0(dB)
Figure 9.70 PSNR versus Eb /N0 in the DWT-OFDM system for an AWGN channel with G = 0.
80
Original image
70 Chaotic image encryption
DES image encryption
60 AES image encryption
RC6 image encryption
50
PSNR(dB)
40
30
20
10
0
0 1 2 3 4 5 6 7 8 9 10
Eb/N0(dB)
Figure 9.71 PSNR versus Eb /N0 in the DWT-OFDM system for an AWGN channel with G = 16.
18 0 Im ag e En c ry p ti o n
80
Original image
70 Chaotic image encryption
DES image encryption
60 AES image encryption
RC6 image encryption
50
PSNR(dB)
40
30
20
10
0
0 1 2 3 4 5 6 7 8 9 10
Eb/N0(dB)
Figure 9.72 PSNR versus Eb /N0 in the DWT-OFDM system for an AWGN channel with G = 32.
11
Original image
10.5
Chaotic image encryption
DES image encryption
AES image encryption
10
RC6 image encryption
PSNR(dB)
9.5
8.5
8
0 1 2 3 4 5 6 7 8 9 10
Eb/N0(dB)
Figure 9.73 PSNR versus Eb /N0 in the DWT-OFDM system for a Raleigh channel with G = 0
without PSE and equalization.
Simul ati o n E x a m p l e s 181
11
Original image
Chaotic image encryption
10.5 DES image encryption
AES image encryption
RC6 image encryption
10
PSNR(dB)
9.5
8.5
8
0 1 2 3 4 5 6 7 8 9 10
Eb/N0(dB)
Figure 9.74 PSNR versus Eb /N0 in the DWT-OFDM system for a Raleigh channel with G = 16
without PSE and equalization.
11
Original image
Chaotic image encryption
10.5 DES image encryption
AES image encryption
RC6 image encryption
10
PSNR(dB)
9.5
8.5
8
0 1 2 3 4 5 6 7 8 9 10
Eb/N0(dB)
Figure 9.75 PSNR versus Eb /N0 in the DWT-OFDM system for a Raleigh channel with G = 32
without PSE and equalization.
18 2 Im ag e En c ry p ti o n
80
Original image
70 Chaotic image encryption
DES image encryption
60 AES image encryption
RC6 image encryption
50
PSNR(dB)
40
30
20
10
0
0 1 2 3 4 5 6 7 8 9 10
Eb/N0(dB)
Figure 9.76 PSNR versus Eb /N0 in the DWT-OFDM system for a Raleigh channel with G = 0 with
PSE and equalization.
80
Original image
70 Chaotic image encryption
DES image encryption
60 AES image encryption
RC6 image encryption
50
PSNR(dB)
40
30
20
10
0
0 1 2 3 4 5 6 7 8 9 10
Eb/N0(dB)
Figure 9.77 PSNR versus Eb /N0 in the DWT-OFDM system for a Raleigh channel with G = 16 with
PSE and equalization.
Simul ati o n E x a m p l e s 18 3
80
Original image
50
PSNR(dB)
40
30
20
10
0
0 1 2 3 4 5 6 7 8 9 10
Eb/N0(dB)
Figure 9.78 PSNR versus Eb /N0 in the DWT-OFDM system for a Raleigh channel with G = 32 with
PSE and equalization.
11
Original with HIG
Chaotic with HIG
10.5 DES with HIG
AES with HIG
RC6 with HIG
Original with ZP
10
Chaotic with ZP
DES with ZP
PSNR(dB)
AES with ZP
9.5 RC6 with ZP
8.5
8
0 1 2 3 4 5 6 7 8 9 10
Eb/N0(dB)
Figure 9.79 PSNR versus Eb /N0 in the DWT-OFDM system with ZP and HGI for a Raleigh channel
with N = 128 and G = 32 without PSE and equalization.
18 4 Im ag e En c ry p ti o n
80
Original with HIG
Chaotic with HIG
70
DES with HIG
AES with HIG
60 RC6 with HIG
Original with ZP
Chaotic with ZP
50
DES with ZP
PSNR(dB)
AES with ZP
40 RC6 with ZP
30
20
10
0
0 1 2 3 4 5 6 7 8 9 10
Eb/N0(dB)
Figure 9.80 PSNR versus Eb /N0 in the DWT-OFDM system with ZP and HGI for a Raleigh channel
with N = 128 and G = 32 with PSE and equalization.
Several experiments were carried out to test the effect of the PAPR
reduction methods on the process of encrypted image transmission
with OFDM. A convolutional code with rate 1/2, constraint length
7, and octal generator polynomial (133,171) are adopted to reduce
the effect of PAPR reduction on the quality of received images. The
compared PAPR reduction methods are clipping, companding, and
hybrid clipping-and-companding methods.
The performance of the process of original image transmission with
the chaotic algorithm and three different diffusion algorithms for
(FFT/DCT/DWT)-OFDM systems with N = 128 and G = 32 over
an AWGN is shown in Figures 9.130 to 9.132. From these figures, it
18 8 Im ag e En c ry p ti o n
90
Original image with CFO compensation
80 Chaotic encryption with CFO compensation
DES encryption with CFO compensation
AES encryption with CFO compensation
70
RC6 encryption with CFO compensation
Original without CFO compensation
60 Chaotic encryption without CFO compensation
DES encryption without CFO compensation
PSNR(dB)
30
20
10
0
0 1 2 3 4 5 6 7 8 9 10
Eb/N0(dB)
(a) FFT-OFDM system.
90
Original image with CFO compensation
80 Chaotic encryption with CFO compensation
DES encryption with CFO compensation
AES encryption with CFO compensation
70
RC6 encryption with CFO compensation
Original without CFO compensation
60 Chaotic encryption without CFO compensation
DES encryption without CFO compensation
PSNR(dB)
30
20
10
0
0 1 2 3 4 5 6 7 8 9 10
Eb/N0(dB)
(b) DCT-OFDM system.
Figure 9.91 Variation of the PSNR of the decrypted image with the Eb /N0 in AWGN channel: (a)
FFT-OFDM system; (b) DCT-OFDM system.
19 6 Im ag e En c ry p ti o n
90
Original image with CFO compensation
80 Chaotic encryption with CFO compensation
DES encryption with CFO compensation
AES encryption with CFO compensation
70
RC6 encryption with CFO compensation
Original without CFO compensation
60 Chaotic encryption without CFO compensation
DES encryption without CFO compensation
PSNR(dB)
30
20
10
0
0 1 2 3 4 5 6 7 8 9 10
Eb/N0(dB)
Figure 9.91 (Continued) Variation of the PSNR of the decrypted image with the Eb /N0 in AWGN
channel: DWT-OFDM system.
9.3
9.2
9.1
9 Original image
Chaotic image encryption
8.9 DES image encryption
PSNR(dB)
8.7
8.6
8.5
8.4
8.3
0 1 2 3 4 5 6 7 8 9 10
Eb/N0(dB)
Figure 9.92 PSNR versus Eb /N0 in the FFT-OFDM system for a Raleigh channel with fd =300 Hz
without CFO compensation.
Simul ati o n E x a m p l e s 19 7
90
80 Original image
Chaotic image encryption
70 DES image encryption
AES image encryption
60 RC6 image encryption
PSNR(dB)
50
40
30
20
10
0
0 1 2 3 4 5 6 7 8 9 10
Eb/N0(dB)
Figure 9.93 PSNR versus Eb /N0 in the FFT-OFDM system for a Raleigh channel with fd = 300 Hz
with CFO compensation.
9.3
9.2
9.1
8.9
PSNR(dB)
8.8
8.7
Original image
8.6
Chaotic image encryption
8.5 DES image encryption
AES image encryption
8.4 RC6 image encryption
8.3
0 1 2 3 4 5 6 7 8 9 10
Eb/N0(dB)
Figure 9.94 PSNR versus Eb /N0 in the DCT-OFDM system for a Raleigh channel with fd = 300 Hz
without CFO compensation.
19 8 Im ag e En c ry p ti o n
90
80 Original image
Chaotic image encryption
70 DES image encryption
AES image encryption
60 RC6 image encryption
PSNR(dB)
50
40
30
20
10
0
0 1 2 3 4 5 6 7 8 9 10
Eb/N0(dB)
Figure 9.95 PSNR versus Eb /N0 in the DCT-OFDM system for a Raleigh channel with fd = 300 Hz
with CFO compensation.
9.3
9.2
9.1
8.9
PSNR(dB)
8.8
8.7
8.3
0 1 2 3 4 5 6 7 8 9 10
Eb/N0(dB)
Figure 9.96 PSNR versus Eb /N0 in the DWT-OFDM system for a Raleigh channel with fd = 300 Hz
without CFO compensation.
Simul ati o n E x a m p l e s 19 9
90
80 Original image
Chaotic image encryption
70 DES image encryption
AES image encryption
60 RC6 image encryption
PSNR(dB)
50
40
30
20
10
0
0 1 2 3 4 5 6 7 8 9 10
Eb/N0(dB)
Figure 9.97 PSNR versus Eb /N0 in the DWT-OFDM system for a Raleigh channel with fd = 300 Hz
with CFO compensation.
80
Chaotic-ECB mode
70
Chaotic-CFB mode
Chaotic-CBC mode
60 Chaotic-OFB mode
50
PSNR(dB)
40
30
20
10
0
0 1 2 3 4 5 6 7 8 9 10
Eb/N0(dB)
Figure 9.98 PSNR versus Eb /N0 in the FFT-OFDM system for an AWGN channel with N = 128
and G = 32.
200 Im ag e En c ry p ti o n
80
70 Chaotic-ECB mode
Chaotic-CFB mode
Chaotic-CBC mode
60
Chaotic-OFB mode
50
PSNR(dB)
40
30
20
10
0
0 1 2 3 4 5 6 7 8 9 10
Eb/N0(dB)
Figure 9.99 PSNR versus Eb /N0 in the DCT-OFDM system for an AWGN channel with N = 128
and G = 32.
80
Chaotic-ECB mode
70 Chaotic-CFB mode
Chaotic-CBC mode
Chaotic-OFB mode
60
50
PSNR(dB)
40
30
20
10
0
0 1 2 3 4 5 6 7 8 9 10
Eb/N0(dB)
Figure 9.100 PSNR versus Eb /N0 in the DWT-OFDM system for an AWGN channel with N = 128
and G = 32.
Simul ati o n E x a m p l e s 2 01
9.3
9.2
9.1
9
Chaotic-ECB mode
8.9 Chaotic-CFB mode
PSNR(dB)
Chaotic-CBC mode
8.8
Chaotic-OFB mode
8.7
8.6
8.5
8.4
8.3
0 1 2 3 4 5 6 7 8 9 10
Eb/N0(dB)
Figure 9.101 PSNR versus Eb /N0 in the FFT-OFDM system for a Raleigh channel with fd = 300 Hz
without CFO compensation.
9.3
9.2
9.1
Chaotic-CFB mode
8.8 Chaotic-CBC mode
Chaotic-OFB mode
8.7
8.6
8.5
8.4
8.3
0 1 2 3 4 5 6 7 8 9 10
Eb/N0(dB)
Figure 9.102 PSNR versus Eb /N0 in the DCT-OFDM system for a Raleigh channel with fd = 300 Hz
without CFO compensation.
202 Im ag e En c ry p ti o n
9.3
9.2
9.1
9
Chaotic-ECB mode
8.9
Chaotic-CFB mode
PSNR(dB)
Chaotic-CBC mode
8.8
Chaotic-OFB mode
8.7
8.6
8.5
8.4
8.3
0 1 2 3 4 5 6 7 8 9 10
Eb/N0(dB)
Figure 9.103 PSNR versus Eb /N0 in the DWT-OFDM system for a Raleigh channel with fd = 300 Hz
without CFO compensation.
80
Chaotic-ECB mode
70
Chaotic-CFB mode
Chaotic-CBC mode
60 Chaotic-OFB mode
50
PSNR(dB)
40
30
20
10
0
0 1 2 3 4 5 6 7 8 9 10
Eb/N0(dB)
Figure 9.104 PSNR versus Eb /N0 in the FFT-OFDM system for a Raleigh channel with fd = 300
Hz with CFO compensation.
Simul ati o n E x a m p l e s 203
80
70
Chaotic-ECB mode
60 Chaotic-CFB mode
Chaotic-CBC mode
50 Chaotic-OFB mode
PSNR(dB)
40
30
20
10
0
0 1 2 3 4 5 6 7 8 9 10
Eb/N0(dB)
Figure 9.105 PSNR versus Eb /N0 in the DCT-OFDM system for a Raleigh channel with fd = 300
Hz with CFO compensation.
80
70
Chaotic-ECB mode
60 Chaotic-CFB mode
Chaotic-CBC mode
50 Chaotic-OFB mode
PSNR(dB)
40
30
20
10
0
0 1 2 3 4 5 6 7 8 9 10
Eb/N0(dB)
Figure 9.106 PSNR versus Eb /N0 in the DWT-OFDM system for a Raleigh channel with fd = 300 Hz
with CFO compensation.
204 Im ag e En c ry p ti o n
9.3
9.2
9.1
8.9
PSNR(dB)
8.8
8.7
Figure 9.107 PSNR versus Eb /N0 in the FFT-OFDM system with ZP and HGI for a Raleigh channel
without PSE and equalization at N = 128 and G = 32.
9.3
9.2
9.1
8.9
PSNR(dB)
8.8
8.7
Figure 9.108 PSNR versus Eb /N0 in the DCT-OFDM system with ZP and HGI for a Raleigh channel
without PSE and equalization at N = 128 and G = 32.
Simul ati o n E x a m p l e s 205
9.3
9.2
9.1
8.9
PSNR(dB)
8.8
8.7
Figure 9.109 PSNR versus Eb /N0 in the DWT-OFDM system with ZP and HGI for a Raleigh chan-
nel without PSE and equalization at N = 128 and G = 32.
80
Chaotic-HGI-ECB mode
70 Chaotic-HGI-CFB mode
Chaotic-HGI-CBC mode
Chaotic-HGI-OFB mode
60
Chaotic-ZP-ECB mode
Chaotic-ZP-CFB mode
50 Chaotic-ZP-CBC mode
Chaotic-ZP-OFB mode
PSNR(dB)
40
30
20
10
0
0 1 2 3 4 5 6 7 8 9 10
Eb/N0(dB)
Figure 9.110 PSNR versus Eb /N0 in the FFT-OFDM system with ZP and HGI for a Raleigh channel
with PSE and equalization at N = 128 and G = 32.
206 Im ag e En c ry p ti o n
80
Chaotic-HGI-ECB mode
70 Chaotic-HGI-CFB mode
Chaotic-HGI-CBC mode
Chaotic-HGI-OFB mode
60
Chaotic-ZP-ECB mode
Chaotic-ZP-CFB mode
50 Chaotic-ZP-CBC mode
Chaotic-ZP-OFB mode
PSNR(dB)
40
30
20
10
0
0 1 2 3 4 5 6 7 8 9 10
Eb/N0(dB)
Figure 9.111 PSNR versus Eb /N0 in the DCT-OFDM system with ZP and HGI for a Raleigh channel
with PSE and equalization at N = 128 and G = 32.
80
Chaotic-HGI-ECB mode
70 Chaotic-HGI-CFB mode
Chaotic-HGI-CBC mode
Chaotic-HGI-OFB mode
60 Chaotic-ZP-ECB mode
Chaotic-ZP-CFB mode
50 Chaotic-ZP-CBC mode
Chaotic-ZP-OFB mode
PSNR(dB)
40
30
20
10
0
0 1 2 3 4 5 6 7 8 9 10
Eb/N0(dB)
Figure 9.112 PSNR versus Eb /N0 in the DWT-OFDM system with ZP and HGI for a Raleigh channel
with PSE and equalization at N = 128 and G = 32.
Simul ati o n E x a m p l e s 207
80
Chaotic-ECB mode without CFO compensation
70 Chaotic-CFB mode without CFO compensation
Chaotic-CBC mode without CFO compensation
Chaotic-OFB mode without CFO compensation
60 Chaotic-ECB mode with CFO compensation
Chaotic-CFB mode with CFO compensation
Chaotic-CBC mode with CFO compensation
50 Chaotic-OFB mode with CFO compensation
PSNR(dB)
40
30
20
10
0
0 1 2 3 4 5 6 7 8 9 10
Eb/N0(dB)
Figure 9.113 PSNR versus Eb /N0 in the FFT-OFDM system for an AWGN channel.
80
Chaotic-ECB mode without CFO compensation
70 Chaotic-CFB mode without CFO compensation
Chaotic-CBC mode without CFO compensation
Chaotic-OFB mode without CFO compensation
60 Chaotic-ECB mode with CFO compensation
Chaotic-CFB mode with CFO compensation
Chaotic-CBC mode with CFO compensation
50 Chaotic-OFB mode with CFO compensation
PSNR(dB)
40
30
20
10
0
0 1 2 3 4 5 6 7 8 9 10
Eb/N0(dB)
Figure 9.114 PSNR versus Eb /N0 in the DCT-OFDM system for an AWGN channel.
208 Im ag e En c ry p ti o n
80
Chaotic-ECB mode without CFO compensation
Chaotic-CFB mode without CFO compensation
70 Chaotic-CBC mode without CFO compensation
Chaotic-OFB mode without CFO compensation
60 Chaotic-ECB mode with CFO compensation
Chaotic-CFB mode with CFO compensation
Chaotic-CBC mode with CFO compensation
50 Chaotic-OFB mode with CFO compensation
PSNR(dB)
40
30
20
10
0
0 1 2 3 4 5 6 7 8 9 10
Eb/N0(dB)
Figure 9.115 PSNR versus Eb /N0 in the DWT-OFDM system for an AWGN channel.
50
AES + FFT – OFDM
45 AES with preprocessing + FFT – OFDM
AES + DCT – OFDM
40 AES with preprocessing + DCT – OFDM
AES + DWT – OFDM
35 AES with preprocessing + DWT – OFDM
30
PSNR(dB)
25
20
15
10
0
0 1 2 3 4 5 6 7 8 9 10
Eb/N0(dB)
Figure 9.116 PSNR versus Eb /N0 in the OFDM system for an AWGN channel with G = 32 and
N = 128.
Simul ati o n E x a m p l e s 209
10.2
AES + FFT – OFDM
10 AES with preprocessing + FFT – OFDM
AES + DCT – OFDM
AES with preprocessing + DCT – OFDM
9.8 AES + DWT – OFDM
AES with preprocessing + DWT – OFDM
9.6
PSNR(dB)
9.4
9.2
8.8
8.6
8.4
0 1 2 3 4 5 6 7 8 9 10
Eb/N0(dB)
Figure 9.117 PSNR versus Eb /N0 in the OFDM system for a Raleigh channel without PSE and
equalization at N = 128 and G = 32.
50
AES+FFT-OFDM
45 AES with preprocessing+FFT-OFDM
AES+DCT-OFDM
40 AES with preprocessing+DCT-OFDM
AES+DWT-OFDM
35 AES with preprocessing+DWT-OFDM
30
PSNR(dB)
25
20
15
10
0
0 1 2 3 4 5 6 7 8 9 10
Eb/N0(dB)
Figure 9.118 PSNR versus Eb /N0 in the OFDM system for a Raleigh channel with PSE and equal-
ization at N = 128 and G = 32.
210 Im ag e En c ry p ti o n
9.6
PSNR(dB)
9.4
9.2
8.8
8.6
8.4
0 1 2 3 4 5 6 7 8 9 10
Eb/N0(dB)
Figure 9.119 PSNR versus Eb /N0 in the OFDM system for an AWGN channel without CFO
compensation.
50
AES with preprocessing + FFT – OFDM
45 AES with preprocessing + DCT – OFDM
AES with preprocessing + DWT – OFDM
40 AES + FFT – OFDM
AES + DCT – OFDM
AES + DWT – OFDM
35
30
PSNR(dB)
25
20
15
10
0
0 1 2 3 4 5 6 7 8 9 10
Eb/N0(dB)
Figure 9.120 PSNR versus Eb /N0 in the OFDM system for an AWGN channel with CFO
compensation.
Simul ati o n E x a m p l e s 211
50
AES with preprocessing + FFT – OFDM
45 AES with preprocessing + DCT – OFDM
AES with preprocessing + DWT – OFDM
40 AES + FFT – OFDM
AES + DCT – OFDM
35 AES + DWT – OFDM
30
PSNR(dB)
25
20
15
10
0
0 1 2 3 4 5 6 7 8 9 10
Eb/N0(dB)
Figure 9.121 PSNR versus Eb /N0 in the OFDM system with HGI for a Raleigh channel with N =
128 and G = 32 with PSE and equalization.
50
AES with preprocessing + FFT – OFDM
45 AES with preprocessing + DCT – OFDM
AES with preprocessing + DWT – OFDM
40 AES + FFT – OFDM
AES + DCT – OFDM
35 AES + DWT – OFDM
30
PSNR(dB)
25
20
15
10
0
0 1 2 3 4 5 6 7 8 9 10
Eb/N0(dB)
Figure 9.122 PSNR versus Eb /N0 in the DWT-OFDM system with ZP for a Raleigh channel with
N = 128 and G = 32 with PSE and equalization.
212 Im ag e En c ry p ti o n
50
RC6 with preprocessing + FFT – OFDM
45 RC6 with preprocessing + DCT – OFDM
RC6 with preprocessing + DWT – OFDM
40 RC6 + FFT – OFDM
RC6 + DCT – OFDM
35 RC6 + DWT – OFDM
30
PSNR(dB)
25
20
15
10
0
0 1 2 3 4 5 6 7 8 9 10
Eb/N0(dB)
Figure 9.123 PSNR versus Eb /N0 in the OFDM system for an AWGN channel with N = 128 and
G = 32.
9.4
9.2
8.8
8.6
8.4
0 1 2 3 4 5 6 7 8 9 10
Eb/N0(dB)
Figure 9.124 PSNR versus Eb /N0 in the OFDM system for a Raleigh channel with fd = 300 Hz
without PSE and equalization.
Simul ati o n E x a m p l e s 213
50
RC6 with preprocessing + FFT – OFDM
45 RC6 with preprocessing + DCT – OFDM
RC6 with preprocessing + DWT – OFDM
40 RC6 + FFT – OFDM
RC6 + DCT – OFDM
RC6 + DWT – OFDM
35
30
PSNR(dB)
25
20
15
10
0
0 1 2 3 4 5 6 7 8 9 10
Eb/N0(dB)
Figure 9.125 PSNR versus Eb /N0 in the OFDM system for a Raleigh channel with fd = 300 Hz
with PSE and equalization.
9.4
9.2
8.8
8.6
8.4
0 1 2 3 4 5 6 7 8 9 10
Eb/N0(dB)
Figure 9.126 PSNR versus Eb /N0 in the OFDM system for an AWGN channel without CFO
compensation.
214 Im ag e En c ry p ti o n
50
30
PSNR(dB)
25
20
15
10
0
0 1 2 3 4 5 6 7 8 9 10
Eb/N0(dB)
Figure 9.127 PSNR versus Eb /N0 in the OFDM system for an AWGN channel with CFO
compensation.
50
RC6 with preprocessing + FFT – OFDM
45 RC6 with preprocessing + DCT – OFDM
RC6 with preprocessing + DWT – OFDM
40 RC6 + FFT – OFDM
RC6 + DCT – OFDM
35 RC6 + DWT – OFDM
30
PSNR(dB)
25
20
15
10
0
0 1 2 3 4 5 6 7 8 9 10
Eb/N0(dB)
Figure 9.128 PSNR versus Eb /N0 in the OFDM system for a Raleigh channel without CFO
compensation.
Simul ati o n E x a m p l e s 215
50
RC6 with preprocessing + FFT – OFDM
45 RC6 with preprocessing + DCT – OFDM
RC6 with preprocessing + DWT – OFDM
40 RC6 + FFT – OFDM
RC6 + DCT – OFDM
35 RC6 + DWT – OFDM
30
PSNR(dB)
25
20
15
10
0
0 1 2 3 4 5 6 7 8 9 10
Eb/N0(dB)
Figure 9.129 PSNR versus Eb /N0 in the OFDM system for a Raleigh channel with CFO
compensation.
100
Without coding
90 With clipping
With companding at µ = 0.1
80 With clipping + companding at µ = 0.1
With companding at µ = 4
70 With clipping + companding at µ = 4
PSNR(dB)
60
50
40
30
20
10
0 1 2 3 4 5 6 7 8 9 10
Eb/N0(dB)
Figure 9.130 PSNR versus Eb /N0 for original-image transmission with FFT-OFDM system over an
AWGN channel. Convolutional coding is applied with all cases except the first one.
216 Im ag e En c ry p ti o n
100
Without coding
90 With clipping
With companding at µ = 0.1
80 With clipping + companding at µ = 0.1
With companding at µ = 4
70 With clipping + companding at µ = 4
PSNR(dB)
60
50
40
30
20
10
0 1 2 3 4 5 6 7 8 9 10
Eb/N0(dB)
Figure 9.131 PSNR versus Eb /N0 for original-image transmission with DCT-OFDM system over
an AWGN channel. Convolutional coding is applied with all cases except the first one.
100
Without coding
90 With clipping
With companding at µ = 0.1
80 With clipping + companding at µ = 0.1
With companding at µ = 4
70 With clipping + companding at µ = 4
60
PSNR(dB)
50
40
30
20
10
0
0 1 2 3 4 5 6 7 8 9 10
Eb/N0(dB)
Figure 9.132 PSNR versus Eb /N0 for original-image transmission with DWT-OFDM system over
an AWGN channel. Convolutional coding is applied with all cases except the first one.
Simul ati o n E x a m p l e s 217
100
Without coding
90 With clipping
With companding at µ = 0.1
80 With clipping + companding at µ = 0.1
With companding at µ = 4
70 With clipping + companding at µ = 4
PSNR(dB)
60
50
40
30
20
10
0 1 2 3 4 5 6 7 8 9 10
Eb/N0(dB)
Figure 9.133 PSNR versus Eb /N0 for chaotic-encrypted image transmission with FFT-OFDM
system over an AWGN channel. Convolutional coding is applied with all cases except the first one.
100
Without coding
90 With clipping
With companding at µ = 0.1
80 With clipping + companding at µ = 0.1
With companding at µ = 4
70 With clipping + companding at µ = 4
PSNR(dB)
60
50
40
30
20
10
0 1 2 3 4 5 6 7 8 9 10
Eb/N0(dB)
Figure 9.134 PSNR versus Eb /N0 for chaotic-encrypted image transmission with DCT-OFDM
system over an AWGN channel. Convolutional coding is applied with all cases except the first one.
218 Im ag e En c ry p ti o n
90
Without coding
80 With clipping
With companding at µ = 0.1
70 With clipping + companding at µ = 0.1
With companding at µ = 4
60 With clipping + companding at µ = 4
PSNR(dB)
50
40
30
20
10
0
0 1 2 3 4 5 6 7 8 9 10
Eb/N0(dB)
Figure 9.135 PSNR versus Eb /N0 for chaotic-encrypted image transmission with DWT-OFDM
system over an AWGN channel. Convolutional coding is applied with all cases except the first one.
100
Without coding
90 With clipping
With companding at µ = 0.1
80 With clipping + companding at µ = 0.1
With companding at µ = 4
70 With clipping + companding at µ = 4
60
PSNR(dB)
50
40
30
20
10
0
0 1 2 3 4 5 6 7 8 9 10
Eb/N0(dB)
Figure 9.136 PSNR versus Eb /N0 for AES-encrypted image transmission with FFT-OFDM system
over an AWGN channel. Convolutional coding is applied with all cases except the first one.
Simul ati o n E x a m p l e s 219
100
Without coding
90 With clipping
With companding at µ = 0.1
80 With clipping + companding at µ= 0.1
With companding at µ =4
70 With clipping + companding at µ = 4
60
PSNR(dB)
50
40
30
20
10
0
0 1 2 3 4 5 6 7 8 9 10
Eb/N0(dB)
Figure 9.137 PSNR versus Eb /N0 for AES-encrypted image transmission with DCT-OFDM system
over an AWGN channel. Convolutional coding is applied with all cases except the first one.
100
Without coding
90
With clipping
With companding at µ = 0.1
80 With clipping+companding at µ = 0.1
With companding at µ = 4
70 With clipping+companding at µ = 4
60
PSNR(dB)
50
40
30
20
10
0
0 1 2 3 4 5 6 7 8 9 10
Eb/N0(dB)
Figure 9.138 PSNR versus Eb /N0 for AES-encrypted image transmission with DWT-OFDM system
over an AWGN channel. Convolutional coding is applied with all cases except the first one.
220 Im ag e En c ry p ti o n
100
Without coding
90 With clipping
With companding at µ = 0.1
80 With clipping + companding at µ = 0.1
With companding at µ = 4
70 With clipping + companding at µ = 4
60
PSNR(dB)
50
40
30
20
10
0
0 1 2 3 4 5 6 7 8 9 10
Eb/N0(dB)
Figure 9.139 PSNR versus Eb /N0 for DES-encrypted image transmission with FFT-OFDM system
over an AWGN channel. Convolutional coding is applied with all cases except the first one.
100
90 Without coding
With clipping
80 With companding at µ = 0.1
With clipping + companding at µ = 0.1
70 With companding at µ = 4
With clipping + companding at µ = 4
60
PSNR(dB)
50
40
30
20
10
0
0 1 2 3 4 5 6 7 8 9 10
Eb/N0(dB)
Figure 9.140 PSNR versus Eb /N0 for DES-encrypted image transmission with DCT-OFDM system
over an AWGN channel. Convolutional coding is applied with all cases except the first one.
Simul ati o n E x a m p l e s 2 21
100
Without coding
90
With clipping
With companding at µ = 0.1
80
With clipping + companding at µ = 0.1
With companding at µ= 4
70
With clipping + companding at µ = 4
60
PSNR(dB)
50
40
30
20
10
0
0 1 2 3 4 5 6 7 8 9 10
Eb/N0(dB)
Figure 9.141 PSNR versus Eb /N0 for DES-encrypted image transmission with DWT-OFDM system
over an AWGN channel. Convolutional coding is applied with all cases except the first one.
100
90 Without coding
With clipping
80 With companding at µ = 0.1
With clipping + companding at µ = 0.1
70 With companding at µ = 4
With clipping + companding at µ = 4
60
PSNR(dB)
50
40
30
20
10
0
0 1 2 3 4 5 6 7 8 9 10
Eb/N0(dB)
Figure 9.142 PSNR versus Eb /N0 for RC6-encrypted image transmission with FFT-OFDM system
over an AWGN channel. Convolutional coding is applied with all cases except the first one.
222 Im ag e En c ry p ti o n
100
Without coding
90 With clipping
With companding at µ = 0.1
80 With clipping + companding at µ = 0.1
With companding at µ = 4
70 With clipping + companding at µ = 4
60
PSNR(dB)
50
40
30
20
10
0
0 1 2 3 4 5 6 7 8 9 10
Eb/N0(dB)
Figure 9.143 PSNR versus Eb /N0 for RC6-encrypted image transmission with DCT-OFDM system
over an AWGN channel. Convolutional coding is applied with all cases except the first one.
100
Without coding
90
With clipping
With companding at µ = 0.1
80
With clipping + companding at µ= 0.1
With companding at µ = 4
70 With clipping + companding at µ = 4
60
PSNR(dB)
50
40
30
20
10
0
0 1 2 3 4 5 6 7 8 9 10
Eb/N0(dB)
Figure 9.144 PSNR versus Eb /N0 for RC6-encrypted image transmission with DWT-OFDM sys-
tem over an AWGN channel. Convolutional coding is applied with all cases except the first one.
Simul ati o n E x a m p l e s 223
9.5 Summary
From all obtained results, we can see that PAPR reduction technique
effects can be mitigated to a great extent with error-correcting codes
such as the convolutional code. Another conclusion is that chaotic
encryption preserves its rank as the best encryption algorithm from
the immunity to noise perspective even in the presence of PAPR
reduction. A simple clipping, companding, or hybrid clipping-and-
companding method may be feasible for PAPR reduction in the case
of encrypted image transmission.
References
225
226 Ref eren c e s
133. Mary Ann Ingram, OFDM Simulation Using Matlab, Smart Antenna
Research Laboratory, Guillermo Acosta, Georgia Tech, Atlanta,
August 2000.
134. J. Zhang and B. Li, New Modulation Identification Scheme for OFDM
in Multipath Rayleigh Fading Channel, International Symposium on
Computer Science and Computational Technology, 2008.
135. H. S. Chu, B. S. Park, C. K. An, J. S. Kang, and H. G. Son, Wireless Image
Transmission based on Adaptive OFDM System, IEEE, 2007.
136. C. S. Avilaf and R. S. Reillot, The Rijndael Block Cipher (AES Proposal):
A Comparison with DES, IEEE, 2001.
137. M. S. Liu, Y. Zhang, and J. Huali, Research on Improving Security of DES
by Chaotic Mapping, Proceedings of the Eighth International Conference on
Machine Learning and Cybernetics, Baoding, July 12–15.
138. V. B. Vats, K. K. Garg, and A. Abad, Performance Analysis of DFT-
OFDM, DCT-OFDM, and DWT-OFDM Systems in AWGN,
Proceedings of the IEEE Fourth International Conference on Wireless and
Mobile Communications, 2008.
139. P. Tan and N. C. Beaulieu, Precise Bit Error Probability Analysis of
DCT OFDM in the Presence of Carrier Frequency Offset on AWGN
Channels, Proceedings of the IEEE Globcom 2005, pp. 1429–1434, 2005.
140. Giridhar D. Mandyam, On the Discrete Cosine Transform and OFDM
Systems, Nokia Research Center, Irving, TX, 2003.
141. M. Misiti, Y. Misiti, and G. Oppenheim, Wavelets and Their Applications,
Jean-Michel Poggi, ISTE, 2007.
142. A. Prochazka, J. Uhlir, P. J. W. Rayner, and N. J. Kingsbury, Signal Analysis
and Prediction, Birkhauser, New York, 1998.
143. B. Muquet, Z. Wang, G. B. Giannakis, M. d. Courville, and P.
Duhamel, Cyclic Prefixing or Zero Padding for Wireless Multicarrier
Transmissions, IEEE Transactions on Communications, Vol. 50, No. 12,
December 2002.
144. B. Li, S. Zhou, M. Stojanovic, L. Freitag, and P. Willett, Non-Uniform
Doppler Compensation for Zero-Padded OFDM over Fast-Varying
Under water Acoustic Channels, OCEANS2007-Europe, IEEE, 2007.
145. C. R. N. Athaudage and R. R. V. Angiras, Sensitivity of FFT-Equalised
Zero-Padded OFDM Systems to Time and Frequency Synchronization
Errors, IEE Proc.-Commun., Vol. 152, No. 6, December 2005.
146. B. Muquet, M. D. Courville, P. Duhamel, G. B. Giannakis, and
P. Magniez, Turbo Demodulation of Zero-Padded OFDM
Transmissions, IEEE Transactions on Communications, Vol. 50, No. 11,
November 2002.
147. D. Huang and K. B. Letaief, An Interference-Cancellation Scheme
for Carrier Frequency Offsets Correction in OFDMA Systems, IEEE
Transactions on Communication, Vol. 53, No. 7, pp. 1155–1165, July 2005.
148. J. Paul and M. G. Linnartz, Performance Analysis of Synchronous
MC-CDMA in Mobile Rayleigh Channel with Both Delay and
Doppler Spreads, IEEE Transactions on Vehicular Technology, Vol. 50,
No. 6, November 2001.
Ref eren c e s 235
function y = multi(x,w)
%z = a*a1 mod 2^32
a = frombase256(x); a1 = frombase256(w);
z = mod(a*a1,2^32);
y = tobase256(z);
function y = padding(x)
%Padding x with zeros if x is shorter than 16
L = length(x);
if mod(L,16)==0
y = x;
else
pad = 16-mod(L,16);
y = zeros(1,L+pad);
y(1:L) = x;
end;
function RC5enctextRC5 = RC5CBC(plaintext1,m,n,CO,r,
keyi)
% Encrypt data using RC5 in CBC mode.
RC5enctextRC5 = zeros(m*n/8,8);
237
238 App en d i x A
for i = 1:m*n/8
plaintext = plaintext1(i,:);
if i==1
plaintexts = bitxor(plaintext,CO);
else
plaintexts = bitxor(plaintext,RC5enctext);
end;
RC5enctext = RC5enc(plaintexts,r,keyi);
RC5enctextRC5(i,:) = RC5enctext;
end;
RC5enctext = bitxor(plaintext,cr1);
else
cr1 = RC5enc(RC5enctext,r,keyi);
RC5enctext = bitxor(plaintext,cr1);
end;
RC5enctextRC5(i,:) = RC5enctext;
end;
App en d i x A 239
re_plaintext = bitxor(RC5enctextss,cr1);
else
cr1 = RC5enc(RC5enctext1(i-1,:),r,keyi);
re_plaintext = bitxor(RC5enctextss,cr1);
end;
plaintextRC5(i,:) = re_plaintext;
end;
plaintext = bitxor(re_plaintext,CO);
else
plaintext = bitxor(re_plaintext,RC5enctext1
((i-1),:));
end;
plaintextRC5(i,:) = plaintext;
end;
xa1 = uint8(plaintextRC5(:));
[m,n] = size(x1);
y1 = double(x1);
plaintextRC5 = zeros(m*n/8,8);
RC5enctext1 = reshape(y1',8,m*n/8)';
for i = 1:m*n/8
RC5enctextss = RC5enctext1(i,:);
re_plaintext = RC5decry(RC5enctextss,r,keyi);
if i = =1
plaintext = bitxor(re_plaintext,CO);
else
plaintext = bitxor(re_plaintext,RC5enctext1
((i-1),:));
end;
plaintextRC5(i,:) = plaintext;
end;
ya1 = reshape(plaintextRC5',n,m)';
xa1 = uint8(ya1);
xa1 = uint8(ciphertext);
App en d i x A 2 41
re_plaintext = bitxor(RC5enctextss,cr1);
else
cr1 = RC5enc(RC5enctext1(i-1,:),r,keyi);
re_plaintext = bitxor(RC5enctextss,cr1);
end;
plaintextRC5(i,:) = re_plaintext;
end;
xa1 = uint8(plaintextRC5(:));
re_plaintext = bitxor(RC5enctextss,cr1);
else
cr1 = RC5enc(RC5enctext1(i-1,:),r,keyi);
re_plaintext = bitxor(RC5enctextss,cr1);
end;
plaintextRC5(i,:) = re_plaintext;
end;
ya1 = reshape(plaintextRC5',n,m)';
xa1 = uint8(ya1);
242 App en d i x A
x1 = x(:,:,1);
x2 = x(:,:,2);
x3 = x(:,:,3);
y1 = double(x1);
y2 = double(x2);
y3 = double(x3);
[m,n] = size(x1);
plaintext(:,:,1) = reshape(y1',8,m*n/8)';
plaintext(:,:,2) = reshape(y2',8,m*n/8)';
plaintext(:,:,3) = reshape(y3',8,m*n/8)';
ciphertext = x;
for i = 1:3 plaintextRC5 = plaintext(:,:,i);
RC5enctext = RC5CFBDec(plaintextRC5,m,n,CO,r,
keyi);
RC5enctext = reshape(RC5enctext',n,m)';
ciphertext(:,:,i) = RC5enctext;
end
xa1 = uint8(ciphertext);
end;
xa1 = uint8(plaintextRC5(:));
end;
ya1 = reshape(plaintextRC5',n,m)';
xa1 = uint8(ya1);
L = length(x1);
y1 = double(x1);
plaintextRC5 = zeros(L/8,8);
RC5enctext1 = reshape(y1,L/8,8);
24 4 App en d i x A
for i = 1:L/8
RC5enctextss = RC5enctext1(i,:);
if i = =1
cr = RC5enc (CO,r,keyi);
re_plaintext = bitxor(RC5enctextss,cr);
else cr = RC5enc(cr,r,keyi);
re_plaintext = bitxor(RC5enctextss,cr);
end;
plaintextRC5(i,:) = re_plaintext;
end;
xa1 = uint8(plaintextRC5(:));
plaintextRC5(i,:) = re_plaintext;
end;
ya1 = reshape(plaintextRC5',n,m)';
xa1 = uint8(ya1);
x1 = x(:,:,1);
x2 = x(:,:,2);
x3 = x(:,:,3);
App en d i x A 24 5
y1 = double(x1);
y2 = double(x2);
y3 = double(x3);
[m,n] = size(x1);
plaintext(:,:,1) = reshape(y1',8,m*n/8)';
plaintext(:,:,2) = reshape(y2',8,m*n/8)';
plaintext(:,:,3) = reshape(y3',8,m*n/8)';
ciphertext = x;
for i = 1:3 plaintextRC5 = plaintext(:,:,i);
RC5enctext = RC5OFBDec(plaintextRC5,m,n,CO,r,k
eyi);
RC5enctext = reshape(RC5enctext',n,m)';
ciphertext(:,:,i) = RC5enctext;
end
xa1 = uint8(ciphertext);
function y = RC5decry(plaintext,round,s)
%RC5 Decryption
a = plaintext(1:4); b = plaintext(5:8); for
i = round:-1:1
b = RC5sub(b,s(2*i+2,:)); b = shifting
(b,-LSB5(a)); b = bitxor(b',a);
a = RC5sub(a,s(2*i+1,:)); a = shifting
(a,-LSB5(b)); a = bitxor(a',b);
end b = RC5sub(b,s(2,:));
a = RC5sub(a,s(1,:)); y(1:4) = a;
y(5:8) = b;
end;
plaintextRC5(i,:) = re_plaintext;
end;
function y = RC5enc(plaintext,round,s)
%RC5 Encryption
a = plaintext(1:4); b = plaintext(5:8);
a = add(a,s(1,:)); b = add(b,s(2,:)); for
i = 1:round
a = bitxor(a,b); a = shifting(a,LSB5(b));
a = add(a,s(2*i+1,:)); b = bitxor(b,a);
b = shifting(b,LSB5(a)); b = add(b,s(2*i+2,:));
end y(1:4) = a; y(5:8) = b;
end;
xa = uint8(RC5enctextRC5(:));
function xa = RC5EncCBCImage(x,key,r,CO)
%Encrypt Image using RC5 in CBC mode
[m,n] = size(x);
y = double(x); keyi = RC5keygen(key,r);
plaintext1 = reshape(y',8,m*n/8)';
RC5enctextRC5 = zeros(m*n/8,8);
%CBC
for i = 1:m*n/8 plaintext = plaintext1(i,:); if i = =1
plaintexts = bitxor(plaintext,CO);
else plaintexts = bitxor(plaintext,RC5enctext);
end;
RC5enctext = RC5enc(plaintexts,r,keyi);
App en d i x A 2 47
RC5enctextRC5(i,:) = RC5enctext;
nd; ya = reshape(RC5enctextRC5',n,m)';
e
xa = uint8(ya);
function xa = RC5EncCBCImageC(x,key,r,CO)
%Encrypt Colored Image using RC5 in CBC mode
keyi = RC5keygen(key,r);
plaintext(:,:,1) = reshape(y1',8,m*n/8)';
plaintext(:,:,2) = reshape(y2',8,m*n/8)';
plaintext(:,:,3) = reshape(y3',8,m*n/8)';
RC5enctext = x;
%CBC
RC5enctext = bitxor(plaintext,cr1);
else cr1 = RC5enc(RC5enctext,r,keyi);
RC5enctext = bitxor(plaintext,cr1);
end;
24 8 App en d i x A
RC5enctextRC5(i,:) = RC5enctext;
end;
xa = uint8(RC5enctextRC5(:));
function xa = RC5EncCFBImage(x,key,r,CO)
%Encrypt Image using RC5 in CFB mode
[m,n] = size(x);
y = double(x); keyi = RC5keygen(key,r);
plaintext1 = reshape(y',8,m*n/8)';
RC5enctextRC5 = zeros(m*n/8,8);
for i = 1:m*n/8 plaintext = plaintext1(i,:); if i = =1
cr1 = RC5enc(CO,r,keyi);
RC5enctext = bitxor(plaintext,cr1);
else cr1 = RC5enc(RC5enctext,r,keyi);
RC5enctext = bitxor(plaintext,cr1);
end;
RC5enctextRC5(i,:) = RC5enctext;
end; ya = reshape(RC5enctextRC5',n,m)';
xa = uint8(ya);
function xa = RC5EncCFBImageC(x,key,r,CO)
%Encrypt Colored Image using RC5 in CFB mode
x1 = x(:,:,1); x2 = x(:,:,2); x3 = x(:,:,3);
y1 = double(x1); y2 = double(x2);
y3 = double(x3); [m,n] = size(x1);
keyi = RC5keygen(key,r);
plaintext(:,:,1) = reshape(y1',8,m*n/8)';
plaintext(:,:,2) = reshape(y2',8,m*n/8)';
plaintext(:,:,3) = reshape(y3',8,m*n/8)';
RC5enctext = x;
% CFB
for i = 1:3 plaintext1 = plaintext(:,:,i);
RC5enctextRC5 = RC5CFB(plaintext1,m,n,CO,r,keyi);
RC5enctextRC5 = reshape(RC5enctextRC5',n,m)';
RC5enctext(:,:,i) = RC5enctextRC5;
end; xa = uint8(RC5enctext);
App en d i x A 24 9
imwrite(xa,'onion1RC5encCFB.tif','tif')
imshow('onion1RC5encCFB.tif')
end;
xa = uint8(RC5enctextRC5(:));
function xa = RC5EncECBImage(x,key,r)
%Encrypt Image using RC5 in ECB mode
[m,n] = size(x);
y = double(x); keyi = RC5keygen(key,r);
plaintext1 = reshape(y',8,m*n/8)';
RC5enctextRC5 = zeros(m*n/8,8);
% ECB
for i = 1:m*n/8
plaintext = plaintext1(i,:);
RC5enctext = RC5enc(plaintext,r,keyi);
RC5enctextRC5(i,:) = RC5enctext;
nd; ya = reshape(RC5enctextRC5',n,m)';
e
xa = uint8(ya);
function xa = RC5EncECBImageC(x,key,r)
%Encrypt Colored Image using RC5 in ECB mode
x1 = x(:,:,1); x2 = x(:,:,2); x3 = x(:,:,3);
y1 = double(x1); y2 = double(x2);
y3 = double(x3); [m,n] = size(x1);
keyi = RC5keygen(key,r);
plaintext(:,:,1) = reshape(y1',8,m*n/8)';
plaintext(:,:,2) = reshape(y2',8,m*n/8)';
plaintext(:,:,3) = reshape(y3',8,m*n/8)';
250 App en d i x A
if i = =1 cr = RC5enc(CO,r,keyi);
else cr = RC5enc(cr,r,keyi);
end;
xa = uint8(RC5enctextRC5(:));
function xa = RC5EncOFBImage(x,key,r,CO)
%Encrypt Image using RC5 in OFB mode
[m,n] = size(x);
y = double(x); keyi = RC5keygen(key,r);
plaintext1 = reshape(y',8,m*n/8)';
RC5enctextRC5 = zeros(m*n/8,8);
% OFB
for i = 1:m*n/8 plaintext = plaintext1(i,:);
if i = =1 cr = RC5enc(CO,r,keyi);
else cr = RC5enc(cr,r,keyi);
end; ya = reshape(RC5enctextRC5',n,m)';
xa = uint8(ya);
function xa = RC5EncOFBImageC(x,key,r,CO)
%Encrypt Colored Image using RC5 in OFB mode
function s = keygen(key,r)
% RC5/RC6 Key Generation
p = [99 81 225 183];
q = [185 121 55 158];
s(1,:) = p;
for i = 2:2*r+4 s(i,:) = add(s(i-1,:),q);
end; i = 1; a = zeros(1,4);
b = zeros(1,4); v = 3*(2*r+4); for
h = 1:v
s(i,:) = add(s(i,:),a); s(i,:) = add(s(i,:),b);
s(i,:) = shifting(s(i,:),3); a = s(i,:); key =
add(key,a); key = add(key,b);
key = shifting(key,LSB5(add(a,b)));
b = key;
if i = =2*r+4 i = 1;
end end
if i = =1 cr = RC5enc(CO,r,keyi);
else cr = RC5enc(cr,r,keyi);
end;
plaintextRC5 = zeros(m*n/8,8);
for i = 1:m*n/8
RC5enctextss = RC5enctext1(i,:);
if i = =1
cr = RC5enc (CO,r,keyi);
re_plaintext = bitxor(RC5enctextss,cr);
else cr = RC5enc(cr,r,keyi);
re_plaintext = bitxor(RC5enctextss,cr);
end;
plaintextRC5(i,:) = re_plaintext;
end;
function y = RC5sub(x,w)
%z = a-a1 mod 2^32
a = frombase256(x); a1 = frombase256(w);
z = mod(a-a1,2^32); y = tobase256(z);
end;
App en d i x A 253
plaintextRC6 = zeros(m*n/16,16);
for i = 1:m*n/16
RC6enctextss = RC6enctext1(i,:);
re_plaintext = RC6dec(RC6enctextss,r,keyi);
if i = =1 plaintext = bitxor(re_plaintext,CO);
else
plaintext = bitxor(re_plaintext,R
C6enctext1((i-1),:));
end;
plaintextRC6(i,:) = plaintext;
end;
RC6enctextRC6 = zeros(m*n/16,16);
for i = 1:m*n/16 plaintext = plaintext1(i,:); if i = =1
cr1 = RC6enc(CO,r,keyi);
RC6enctext = bitxor(plaintext,cr1);
else cr1 = RC6enc(RC6enctext,r,keyi);
end;
re_plaintext = bitxor(RC6enctextss,cr1);
else
cr1 = RC6enc(RC6enctext1(i-1,:),r,keyi);
re_plaintext = bitxor(RC6enctextss,cr1);
end;
25 4 App en d i x A
plaintextRC6(i,:) = re_plaintext;
end;
function y = RC6dec(plaintext,round,s)
% RC6 Decryption
a = plaintext(1:4); b = plaintext(5:8);
c = plaintext(9:12); d = plaintext(13:16);
c = RC6sub(c,s(2*round+4,:));
a = RC6sub(a,s(2*round+3,:)); for i = round:-1:1
temp = d; d = c; c = b; b = a;
a = temp;
u = multi(d,(2*d+1)); u = shifting(u,5);
t = multi(b,(2*b+1)); t = shifting(t,5);
c = RC6sub(c,s(2*i+2,:)); c = shifting
(c,-LSB5(t)); c = bitxor(c,u);
a = RC6sub(a,s(2*i+1,:)); a = shifting
(a,-LSB5(u)); a = bitxor(a,t);
end d = RC6sub(d,s(2,:));
b = RC6sub(b,s(1,:)); y(1:4) = a;
y(5:8) = b; y(9:12) = c; y(13:16) = d;
plaintext = bitxor(re_plaintext,CO);
else
plaintext = bitxor(re_plaintext,y1((i-1),:));
end;
plaintextRC6(i,:) = plaintext; end;
xa1 = uint8(plaintextRC6(:));
keyi = RC6keygen(key,r);
App en d i x A 255
RC6enctextss = RC6enctext1(i,:);
re_plaintext = RC6dec(RC6enctextss,r,keyi);
if i = =1
plaintext = bitxor(re_plaintext,CO);
else
plaintext = bitxor(re_plaintext,RC6enctext1
((i-1),:));
end;
plaintextRC6(i,:) = plaintext;
end;
ya1 = reshape(plaintextRC6',n,m)';
xa1 = uint8(ya1);
xa1 = uint8(ciphertext);
end;
xa1 = uint8(plaintextRC6(:));
keyi = RC6keygen(key,r);
%CFB [m,n] = size(x1);
y1 = double(x1);
plaintextRC6 = zeros(m*n/16,16);
RC6enctext1 = reshape(y1',16,m*n/16)'; for i = 1:m*n/16
RC6enctextss = RC6enctext1(i,:);
if i = =1 cr1 = RC6enc(CO,r,keyi);
re_plaintext =
bitxor(RC6enctextss,cr1);
else
cr1 = RC6enc(RC6enctext1(i-1,:),r,keyi);
re_plaintext =
bitxor(RC6enctextss,cr1);
end;
plaintextRC6(i,:) = re_plaintext;
end;
ya1 = reshape(plaintextRC6',n,m)';
xa1 = uint8(ya1);
xa1 = uint8(ciphertext);
end;
xa1 = uint8(plaintextRC6(:));
end;
258 App en d i x A
ya1 = reshape(plaintextRC6',n,m)';
xa1 = uint8(ya1);
keyi = RC6keygen(key,r);
App en d i x A 259
plaintextRC6(i,:) = re_plaintext;
end;
ya1 = reshape(plaintextRC6',n,m)';
xa1 = uint8(ya1);
xa1 = uint8(ciphertext);
RC6enctextRC6 = zeros(m*n/16,16);
for i = 1:m*n/16 plaintext = plaintext1(i,:);
RC6enctext = RC6enc(plaintext,r,keyi);
260 App en d i x A
RC6enctextRC6(i,:) = RC6enctext;
end;
function plaintextRC6 =
RC6ECBDec(RC6enctext1,m,n,r,keyi)
%Decrypt Data using RC6 in ECB mode
plaintextRC6 = zeros(m*n/16,16);
for i = 1:m*n/16
RC6enctextss = RC6enctext1(i,:);
re_plaintext = RC6dec(RC6enctextss,r,keyi);
plaintextRC6(i,:) = re_plaintext;
end;
function y = RC6enc(plaintext,round,s)
%RC6 Encryption
a = plaintext(1:4); b = plaintext(5:8);
c = plaintext(9:12); d = plaintext(13:16);
b = add(b,s(1,:)); d = add(d,s(2,:));
for i = 1:round t = multi(b,(2*b+1)); t = shifting(t,5);
u = multi(d,(2*d+1)); u = shifting(u,5);
a = bitxor(a,t'); a = shifting(a,LSB5(u));
a = add(a,s(2*i+1,:)); c = bitxor(c,u');
c = shifting(c,LSB5(t)); c = add(c,s(2*i+2,:));
temp = a;
a = b; b = c; c = d; d = temp;
end a = add(a,s(2*round+3,:)); c =
add(c,s(2*round+4,:)); y(1:4) = a;
y(5:8) = b; y(9:12) = c; y(13:16) = d;
end;
RC6enctext = RC6enc(plaintexts,r,keyi);
RC6enctextRC6(i,:) = RC6enctext;
end;
xa = uint8(RC6enctextRC6(:));
function xa = RC6EncCBCImage(x,key,r,CO)
%Encrypt Image using RC6 in CBC mode
[m,n] = size(x);
y = double(x);
keyi = RC6keygen(key,r);
plaintext1 = reshape(y',16,m*n/16)';
RC6enctextRC6 = zeros(m*n/16,16);
%CBC
for i = 1:m*n/16
plaintext = plaintext1(i,:);
if i = =1
plaintexts = bitxor(plaintext,CO);
else
plaintexts = bitxor(plaintext,RC6enctext);
end;
RC6enctext = RC6enc(plaintexts,r,keyi);
RC6enctextRC6(i,:) = RC6enctext;
end;
ya = reshape(RC6enctextRC6',n,m)';
xa = uint8(ya);
function xa = RC6EncCBCImageC(x,key,r,CO)
%Encrypt Colored Image using RC6 in CBC mode
x1 = x(:,:,1);
x2 = x(:,:,2);
x3 = x(:,:,3);
[m,n] = size(x1);
y1 = double(x1);
y2 = double(x2);
y3 = double(x3);
keyi = RC6keygen(key,r);
plaintext(:,:,1) = reshape(y1',16,m*n/16)';
plaintext(:,:,2) = reshape(y2',16,m*n/16)';
plaintext(:,:,3) = reshape(y3',16,m*n/16)';
RC6enctext = x;
%CBC
for i = 1:3 plaintext1 = plaintext(:,:,i);
RC6enctextRC6 = RC6CBC(plaintext1,m,n,CO,r,keyi);
262 App en d i x A
RC6enctextRC6 = reshape(RC6enctextRC6',n,m)';
RC6enctext(:,:,i) = RC6enctextRC6;
end;
xa = uint8(RC6enctext);
L = length(x);
y = double(x);
keyi = RC6keygen(key,r);
plaintext1 = reshape(y,L/16,16);
RC6enctextRC6 = zeros(L/16,16);
% CFB
for i = 1:L/16
plaintext = plaintext1(i,:);
if i = =1
cr1 = RC6enc(CO,r,keyi);
RC6enctext = bitxor(plaintext,cr1);
else
cr1 = RC6enc(RC6enctext,r,keyi);
RC6enctext = bitxor(plaintext,cr1);
end;
RC6enctextRC6(i,:) = RC6enctext;
end;
xa = uint8(RC6enctextRC6(:));
function xa = RC6EncCFBImage(x,key,r,CO)
%Encrypt Image using RC6 in CFB mode
[m,n] = size(x);
y = double(x);
keyi = RC6keygen(key,r);
plaintext1 = reshape(y',16,m*n/16)';
RC6enctextRC6 = zeros(m*n/16,16);
% CFB
for i = 1:m*n/16
plaintext = plaintext1(i,:);
if i = =1
App en d i x A 263
cr1 = RC6enc(CO,r,keyi);
RC6enctext = bitxor(plaintext,cr1);
else
cr1 = RC6enc(RC6enctext,r,keyi);
RC6enctext = bitxor(plaintext,cr1);
end;
RC6enctextRC6(i,:) = RC6enctext;
end;
ya = reshape(RC6enctextRC6',n,m)';
xa = uint8(ya);
function xa = RC6EncCFBImageC(x,key,r,CO)
%Encrypt Colored Image using RC6 in CFB mode
x1 = x(:,:,1);
x2 = x(:,:,2);
x3 = x(:,:,3);
[m,n] = size(x1);
y1 = double(x1);
y2 = double(x2);
y3 = double(x3);
keyi = RC6keygen(key,r);
plaintext(:,:,1) = reshape(y1',16,m*n/16)';
plaintext(:,:,2) = reshape(y2',16,m*n/16)';
plaintext(:,:,3) = reshape(y3',16,m*n/16)';
RC6enctext = x;
% CFB
for i = 1:3 plaintext1 = plaintext(:,:,i);
RC6enctextRC6 = RC6CFB(plaintext1,m,n,CO,r,keyi);
RC6enctextRC6 = reshape(RC6enctextRC6',n,m)';
RC6enctext(:,:,i) = RC6enctextRC6;
end;
xa = uint8(RC6enctext);
% ECB
for i = 1:L/16
plaintext = plaintext1(i,:);
RC6enctext = RC6enc(plaintext,r,keyi);
RC6enctextRC6(i,:) = RC6enctext;
end;
xa = uint8(RC6enctextRC6(:));
function xa = RC6EncECBImage(x,key,r)
%Encrypt Image using RC6 in ECB mode
[m,n] = size(x);
y = double(x);
keyi = RC6keygen(key,r);
plaintext1 = reshape(y',16,m*n/16)';
RC6enctextRC6 = zeros(m*n/16,16);
% ECB
for i = 1:m*n/16
plaintext = plaintext1(i,:);
RC6enctext = RC6enc(plaintext,r,keyi);
RC6enctextRC6(i,:) = RC6enctext;
end;
ya = reshape(RC6enctextRC6',n,m)';
xa = uint8(ya);
function xa = RC6EncECBImageC(x,key,r)
%Encrypt Colored Image using RC6 in ECB mode
x1 = x(:,:,1);
x2 = x(:,:,2);
x3 = x(:,:,3);
[m,n] = size(x1);
y1 = double(x1);
y2 = double(x2);
y3 = double(x3);
keyi = RC6keygen(key,r);
plaintext(:,:,1) = reshape(y1',16,m*n/16)';
plaintext(:,:,2) = reshape(y2',16,m*n/16)';
plaintext(:,:,3) = reshape(y3',16,m*n/16)';
RC6enctext = x;
% ECB
for i = 1:3 plaintext1 = plaintext(:,:,i);
RC6enctextRC6 = RC6ECB(plaintext1,m,n,r,keyi);
RC6enctextRC6 = reshape(RC6enctextRC6',n,m)';
RC6enctext(:,:,i) = RC6enctextRC6;
App en d i x A 265
end;
xa = uint8(RC6enctext);
plaintext = plaintext1(i,:);
if i == 1
cr = RC6enc(CO,r,keyi);
else
cr = RC6enc(cr,r,keyi);
end;
RC6enctext = bitxor(plaintext,cr);
RC6enctextRC6(i,:) = RC6enctext;
end;
xa = uint8(RC6enctextRC6(:));
function xa = RC6EncOFBImage(x,key,r,CO)
%Encrypt Image using RC6 in OFB mode
[m,n] = size(x);
y = double(x);
keyi = RC6keygen(key,r);
plaintext1 = reshape(y',16,m*n/16)';
RC6enctextRC6 = zeros(m*n/16,16);
% OFB
for i = 1:m*n/16
plaintext = plaintext1(i,:);
if i == 1
cr = RC6enc(CO,r,keyi);
else
cr = RC6enc(cr,r,keyi);
end;
RC6enctext = bitxor(plaintext,cr);
RC6enctextRC6(i,:) = RC6enctext;
end;
266 App en d i x A
ya = reshape(RC6enctextRC6',n,m)';
xa = uint8(ya);
function xa = RC6EncOFBImageC(x,key,r,CO)
%Encrypt Colored Image using RC6 in OFB mode
x1 = x(:,:,1);
x2 = x(:,:,2);
x3 = x(:,:,3);
[m,n] = size(x1);
y1 = double(x1);
y2 = double(x2);
y3 = double(x3);
keyi = RC6keygen(key,r);
plaintext(:,:,1) = reshape(y1',16,m*n/16)';
plaintext(:,:,2) = reshape(y2',16,m*n/16)';
plaintext(:,:,3) = reshape(y3',16,m*n/16)';
RC6enctext = x;
% OFB
for i = 1:3 plaintext1 = plaintext(:,:,i);
RC6enctextRC6 = RC6OFB(plaintext1,m,n,CO,r,keyi);
RC6enctextRC6 = reshape(RC6enctextRC6',n,m)';
RC6enctext(:,:,i) = RC6enctextRC6;
end;
xa = uint8(RC6enctext);
function s = keygen(key,r)
%RC6 Key Generation
p = [99 81 225 91];
q = [185 121 55 158];
s(1,:) = p;
for i = 2:2*r+4
s(i,:) = add(s(i-1,:),q);
end; i = 1;
a = zeros(1,4);
b = zeros(1,4);
v = 3*(2*r+4);
for h = 1:v
s(i,:) = add(s(i,:),a);
s(i,:) = add(s(i,:),b);
s(i,:) = shifting(s(i,:),3);
a = s(i,:);
key = add(key,a);
key = add(key,b);
key = shifting(key,LSB5(add(a,b)));
b = key;
App en d i x A 267
if i == 2*r+4
i = 1;
end
end
if i == 1
cr = RC6enc(CO,r,keyi);
else
cr = RC6enc(cr,r,keyi);
end;
RC
6enctext = bitxor(plaintext,cr); RC6enctextRC6(i,:)
= RC6enctext;
end;
fu
nction plaintextRC6 = RC6OFBDec(RC6enctext1,m,n,CO,r,
keyi)
%Decrypt data using RC6 in OFB mode
plaintextRC6 = zeros(m*n/16,16);
for i = 1:m*n/16
RC6enctextss = RC6enctext1(i,:);
if i = =1
cr = RC6enc (CO,r,keyi);
re_plaintext = bitxor(RC6enctextss,cr);
else
cr = RC6enc(cr,r,keyi);
re_plaintext = bitxor(RC6enctextss,cr);
end;
plaintextRC6(i,:) = re_plaintext;
end;
function y = RC6sub(x,w)
%z = a-a1mod 2^32
268 App en d i x A
a = frombase256(x);
a1 = frombase256(w);
z = mod(a-a1,2^32);
y = tobase256(z);
function y = shiftleft(key,round)
% RC6 Shifting
if (round = =1||round = =2||round = =9||round = =16)
y = circshift(key,1); else
y = circshift(key,2); end
function y = tobase256(x)
%convert Hex to 256 bits base
for i = 4:-1:1
y(i) = fix(x/256^(i-1)); x = x-(y(i)
*256^(i-1));
end
function c = add(a,b)
function y = binvec2decA(x)
%convert binary to decimal
y = 0;
for i = 1:length(x)
y = y+x(i)*2^(i-1);
end;
App en d i x A 269
left = xor_two;
end;
end;
y(1:32) = left; y(33:64) = right;
cipherdesBIN1 = finalpermutation(y);
cipherdesBIN1 = reshape(cipherdesBIN1,8,8)';
cipherdes1 = zeros(1,8);
for i = 1:8
cipherdes1(i) = binvec2decA(cipherdesBIN1
(i,end:-1:1));
end;
function y = Convert256toHex(x)
%convert 256 base numbers to Hex.
a = length(x);
j = 1;
y = zeros(1,2*a);
for i = 1:a
270 App en d i x A
function y = dec2binvecA(x,size)
%Convert decimal to binary
y = zeros(1,size);
z = zeros(1,size+1);
z(1) = x;
for i = 1:size
y(i) = mod(z(i),2^i)/2^(i-1);
z(i+1) = z(i)-y(i)*2^(i-1);
end;
% y = y(end:-1:1);
ip = InitialPermutation(cipherdes);
left = ip(1:32);
right = ip(33:64);
y(1:32) = left;
y(33:64) = right;
plaindesBIN1 = finalpermutation(y);
App en d i x A 2 71
plaindesBIN1 = reshape(plaindesBIN1,8,8)';
plaindes1 = zeros(1,8);
for i = 1:8
plaindes1(i) = binvec2decA(plaindesBIN1(i,
end:-1:1));
end;
fun
ction DESenctextDES = DESCBC(plaintext1,m,n,CO,r,
keyi)
%Encrypt data using DES in CBC mode
DESenctextDES = zeros(m*n/8,8);
for i = 1:m*n/8
plaintext = plaintext1(i,:);
if i == 1
plaintexts = bitxor(plaintext,CO);
else
plaintexts = bitxor(plaintext,DESenctext);
end;
DESenctext = cipher(plaintexts,r,keyi);
DESenctextDES(i,:) = DESenctext;
end;
fun
ction plaintextDES = DESCBCDec(DESenctext1,m,n,CO,
r,keyi)
%Decrypt data using DES in CBC mode
plaintextDES = zeros(m*n/8,8);
for i = 1:m*n/8
DESenctextss = DESenctext1(i,:);
re_plaintext = decry(DESenctextss,r,keyi);
if i == 1
plaintext = bitxor(re_plaintext,CO);
else
plaintext = bitxor(re_plaintext,DESenctext1
((i-1),:));
end;
plaintextDES(i,:) = plaintext;
end;
fun
ction ciphertextDES = DESCFB(plaintext1,m,n,CO,r,
keyi)
%Encrypt data using DES in CFB mode
ciphertextDES = zeros(m*n/8,8);
272 App en d i x A
for i = 1:m*n/8
plaintext = plaintext1(i,:);
if i == 1
cr1 = cipher(CO,r,keyi);
ciphertext = bitxor(plaintext,cr1);
else
cr1 = cipher(ciphertext,r,keyi);
ciphertext = bitxor(plaintext,cr1);
end;
ciphertextDES(i,:) = ciphertext;
end;
fun
ction plaintextDES = DESCFBDec(ciphertext1,m,n,CO,
r,keyi)
%decrypt data using DES in CFB mode
plaintextDES = zeros(m*n/8,8);
for i = 1:m*n/8
ciphertextss = ciphertext1(i,:);
if i = =1
cr1 = cipher(CO,r,keyi);
re_plaintext = bitxor(ciphertextss,cr1);
else
cr1 = cipher(ciphertext1(i-1,:),r,keyi);
re_plaintext = bitxor(ciphertextss,cr1);
end;
plaintextDES(i,:) = re_plaintext;
end;
fun
ction [xa1,Fs,nbits] = DesDecCBCAudio(x1,Fs,nbits,
key,r,CO)
%Decryption Audio using DES in CBC mode
keyi = DESkeygen(key,r);
%CBC L = length(x1);
y1 = double(x1);
plaintextDES = zeros(L/8,8);
ciphertext1 = reshape(y1,L/8,8);
App en d i x A 2 73
for i = 1:L/8
ciphertextss = ciphertext1(i,:);
re_plaintext = decry(ciphertextss,r,keyi);
if i == 1
plaintext = bitxor(re_plaintext,CO);
else
plaintext = bitxor(re_plaintext,ciphertext1
((i-1),:));
end;
plaintextDES(i,:) = plaintext;
end;
xa1 = uint8(plaintextDES(:));
keyi = DESkeygen(key,r);
%CBC
[m,n] = size(x1);
y1 = double(x1);
plaintextDES = zeros(m*n/8,8);
ciphertext1 = reshape(y1',8,m*n/8)';
for i = 1:m*n/8
ciphertextss = ciphertext1(i,:);
re_plaintext = decry(ciphertextss,r,keyi);
if i == 1
plaintext = bitxor(re_plaintext,CO);
else
plaintext = bitxor(re_plaintext,ciphertext1
((i-1),:));
end;
plaintextDES(i,:) = plaintext;
end;
ya1 = reshape(plaintextDES',n,m)';
xa1 = uint8(ya1);
keyi = DESkeygen(key,r);
%CBC
2 74 App en d i x A
x1 = x(:,:,1);
x2 = x(:,:,2);
x3 = x(:,:,3);
y1 = double(x1);
y2 = double(x2);
y3 = double(x3);
[m,n] = size(x1);
plaintext(:,:,1) = reshape(y1',8,m*n/8)';
plaintext(:,:,2) = reshape(y2',8,m*n/8)';
plaintext(:,:,3) = reshape(y3',8,m*n/8)';
ciphertext = x;
for i = 1:3
plaintextDES = plaintext(:,:,i);
DESenctext = DESCBCDec(plaintextDES,m,n,CO,r,keyi);
DESenctext = reshape(DESenctext',n,m)';
ciphertext(:,:,i) = DESenctext;
end;
a1 = uint8(ciphertext);
fun
ction [xa1,Fs,nbits] = DesDecCFBAudio(x1,Fs,nbits,
key,r,CO)
%Decrypt Audio using DES in CFB mode
keyi = DESkeygen(key,r);
%CFB L = length(x1);
y1 = double(x1);
plaintextDES = zeros(L/8,8);
ciphertext1 = reshape(y1,L/8,8);
for i = 1:L/8
ciphertextss = ciphertext1(i,:);
if i == 1
cr1 = cipher(CO,r,keyi);
re_plaintext = bitxor(ciphertextss,cr1);
else
cr1 = cipher(ciphertext1(i-1,:),r,keyi);
re_plaintext = bitxor(ciphertextss,cr1);
end;
plaintextDES(i,:) = re_plaintext;
end;
App en d i x A 275
xa1 = uint8(plaintextDES(:));
keyi = DESkeygen(key,r);
%CFB
[m,n] = size(x1);
y1 = double(x1);
plaintextDES = zeros(m*n/8,8);
ciphertext1 = reshape(y1',8,m*n/8)';
for i = 1:m*n/8
ciphertextss = ciphertext1(i,:);
if i == 1
cr1 = cipher(CO,r,keyi);
re_plaintext = bitxor(ciphertextss,cr1);
else
cr1 = cipher(ciphertext1(i-1,:),r,keyi);
re_plaintext = bitxor(ciphertextss,cr1);
end;
plaintextDES(i,:) = re_plaintext;
end;
ya1 = reshape(plaintextDES',n,m)';
xa1 = uint8(ya1);
keyi = DESkeygen(key,r);
%CFB
x1 = x(:,:,1);
x2 = x(:,:,2);
x3 = x(:,:,3);
y1 = double(x1);
y2 = double(x2);
y3 = double(x3);
[m,n] = size(x1);
plaintext(:,:,1) = reshape(y1',8,m*n/8)';
plaintext(:,:,2) = reshape(y2',8,m*n/8)';
plaintext(:,:,3) = reshape(y3',8,m*n/8)';
ciphertext = x;
for i = 1:3 plaintextDES = plaintext(:,:,i);
276 App en d i x A
DESenctext = DESCFBDec(plaintextDES,m,n,CO,r,keyi);
DESenctext = reshape(DESenctext',n,m)';
ciphertext(:,:,i) = DESenctext;
end
xa1 = uint8(ciphertext);
fun
ction [xa1,Fs,nbits] = DesDecECBAudio(x1,Fs,nbits,
key,r)
%Decrypt Audio using DES in ECB mode
keyi = DESkeygen(key,r);
%ECB L = length(x1);
y1 = double(x1);
plaintextDES = zeros(L/8,8);
ciphertext1 = reshape(y1,L/8,8);
for i = 1:L/8 ciphertextss = ciphertext1(i,:);
re_plaintext = decry(ciphertextss,r,keyi);
plaintextDES(i,:) = re_plaintext;
end;
xa1 = uint8(plaintextDES(:));
keyi = DESkeygen(key,r);
%ECB
[m,n] = size(x1);
y1 = double(x1);
plaintextDES = zeros(m*n/8,8);
ciphertext1 = reshape(y1',8,m*n/8)';
for i = 1:m*n/8
ciphertextss = ciphertext1(i,:);
re_plaintext = decry(ciphertextss,r,keyi);
plaintextDES(i,:) = re_plaintext;
end;
ya1 = reshape(plaintextDES',n,m)';
xa1 = uint8(ya1);
keyi = DESkeygen(key,r);
%ECB x1 = x(:,:,1);
App en d i x A 277
x2 = x(:,:,2);
x3 = x(:,:,3);
y1 = double(x1);
y2 = double(x2);
y3 = double(x3);
[m,n] = size(x1);
plaintext(:,:,1) = reshape(y1',8,m*n/8)';
plaintext(:,:,2) = reshape(y2',8,m*n/8)';
plaintext(:,:,3) = reshape(y3',8,m*n/8)';
ciphertext = x;
for i = 1:3 plaintextDES = plaintext(:,:,i);
DESenctext = DESECBDec(plaintextDES,m,n,r,keyi);
DESenctext = reshape(DESenctext',n,m)';
ciphertext(:,:,i) = DESenctext;
end
xa1 = uint8(ciphertext);
fun
ction [xa1,Fs,nbits] = DesDecOFBAudio(x1,Fs,nbits,
key,r,CO)
%Decrypt Audio using DES in OFB mode
keyi = DESkeygen(key,r);
%OFB L = length(x1);
y1 = double(x1);
plaintextDES = zeros(L/8,8);
ciphertext1 = reshape(y1,L/8,8);
for i = 1:L/8
ciphertextss = ciphertext1(i,:);
if i = =1
cr = cipher(CO,r,keyi);
re_plaintext = bitxor(ciphertextss,cr);
else cr = cipher(cr,r,keyi);
re_plaintext = bitxor(ciphertextss,cr);
end;
plaintextDES(i,:) = re_plaintext;
end;
xa1 = uint8(plaintextDES(:));
keyi = DESkeygen(key,r);
%OFB [m,n] = size(x1);
2 78 App en d i x A
y1 = double(x1);
plaintextDES = zeros(m*n/8,8);
ciphertext1 = reshape(y1',8,m*n/8)';
for i = 1:m*n/8
ciphertextss = ciphertext1(i,:);
if i == 1 cr = cipher(CO,r,keyi);
re_plaintext = bitxor(ciphertextss,cr);
else cr = cipher(cr,r,keyi);
re_plaintext = bitxor(ciphertextss,cr);
end;
plaintextDES(i,:) = re_plaintext;
end;
ya1 = reshape(plaintextDES',n,m)';
xa1 = uint8(ya1);
keyi = DESkeygen(key,r);
%OFB x1 = x(:,:,1);
x2 = x(:,:,2);
x3 = x(:,:,3);
y1 = double(x1);
y2 = double(x2);
y3 = double(x3);
[m,n] = size(x1);
plaintext(:,:,1) = reshape(y1',8,m*n/8)';
plaintext(:,:,2) = reshape(y2',8,m*n/8)';
plaintext(:,:,3) = reshape(y3',8,m*n/8)';
ciphertext = x;
for i = 1:3 plaintextDES = plaintext(:,:,i);
DESenctext = DESOFBDec(plaintextDES,m,n,CO,r,
keyi);
DESenctext = reshape(DESenctext',n,m)';
ciphertext(:,:,i) = DESenctext;
end
xa1 = uint8(ciphertext);
DESenctextDES = zeros(m*n/8,8);
for i = 1:m*n/8
plaintext = plaintext1(i,:);
DESenctext = cipher(plaintext,r,keyi);
App en d i x A 2 79
DESenctextDES(i,:) = DESenctext;
end;
fun
ction plaintextDES = DESECBDec(DESenctext1,m,n,r,
keyi)
%Decrypt data using DES in ECB mode
plaintextDES = zeros(m*n/8,8);
for i = 1:m*n/8
DESenctextss = DESenctext1(i,:);
re_plaintext = decry(DESenctextss,r,keyi);
plaintextDES(i,:) = re_plaintext;
end;
fun
ction [xa,Fs,nbits] = DesEncCBCAudio(x,Fs,nbits,
key,r,CO)
%Encrypt Audio using DES in CBC mode
L = length(x);
y = double(x);
keyi = DESkeygen(key,r);
plaintext1 = reshape(y,L/8,8);
ciphertextDES = zeros(L/8,8);
%CBC
for i = 1:L/8
plaintext = plaintext1(i,:);
if i == 1
plaintexts = bitxor(plaintext,CO);
else
plaintexts = bitxor(plaintext,ciphertext);
end;
ciphertext = cipher(plaintexts,r,keyi);
ciphertextDES(i,:) = ciphertext;
end;
xa = uint8(ciphertextDES(:));
function xa = DesEncCBCImage(x,key,r,CO)
%Encrypt Image using DES in CBC mode
[m,n] = size(x);
y = double(x);
keyi = DESkeygen(key,r);
plaintext1 = reshape(y',8,m*n/8)';
ciphertextDES = zeros(m*n/8,8);
280 App en d i x A
%CBC
for i = 1:m*n/8
plaintext = plaintext1(i,:);
if i = =1
plaintexts = bitxor(plaintext,CO);
else
plaintexts = bitxor(plaintext,ciphertext);
end;
ciphertext = cipher(plaintexts,r,keyi);
ciphertextDES(i,:) = ciphertext;
end;
ya = reshape(ciphertextDES',n,m)';
xa = uint8(ya);
function xa = DesEncCBCImageC(x,key,r,CO)
%Encrypt Colored Image using DES in CBC mode
x1 = x(:,:,1);
x2 = x(:,:,2);
x3 = x(:,:,3);
[m,n] = size(x1);
y1 = double(x1);
y2 = double(x2);
y3 = double(x3);
keyi = DESkeygen(key,r);
plaintext(:,:,1) = reshape(y1',8,m*n/8)';
plaintext(:,:,2) = reshape(y2',8,m*n/8)';
plaintext(:,:,3) = reshape(y3',8,m*n/8)';
DESenctext = x;
%CBC
for i = 1:3 plaintext1 = plaintext(:,:,i);
DESenctextDES = DESCBC(plaintext1,m,n,CO,r,keyi);
DESenctextDES = reshape(DESenctextDES',n,m)';
DESenctext(:,:,i) = DESenctextDES;
end;
xa = uint8(DESenctext);
fun
ction [xa,Fs,nbits] = DesEncCFBAudio(x,Fs,nbits,key,
r,CO)
%Encrypt Audio using DES in CFB mode
L = length(x);
y = double(x);
keyi = DESkeygen(key,r);
plaintext1 = reshape(y,L/8,8);
ciphertextDES = zeros(L/8,8);
App en d i x A 2 81
% CFB
for i = 1:L/8
plaintext = plaintext1(i,:);
if i = =1
cr1 = cipher(CO,r,keyi);
ciphertext = bitxor(plaintext,cr1);
else cr1 = cipher(ciphertext,r,keyi);
ciphertext = bitxor(plaintext,cr1);
end;
ciphertextDES(i,:) = ciphertext;
end;
xa = uint8(ciphertextDES(:));
function xa = DesEncCFBimage(x,key,r,CO)
%Encrypt Image using DES in CFB mode
[m,n] = size(x);
y = double(x);
keyi = DESkeygen(key,r);
plaintext1 = reshape(y',8,m*n/8)';
ciphertextDES = zeros(m*n/8,8);
% CFB
for i = 1:m*n/8
plaintext = plaintext1(i,:);
if i = =1
cr1 = cipher(CO,r,keyi);
ciphertext = bitxor(plaintext,cr1);
else cr1 = cipher(ciphertext,r,keyi);
ciphertext = bitxor(plaintext,cr1);
end;
ciphertextDES(i,:) = ciphertext;
end;
ya = reshape(ciphertextDES',n,m)';
xa = uint8(ya);
function xa = DesEncCFBImageC(x,key,r,CO)
%Encrypt Colored Image using DES in CFB mode
plaintext(:,:,3) = reshape(y3',8,m*n/8)';
DESenctext = x;
% CFB
for i = 1:3 plaintext1 = plaintext(:,:,i);
DESenctextDES = DESCFB(plaintext1,m,n,CO,r,keyi);
DESenctextDES = reshape(DESenctextDES',n,m)';
DESenctext(:,:,i) = DESenctextDES;
end;
xa = uint8(DESenctext);
function xa = DesEncECBImage(x,key,r)
%Encrypt Image using DES in ECB mode
[m,n] = size(x);
y = double(x); keyi = DESkeygen(key,r);
plaintext1 = reshape(y',8,m*n/8)';
ciphertextDES = zeros(m*n/8,8);
% ECB
for i = 1:m*n/8 plaintext = plaintext1(i,:);
ciphertext = cipher(plaintext,r,keyi);
ciphertextDES(i,:) = ciphertext;
function xa = DesEncECBImageC(x,key,r)
%Encrypt Colored Image using DES in ECB mode
x1 = x(:,:,1); x2 = x(:,:,2); x3 = x(:,:,3);
[m,n] = size(x1); y1 = double(x1);
y2 = double(x2);
y3 = double(x3); keyi = DESkeygen(key,r);
plaintext(:,:,1) = reshape(y1',8,m*n/8)';
App en d i x A 283
plaintext(:,:,2) = reshape(y2',8,m*n/8)';
plaintext(:,:,3) = reshape(y3',8,m*n/8)';
DESenctext = x;
fun
ction [xa,Fs,nbits] = DesEncOFBAudio(x,Fs,nbits,
key,r,CO)
%Encrypt Audio using DES in OFB mode
L = length(x);
y = double(x); keyi = DESkeygen(key,r);
plaintext1 = reshape(y,L/8,8);
ciphertextDES = zeros(L/8,8);
% OFB
for i = 1:L/8 plaintext = plaintext1(i,:); if i == 1
cr = cipher(CO,r,keyi);
else cr = cipher(cr,r,keyi);
end; ciphertext = bitxor(plaintext,cr);
ciphertextDES(i,:) = ciphertext;
end;
xa = uint8(ciphertextDES(:));
function xa = DesEncOFBImage(x,key,r,CO)
%Encrypt Image using DES in OFB mode
[m,n] = size(x);
y = double(x); keyi = DESkeygen(key,r);
plaintext1 = reshape(y',8,m*n/8)';
ciphertextDES = zeros(m*n/8,8);
% OFB
for i = 1:m*n/8 plaintext = plaintext1(i,:); if i == 1
cr = cipher(CO,r,keyi);
else cr = cipher(cr,r,keyi);
end; ciphertext = bitxor(plaintext,cr);
ciphertextDES(i,:) = ciphertext;
end; ya = reshape(ciphertextDES',n,m)'; xa = uint8(ya);
function xa = DesEncOFBImageC(x,key,r,CO)
%Encrypt Colored Image using DES in OFB mode
28 4 App en d i x A
x1 = x(:,:,1);
x2 = x(:,:,2);
x3 = x(:,:,3);
[m,n] = size(x1);
y1 = double(x1);
y2 = double(x2);
y3 = double(x3);
keyi = DESkeygen(key,r);
plaintext(:,:,1) = reshape(y1',8,m*n/8)';
plaintext(:,:,2) = reshape(y2',8,m*n/8)';
plaintext(:,:,3) = reshape(y3',8,m*n/8)';
DESenctext = x;
% OFB
for i = 1:3 plaintext1 = plaintext(:,:,i);
DESenctextDES = DESOFB(plaintext1,m,n,CO,r,keyi);
DESenctextDES = reshape(DESenctextDES',n,m)';
DESenctext(:,:,i) = DESenctextDES;
end;
xa = uint8(DESenctext);
% Mainkey = [
'A';'A';'B';'B';'0';'9';'1';'8';'2';'7';'
3';'6';'C';'C';'D';'D'];
key2 = Convert256toHex(Mainkey);
key = zeros(r,4); for i = 1:r
key(i,:) = dec2binvecA(key2(i),4); end
key = rot90(key);
key = key(:);
a = [
57 49 41 33 25 17 9 1 58 50 42 34 26 18 10 2 59
51 43 35 27 19 11 3 60 52 44 36 63 55 47 39 31
23 15 7 62 54 46 38 30 22 14 6 61 53 45 37 29 21
13 5 28 20 12 4];
b = [
14 17 11 24 1 5 3 28 15 6 21 10 23 19 12 4 26 8
16 7 27 20 13 2 41 52 31 37 47 55 30 40 51 45 33
48 44 49 39 56 34 53 46 42 50 36 29 32];
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
output1 = key(a);
key1 = zeros(r,48);
left = output1(28:-1:1);
App en d i x A 285
right = output1(56:-1:29);
for i = 1:r
left = shiftleft(left,i);
right = shiftleft(right,i);
output(28:-1:1) = left;
output(56:-1:29) = right;
key1(i,:) = output(b);
end
fun
ction ciphertextDES = DESOFB(plaintext1,m,n,CO,r,
keyi)
%Encrypt data using DES in OFB mode
ciphertextDES = zeros(m*n/8,8);
for i = 1:m*n/8
plaintext = plaintext1(i,:);
if i == 1
cr = cipher(CO,r,keyi);
else
cr = cipher(cr,r,keyi);
end;
ciphertext = bitxor(plaintext,cr);
ciphertextDES(i,:) = ciphertext;
end;
fun
ction plaintextDES = DESOFBDec(ciphertext1,m,n,CO,
r,keyi)
%Decrypt data using DES in OFB mode
plaintextDES = zeros(m*n/8,8);
for i = 1:m*n/8
ciphertextss = ciphertext1(i,:);
if i = =1
cr = cipher (CO,r,keyi);
re_plaintext = bitxor(ciphertextss,cr);
else cr = cipher(cr,r,keyi);
re_plaintext = bitxor(ciphertextss,cr);
end;
plaintextDES(i,:) = re_plaintext;
end;
286 App en d i x A
function y = sub(in)
%DES substitution
in1 = reshape(in',6,8)';
x = zeros(1,8);
for i = 1:8
x(i) = binvec2decA(in1(i,end:-1:1));
end;
s =
[14 0 4 15 13 7 1 4 2 14 15 2 11 13 8 1 3 10 10 6 6
12 12 11 5 9 9 5 0 3 7 8 4 15 1 12 14 8 8 2 13 4 6
9 2 1 11 7 15 5 12 11 9 3 7 14 3 10 10 0 5 6 0 13;
15 3 1 13 8 4 14 7 6 15 11 2 3 8 4 14 9 12 7 0 2 1
13 10 12 6 0 9 5 11 10 5 0 13 14 8 7 10 11 1 10 3 4
15 13 4 1 2 5 11 8 6 12 7 6 12 9 0 3 5 2 14 15 9;
10 13 0 7 9 0 14 9 6 3 3 4 15 6 5 10 1 2 13 8 12 5
7 14 11 12 4 11 2 15 8 1 13 1 6 10 4 13 9 0 8 6 15
9 3 8 0 7 11 4 1 5 2 14 12 3 5 11 10 5 14 2 7 12;
7 13 13 8 14 11 3 5 0 6 6 15 9 0 10 3 1 4 2 7 8 2 5
12 11 1 12 10 4 14 15 9 10 3 6 15 9 0 0 6 12 10 11
1 7 13 13 8 15 9 1 4 3 5 14 11 5 12 2 7 8 2 4 14;
2 14 12 11 4 2 1 12 7 4 10 7 11 13 6 1 8 5 5 0 3
15 15 10 13 3 0 9 14 8 9 6 4 11 2 8 1 12 11 7
10 1 13 14 7 2 8 13 15 6 9 15 12 0 5 9 6 10 3 4
0 5 14 3;
12 10 1 15 10 4 15 2 9 7 2 12 6 9 8 5 0 6 13 1 3 13
4 14 14 0 7 11 5 3 11 8 9 4 14 3 15 2 5 12 2 9 8 5
12 15 3 10 7 11 0 14 4 1 10 7 1 6 13 0 11 8 6 13;
4 13 11 0 2 11 14 7 15 4 0 9 8 1 13 10 3 14 12 3 9
5 7 12 5 2 10 15 6 8 1 6 1 6 4 11 11 13 13 8 12 1 3
4 7 10 14 7 10 9 15 5 6 0 8 15 0 14 5 2 9 3 2 12;
13 1 2 15 8 13 4 8 6 10 15 3 11 7 1 4 10 12 9 5 3 6
14 11 5 0 0 14 12 9 7 2 7 2 11 1 4 14 1 7 9 4 12 10
14 8 2 13 0 15 6 12 10 9 13 0 15 3 3 5 5 6 8 11];
out1 = zeros(1,8);
for i = 1:8
out1(i) = s(i,x(i)+1);
end
out = zeros(8,4);
for i = 1:8
out(i,:) = dec2binvecA(out1(i),4);
end
out = rot90(out);
y = out(:);
a = [
32,1,2,3,4,5,4,5,6,7,8,9,8,9,10,11,12,13,12,13,14,
15,16,17,16,17,18,19,20,21,20,21,22,23,24,25,24,25,
26,27,28,29,28,29,30,31,32,1];
expansion = right(a);
function y = finalpermutation(x)
%DES final permutation
a = [
40 8 48 16 56 24 64 32 39 7 47 15 55 23 63 31 38
6 46 14 54 22 62 30 37 5 45 13 53 21 61 29 36 4 44
12 52 20 60 28 35 3 43 11 51 19 59 27 34 2 42 10
50 18 58 26 33 1 41 9 49 17 57 25];
y = x(a);
function y = frombase256(x)
%Convert 256 base number to decimal
y = 0;
for i = 1:4
y = y+(x(i)*256^(i-1));
end
function ip = InitialPermutation(plaindes)
%DES Initial Permutation
a = [
58 50 42 34 26 18 10 2 60 52 44 36 28 20 12 4 62
54 46 38 30 22 14 6 64 56 48 40 32 24 16 8 57 49
41 33 25 17 9 1 59 51 43 35 27 19 11 3 61 53 45 37
29 21 13 5 63 55 47 39 31 23 15 7];
ip = plaindes(a);
function y = LSB5(x)
%return the 5 least significant bits of x
y = dec2bin(x(1),8);
u = y(8:-1:3); u = u(end:-1:1);
y = bin2dec(u);
function y = CHaoticCipher(im)
% This function encrypts square image using baker map
im = double(im);
n =
[10,5,12,5,10,8,14,10,5,12,5,10,8,14,10,5,12,5,10,8,
14,10,5,12,5,10,8,14,10,5,12,5,10,8,14,10,5,12,5,10,
8,14,10,5,12,5,10,8,14,10,5,12,5,10,8,14,];
[pr,pc] = chaomat(n);
pim = chaoperm(im,pr,pc,3,'forward');
y = uint8(pim);
imshow(y);
288 App en d i x A
N(1) = 1;
for cb = 1:k
for rb = 1:n(cb)
rbstartcol(rb) = mod((rb-1)*I,n(cb));
rbendcol(rb) = mod((rb*I-1),n(cb));
rbstartrow(rb) = fix(((rb-1)*I)/n(cb));
rbendrow(rb) = fix((rb*I-1)/n(cb));
mincol(rb) = min([rbendcol(rb)+1,rbstartcol(rb)]);
maxcol(rb) = max([rbendcol(rb),rbstartcol(rb)-1]);
end
for i = 1:I
for j = N(cb):N(cb+1)-1
newindex(i,j-N(cb)+1) = (i-1)*n(cb)+(n(cb)-
j+N(cb)-1);
newindexmod(i,j-N(cb)+1) = mod(newindex(i,j-
N(cb)+1),n(cb));
newindexquotient(i,j-N(cb)+1) = fix(newindex(i,j-
N(cb)+1)/n(cb));
rowblockindex(i,j-N(cb)+1) = fix(newindex(i,j-
N(cb)+1)/I)+1;
end
end
for i = 1:I
for j = 1:n(cb)
for rb = 1:n(cb)
if rowblockindex(i,j) = =rb;
if newindexmod(i,j)>maxcol(rb)
col = rbendrow(rb)-
newindexquotient(i,j)+(n(cb)-1-
newindexmod(i,j))*(rbendrow(rb)-
rbstartrow(rb));
elseif newindexmod(i,j)> = mincol(rb) &
newindexmod(i,j)< = maxcol(rb)
App en d i x A 289
if rbstartcol(rb)>rbendcol(rb)
c = 0;
d = -1;
else
c = 1;
d = 1;
end
col = (rbendrow(rb)-
rbstartrow(rb))*(n(cb)-1-
maxcol(rb))+(rbendrow(rb)-newindexquot
ient(i,j)+c)+(maxcol(rb)-
newindexmod(i,j))*(rbendrow(rb)-
rbstartrow(rb)+d);
else%if newindexmod(i,j)< = mincol(rb)
col = I-mincol(rb)*(rbendrow(rb)-
rbstartrow(rb))+(rbendrow(rb)-newindex
quotient(i,j)+1)+(mincol(rb)-1-
newindexmod(i,j))*(rbendrow(rb)-
rbstartrow(rb));
end
row = 1+I-N(cb+1)+rowblockindex(i,j);
end
end
pr(i,j+N(cb)-1) = row;
pc(i,j+N(cb)-1) = col;
end
end
end
%
[rows,cols] = size(im);
mat = zeros([rows,cols,num+1]);
mat(:,:,1) = im(:,:);
for loc = 2:num+1
if(strcmp(forward,'forward'))
for i = 1:rows
for j = 1:cols
mat(pr(i,j),pc(i,j),loc) =
mat(i,j,loc-1);
end
end
elseif(strcmp(forward,'backward'))
for i = 1:rows
290 App en d i x A
for j = 1:cols
mat(i,j,loc) = mat(pr(i,j),pc(i,j),loc-1);
end
end
end
end
out = mat(:,:,num+1);
function ID = IDMF(x,y)
%this fuunction(irregular Deviation Measuring Factor) is
based on how much the deviation cased by encryption is
%irregular.
%x:-Original Image
%y:-Encrypted Image
%D:-Maximum Deviation Measuring Factor
x = double(x);
y = double(y);
%first,calculate the difference between each pixel
value before and after
%encryption
D = uint8(abs(x-y));
%calculate the H histogram of the difference
H = imhist(D)
%calculate the average of H
DC = 0;
for i = 1:256
DC = DC+H(i);
end
DC = DC/256;
%subtract the DC from H at every point
for i = 1:256
AC(i) = abs(H(i)-DC);
end
%calculate the sum of AC
ID = 0;
for i = 1:256
ID = ID+AC(i);
End;
%the lower the value, the better the encryption
function D = MDMF(x,y)
%t
his fuunction calculates the Maximum Deviation
Measuring Factor which
%c
alculates the deviation between the original and
encrypted image.
App en d i x A 2 91
%x:-Original Image
%y:-Encrypted Image
%D:-Maximum Deviation Measuring Factor
%f
irst,calculate the histogram between the original
and encrypted image
x1 = imhist(x);
y1 = imhist(y);
%then calculate the difference between the two
diff = abs(y1-x1);
%then calculate D as follows
D1 = 0;
for i = 2:255
D1 = D1+diff(i);
end;
D2 = (diff(1)+diff(255))/2;
D = D1+D2;
function y = psnr(im1,im2)
%Peak Signal to Noise Ratio
MSEa = 0;
[m,n] = size(im1);
im1 = double(im1);
im2 = double(im2);
for i = 1:m
for j = 1:n
x = double(im1(i,j)-im2(i,j));
x1 = x^2/(m*n);
MSEa = MSEa+x1;
end;
end;
MSEa = double(MSEa);
y = 10*log10((255^2)/MSEa);
Appendix B
f = imread ('Cameraman.tif');
[M,N] = size(f) ;
g1 = im2col(f, [M,N], [M,N], 'distinct');
h1 = dec2bin(double(g1));
[M1,N1] = size(h1) ;
z1 = zeros (M1,N1) ;
for i = 1
M1
for j = 1: N1
z1(i,j) = str2num(h1(i,j));
end;
end;
[R1,T1] = size(z1) ;
zz1 = reshape(z1,R1*T1, 1);
% The transmitted data ...............................
zz = [zz1];
trel = poly2trellis(7,[171 133]);% Trellis
data1 = zz;
zz = convenc(data1,trel);
s1 = length(zz);
para = 128;
293
294 App en d i x B
fftlen = para;
noc = para;
ofdm_length = para*nd*ml; %Total no for one loop
demodata1 = zeros(ofdm_length,nloops);
for jj = 1: nloops % loop for columns
serdata1 = input_data2(:,jj)';
demodata = fft_channel(serdata1,para,nd,ml,gilen,fftl
en,sr,ebno, br);
demodata1(:,jj) = demodata(: ); % the
output of ofdm columns
end
yy1 = reshape(yy11,[R1,T1]);
for i = 1: M1
App en d i x B 295
for j = 1: N1
zn1(i,j) = num2str(yy1(i,j));
end;
end;
hn1 = bin2dec(zn1);
gn1 = col2im(hn1, [M,N], [M,N], 'distinct');
%The Error between Trans ............................
output_image = gn1/255;
output_image1 = medfilt2(output_image);
MSE11 = s
um(sum((double(f)/255-output_image1).^2))/
prod(size(f));
PSNR1 = 10*log(1/MSE11)/log(10);
end
demodata1 = zeros(ofdm_length,nloops);
for jj = 1: nloops % loop for columns
serdata1 = input_data2(:,jj)';
demodata =
dct_channel(serdata1,para,nd,ml,gilen,f
ftlen,sr,ebno, br);
demodata1(:,jj) =
demodata(: ); % the output of
ofdm columns
end
yy1 = reshape(yy11,[R1,T1]);
296 App en d i x B
for i = 1: M1
for j = 1: N1
zn1(i,j) = num2str(yy1(i,j));
end;
end;
hn1 = bin2dec(zn1);
gn1 = col2im(hn1, [M,N], [M,N], 'distinct');
%The Error between Trans .......................
output_image = gn1/255;
output_image1 = medfilt2(output_image);
end
%Transmission ON DWT_OFDM ............................
demodata1 = zeros(ofdm_length,nloops);
for jj = 1: nloops % loop for columns
serdata1 = input_data2(:,jj)';
demodata =
dwt_channel(serdata1,para,nd,ml,gilen
,fftlen,sr,ebno, br);
demodata1(:,jj) =
demodata(: ); % the
output of ofdm
columns
end
yy1 = reshape(yy11,[R1,T1]);
App en d i x B 297
for i = 1: M1
for j = 1: N1
zn1(i,j) = num2str(yy1(i,j));
end;
end;
hn1 = bin2dec(zn1);
gn1 = col2im(hn1, [M,N], [M,N], 'distinct');
%The Error between Trans ............................
output_image = gn1/255;
output_image1 = medfilt2(output_image);
end
f = imread ('Cameraman.tif');
[M,N] = size(f) ;
g1 = im2col(f, [M,N], [M,N], 'distinct');
h1 = dec2bin(double(g1));
[M1,N1] = size(h1) ;
z1 = zeros (M1,N1) ;
for i = 1: M1
for j = 1: N1
z1(i,j) = str2num(h1(i,j));
end;
end;
[R1,T1] = size(z1) ;
zz1 = reshape(z1,R1*T1, 1);
% The transmitted data ...............................
zz = [zz1];
%ENCODING ............................................
trel = poly2trellis(7,[171 133]);% Trellis
data1 = zz;
298 App en d i x B
zz = convenc(data1,trel);
s1 = length(zz);
para = 128;
nd = 6; %number of information OFDM symbol for one loop
ml = 2; %Modulation level: QPSK
sr = 250000; %symbol rate
br = sr.*ml; %Bit rat per carrier
Ipoint = 8;%Number of over samples
gilen = 32;
flat = 1;
fd = 600;
dctlen = para;
noc = para;
ofdm_length = para*nd*ml; %Total no for one loop
demodata1 = zeros(ofdm_length,nloops);
for jj = 1: nloops % loop for columns
serdata1 = input_data2(:,jj)';
demodata =
fft_channel_clipping_companding(serda
ta1,para,nd,ml,gilen,dctlen,sr,ebno,
br);
demodata1(:,jj) =
demodata(: ); % the
output of ofdm
columns
end
%DECODING ............................................
yy11 = vitdec(yy11',trel,1,'term','hard');% Decode.
yy1 = reshape(yy11,[R1,T1]);
for i = 1: M1
for j = 1: N1
zn1(i,j) = num2str(yy1(i,j));
end;
end;
hn1 = bin2dec(zn1);
gn1 = col2im(hn1, [M,N], [M,N], 'distinct');
%The Error between Trans ..............................
output_image = gn1/255;
output_image1 = medfilt2(output_image);
MSE11 = sum(sum((double(f)/255-output_image1).^2))/
prod(size(f));
PSNR1 = 10*log(1/MSE11)/log(10);
end
demodata1 = zeros(ofdm_length,nloops);
for jj = 1: nloops % loop for columns
serdata1 = input_data2(:,jj)';
demodata =
dct_channel_clipping_companding(serda
ta1,para,nd,ml,gilen,dctlen,sr,ebno,
br);
demodata1(:,jj) = demodata(: ); % the
output of ofdm columns
end
yy = reshape (demodata1,Mr*Nr,1);%
part1 = yy(1: s1);
yy11 = part1;
%DECODING ............................................
yy11 = vitdec(yy11',trel,1,'term','hard');% Decode.
yy1 = reshape(yy11,[R1,T1]);
for i = 1: M1
for j = 1: N1
zn1(i,j) = num2str(yy1(i,j));
end;
end;
hn1 = bin2dec(zn1);
gn1 = col2im(hn1, [M,N], [M,N], 'distinct');
%The Error between Trans .......................
output_image = gn1/255;
output_image1 = medfilt2(output_image);
MSE11 = s
um(sum((double(f)/255-output_image1).^2))/
prod(size(f));
PSNR1 = 10*log(1/MSE11)/log(10);
end
demodata1 = zeros(ofdm_length,nloops);
for jj = 1: nloops % loop for columns
serdata1 = input_data2(:,jj)';
demodata =
dwt_channel_clipping_companding(serda
ta1,para,nd,ml,gilen,dctlen,sr,ebno,
br);
demodata1(:,jj) =
demodata(: ); % the
output of ofdm
columns
end
App en d i x B 3 01
yy1 = reshape(yy11,[R1,T1]);
for i = 1: M1
for j = 1: N1
zn1(i,j) = num2str(yy1(i,j));
end;
end;
hn1 = bin2dec(zn1);
gn1 = col2im(hn1, [M,N], [M,N], 'distinct');
%The Error between Trans ..............................
output_image = gn1/255;
output_image1 = medfilt2(output_image);
MSE11 = s
um(sum((double(f)/255-output_image1).^2))/
prod(size(f));
PSNR1 = 10*log(1/MSE11)/log(10);
end
z1(i,j) = str2num(h1(i,j));
end;
end;
[R1,T1] = size(z1) ;
zz1 = reshape(z1,R1*T1, 1);
% The transmitted data ............... ...............
zz = [zz1];
%ENCODING ............................................
trel = poly2trellis(7,[171 133]);% Trellis
data1 = zz;
zz = convenc(data1,trel);
s1 = length(zz);
para = 128;
nd = 6;
%number of information OFDM symbol for one
loop
m1 = 2; %Modulation level: QPSK
sr = 250000; %symbol rate
br = sr.*m1; %Bit rat per carrier
Ipoint = 8;%Number of over samples
gilen = 32;
flat = 1;
fd = 600;
fftlen = para;
noc = para;
ofdm_length = para*nd*m1; %Total no for one
loop
demodata1 = zeros(ofdm_length,nloops);
for jj = 1: nloops % loop for columns
serdata = input_data2(:,jj)';
demodata =
fft_channel_estimation_no_mapping_cli
pping(serdata,para,nd,m1,gilen,fftlen
,sr,ebno, br,fd,flat);
App en d i x B 303
demodata1(:,jj) =
demodata(: ); % the
output of ofdm
columns
end
yy1 = reshape(yy11,[R1,T1]);
for i = 1: M1
for j = 1: N1
zn1(i,j) = num2str(yy1(i,j));
end;
end;
hn1 = bin2dec(zn1);
gn1 = col2im(hn1, [M,N], [M,N], 'distinct');
%The Error between Trans .......................
output_image = gn1/255;
output_image1 = medfilt2(output_image);
MSE11 = s
um(sum((double(f)/255-output_image1).^2))/
prod(size(f));
PSNR1 = 10*log(1/MSE11)/log(10);
end
demodata1 = zeros(ofdm_length,nloops);
for jj = 1: nloops % loop for columns
304 App en d i x B
serdata = input_data2(:,jj)';
demodata =
dct_channel_estimation_no_mapping_cli
pping(serdata,para,nd,m1,gilen,fftlen
,sr,ebno, br,fd,flat);
demodata1(:,jj) =
demodata(: ); % the
output of ofdm
columns
end
yy1 = reshape(yy11,[R1,T1]);
for i = 1: M1
for j = 1: N1
zn1(i,j) = num2str(yy1(i,j));
end;
end;
hn1 = bin2dec(zn1);
gn1 = col2im(hn1, [M,N], [M,N], 'distinct');
%The Error between Trans ............................
output_image = gn1/255;
output_image1 = medfilt2(output_image);
MSE11 = s
um(sum((double(f)/255-output_image1).^2))/
prod(size(f));
PSNR1 = 10*log(1/MSE11)/log(10);
end
demodata1 = zeros(ofdm_length,nloops);
for jj = 1: nloops % loop for columns
serdata = input_data2(:,jj)';
demodata =
dwt_channel_estimation_no_mapping_cli
pping(serdata,para,nd,m1,gilen,fftlen
,sr,ebno, br,fd,flat);
demodata1(:,jj) = demodata(: ); % the
output of ofdm
columns
end
yy1 = reshape(yy11,[R1,T1]);
for i = 1: M1
for j = 1: N1
zn1(i,j) = num2str(yy1(i,j));
end;
end;
hn1 = bin2dec(zn1);
gn1 = col2im(hn1, [M,N], [M,N], 'distinct');
%The Error between Trans ............................
output_image = gn1/255;
output_image1 = medfilt2(output_image);
MSE11 = s
um(sum((double(f)/255-output_image1).^2))/
prod(size(f));
PSNR1 = 10*log(1/MSE11)/log(10);
end
306 App en d i x B
fftlen = para;
noc = para;
ofdm_length = para*nd*ml; %Total no for one loop
nloops = ceil((length(zz))/ofdm_length);
new_data = nloops*ofdm_length ;
App en d i x B 307
demodata1 = zeros(ofdm_length,nloops);
for jj = 1: nloops % loop for columns
serdata = input_data2(:,jj)';
demodata =
fft_channel_offset_g(serdata,para,nd,
m1,gilen,fftlen,sr,ebno, br,epsilon);
demodata1(:,jj) = demodata(: ); % the
output of ofdm
columns
end
yy1 = reshape(yy11,[R1,T1]);
for i = 1: M1
for j = 1: N1
zn1(i,j) = num2str(yy1(i,j));
end;
end;
hn1 = bin2dec(zn1);
gn1 = col2im(hn1, [M,N], [M,N], 'distinct');
%The Error between Trans ............................
output_image = gn1/255;
output_image1 = medfilt2(output_image);
MSE11 = s
um(sum((double(f)/255-output_image1).^2))/
prod(size(f));
PSNR1 = 10*log(1/MSE11)/log(10);
end
demodata1 = zeros(ofdm_length,nloops);
for jj = 1: nloops % loop for columns
serdata1 = input_data2(:,jj)';
demodata =
dct_channel_offset_g(serdata1,para,
nd,m1,gilen,fftlen,sr,ebno,
br,epsilon);
demodata1(:,jj) =
demodata(: ); % the
output of ofdm
columns
end
yy1 = reshape(yy11,[R1,T1]);
for i = 1: M1
for j = 1: N1
zn1(i,j) = num2str(yy1(i,j));
end;
end;
hn1 = bin2dec(zn1);
gn1 = col2im(hn1, [M,N], [M,N], 'distinct');
%The Error between Trans ............................
output_image = gn1/255;
output_image1 = medfilt2(output_image);
MSE1 = s
um(sum((double(f)/255-output_image).^2))/
prod(size(f));
PSNR = 10*log(1/MSE1)/log(10)
MSE11 = s
um(sum((double(f)/255-output_image1).^2))/
prod(size(f));
PSNR1 = 10*log(1/MSE11)/log(10);
end
demodata1 = zeros(ofdm_length,nloops);
for jj = 1: nloops % loop for columns
serdata1 = input_data2(:,jj)';
demodata =
dwt_channel_offset_g(serdata1,para,
nd,m1,gilen,fftlen,sr,ebno,
br,epsilon);
demodata1(:,jj) =
demodata(: ); % the
output of ofdm
columns
end
yy1 = reshape(yy11,[R1,T1]);
for i = 1: M1
for j = 1: N1
zn1(i,j) = num2str(yy1(i,j));
end;
end;
hn1 = bin2dec(zn1);
gn1 = col2im(hn1, [M,N], [M,N], 'distinct');
%The Error between Trans ............................
output_image = gn1/255;
310 App en d i x B
output_image1 = medfilt2(output_image);
MSE11 = s
um(sum((double(f)/255-output_image1).^2))/
prod(size(f));
PSNR1 = 10*log(1/MSE11)/log(10);
end
f = imread ('Cameraman.tif');
[M,N] = size(f) ;
g1 = im2col(f, [M,N], [M,N], 'distinct');
h1 = dec2bin(double(g1));
[M1,N1] = size(h1) ;
z1 = zeros (M1,N1) ;
for i = 1: M1
for j = 1: N1
z1(i,j) = str2num(h1(i,j));
end;
end;
[R1,T1] = size(z1) ;
zz1 = reshape(z1,R1*T1, 1);
% The transmitted data ............... ...............
............... .......
zz = [zz1];
trel = poly2trellis(7,[171 133]);% Trellis
data1 = zz;
zz = convenc(data1,trel);
s1 = length(zz);
para = 128;
nd = 6; %number of information OFDM symbol for one loop
m1 = 2; %Modulation level: QPSK
sr = 250000; %symbol rate
br = sr.*ml; %Bit rate per carrier
Ipoint = 8;%Number of over samples
gilen = 32;
App en d i x B 311
flat = 1;
fd = 600;
epsilon = 0.1;
fftlen = para;
noc = para;
ofdm_length = para*nd*ml; %Total no for one loop
demodata1 = zeros(ofdm_length,nloops);
for jj = 1: nloops % loop for columns
serdata = input_data2(:,jj)';
demodata =
fft_channel_offset_zg(serdata,para,
nd,m1,gilen,fftlen,sr,ebno,
br,epsilon);
demodata1(:,jj) = demodata(: ); % the
output of ofdm
columns
end
yy1 = reshape(yy11,[R1,T1]);
for i = 1: M1
for j = 1: N1
zn1(i,j) = num2str(yy1(i,j));
end;
end;
312 App en d i x B
hn1 = bin2dec(zn1);
gn1 = col2im(hn1, [M,N], [M,N], 'distinct');
%The Error between Trans ............................
output_image = gn1/255;
output_image1 = medfilt2(output_image);
MSE11 = s
um(sum((double(f)/255-output_image1).^2))/
prod(size(f));
PSNR1 = 10*log(1/MSE11)/log(10);
end
demodata1 = zeros(ofdm_length,nloops);
for jj = 1: nloops % loop for columns
serdata1 = input_data2(:,jj)';
demodata =
dct_channel_offset_zg(serdata1,para,n
d,m1,gilen,fftlen,sr,ebno,
br,epsilon);
demodata1(:,jj) =
demodata(: ); % the
output of ofdm
columns
end
yy1 = reshape(yy11,[R1,T1]);
App en d i x B 313
for i = 1: M1
for j = 1: N1
zn1(i,j) = num2str(yy1(i,j));
end;
end;
hn1 = bin2dec(zn1);
gn1 = col2im(hn1, [M,N], [M,N], 'distinct');
%The Error between Trans ............................
output_image = gn1/255;
output_image1 = medfilt2(output_image);
MSE11 = s
um(sum((double(f)/255-output_image1).^2))/
prod(size(f));
PSNR1 = 10*log(1/MSE11)/log(10);
end
demodata1 = zeros(ofdm_length,nloops);
for jj = 1: nloops % loop for columns
serdata1 = input_data2(:,jj)';
demodata =
dwt_channel_offset_zg(serdata1,para,n
d,m1,gilen,fftlen,sr,ebno,
br,epsilon);
demodata1(:,jj) =
demodata(: ); % the
output of ofdm
columns
end
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%DECODING ...........
yy11 = vitdec(yy11',trel,1,'term','hard');% Decode.
yy1 = reshape(yy11,[R1,T1]);
for i = 1: M1
for j = 1: N1
zn1(i,j) = num2str(yy1(i,j));
end;
end;
hn1 = bin2dec(zn1);
gn1 = col2im(hn1, [M,N], [M,N], 'distinct');
%The Error between Trans ............................
output_image = gn1/255;
output_image1 = medfilt2(output_image);
MSE11 = s
um(sum((double(f)/255-output_image1).^2))/
prod(size(f));
PSNR1 = 10*log(1/MSE11)/log(10);
end
%Transmitter .........................................
end;
[R1,T1] = size(z1) ;
zz1 = reshape(z1,R1*T1, 1);
% The transmitted data ...............................
zz = [zz1];
%ENCODING ............................................
trel = poly2trellis(7,[171 133]);% Trellis
data1 = zz;
zz = convenc(data1,trel);
s1 = length(zz);
para = 128;
nd = 6; %
number of information OFDM symbol for one
loop
m1 = 2; %Modulation level: QPSK
sr = 250000; %symbol rate
br = sr.*m1; %Bit rate per carrier
Ipoint = 8;%Number of over samples
gilen = 32;
flat = 1;
fd = 600;
fftlen = para;
noc = para;
ofdm_length = para*nd*m1; %Total no for one loop
demodata1 = zeros(ofdm_length,nloops);
for jj = 1: nloops % loop for columns
serdata = input_data2(:,jj)';
demodata =
fft_channel_estimation_no_mapping_g(s
erdata,para,nd,m1,gilen,fftlen,sr,e
bno, br,fd,flat);
316 App en d i x B
demodata1(:,jj) =
demodata(: ); % the
output of ofdm
columns
end
yy1 = reshape(yy11,[R1,T1]);
for i = 1: M1
for j = 1: N1
zn1(i,j) = num2str(yy1(i,j));
end;
end;
hn1 = bin2dec(zn1);
gn1 = col2im(hn1, [M,N], [M,N], 'distinct');
%The Error between Trans ............................
output_image = gn1/255;
output_image1 = medfilt2(output_image);
MSE11 = s
um(sum((double(f)/255-output_image1).^2))/
prod(size(f));
PSNR1 = 10*log(1/MSE11)/log(10);
end
demodata1 = zeros(ofdm_length,nloops);
for jj = 1: nloops % loop for columns
App en d i x B 317
serdata = input_data2(:,jj)';
demodata =
dct_channel_estimation_no_mapping_g(s
erdata,para,nd,m1,gilen,fftlen,sr,e
bno, br,fd,flat);
demodata1(:,jj) = demodata(: ); % the
output of ofdm
columns
end
yy1 = reshape(yy11,[R1,T1]);
for i = 1: M1
for j = 1: N1
zn1(i,j) = num2str(yy1(i,j));
end;
end;
hn1 = bin2dec(zn1);
gn1 = col2im(hn1, [M,N], [M,N], 'distinct');
%The Error between Trans ............................
output_image = gn1/255;
output_image1 = medfilt2(output_image);
MSE11 = s
um(sum((double(f)/255-output_image1).^2))/
prod(size(f));
PSNR1 = 10*log(1/MSE11)/log(10);
end
demodata1 = zeros(ofdm_length,nloops);
for jj = 1: nloops % loop for columns
serdata = input_data2(:,jj)';
demodata =
dwt_channel_estimation_no_mapping_g(s
erdata,para,nd,m1,gilen,fftlen,sr,e
bno, br,fd,flat);
demodata1(:,jj) = demodata(: ); % the
output of ofdm
columns
end
yy1 = reshape(yy11,[R1,T1]);
for i = 1: M1
for j = 1: N1
zn1(i,j) = num2str(yy1(i,j));
end;
end;
hn1 = bin2dec(zn1);
gn1 = col2im(hn1, [M,N], [M,N], 'distinct');
%The Error between Trans ............................
output_image = gn1/255;
output_image1 = medfilt2(output_image);
MSE11 = s
um(sum((double(f)/255-output_image1).^2))/
prod(size(f));
PSNR1 = 10*log(1/MSE11)/log(10);
end
App en d i x B 319
%ENCODING ............................................
trel = poly2trellis(7,[171 133]);% Trellis
data1 = zz;
zz = convenc(data1,trel);
s1 = length(zz);
para = 128;
nd = 6; %number of information OFDM symbol for one
loop
m1 = 2; %Modulation level: QPSK
sr = 250000; %symbol rate
br = sr.*m1; %Bit rate per carrier
Ipoint = 8;%Number of over samples
gilen = 32;
flat = 1;
fd = 600;
fftlen = para;
noc = para;
ofdm_length = para*nd*m1; %Total no for one loop
nloops = ceil((length(zz))/ofdm_length);
320 App en d i x B
new_data = nloops*ofdm_length ;
nzeros = new_data - length(zz);
input_data = [zz;zeros(nzeros,1)];
input_data2 = reshape(input_data,ofdm_length,nloops);
demodata1 = zeros(ofdm_length,nloops);
for jj = 1: nloops % loop for columns
serdata = input_data2(:,jj)';
demodata =
fft_channel_estimation_no_mapping_zg
(serdata,para,nd,m1,gilen,fftlen,sr,e
bno, br,fd,flat);
demodata1(:,jj) =
demodata(: ); % the
output of ofdm
columns
end
yy1 = reshape(yy11,[R1,T1]);
for i = 1: M1
for j = 1: N1
zn1(i,j) = num2str(yy1(i,j));
end;
end;
hn1 = bin2dec(zn1);
gn1 = col2im(hn1, [M,N], [M,N], 'distinct');
%The Error between Trans ............................
output_image = gn1/255;
output_image1 = medfilt2(output_image);
MSE1 = s
um(sum((double(f)/255-output_image).^2))/
prod(size(f));
PSNR = 10*log(1/MSE1)/log(10)
MSE11 = s
um(sum((double(f)/255-output_image1).^2))/
prod(size(f));
PSNR1 = 10*log(1/MSE11)/log(10);
end
demodata1 = zeros(ofdm_length,nloops);
for jj = 1: nloops % loop for columns
serdata = input_data2(:,jj)';
demodata =
dct_channel_estimation_no_mapping_zg
(serdata,para,nd,m1,gilen,fftlen,sr,e
bno, br,fd,flat);
demodata1(:,jj) = demodata(: ); % the
output of ofdm
columns
end
yy1 = reshape(yy11,[R1,T1]);
for i = 1: M1
for j = 1: N1
zn1(i,j) = num2str(yy1(i,j));
end;
end;
hn1 = bin2dec(zn1);
gn1 = col2im(hn1, [M,N], [M,N], 'distinct');
%The Error between Trans ............................
322 App en d i x B
output_image = gn1/255;
output_image1 = medfilt2(output_image);
MSE11 = s
um(sum((double(f)/255-output_image1).^2))/
prod(size(f));
PSNR1 = 10*log(1/MSE11)/log(10);
end
demodata1 = zeros(ofdm_length,nloops);
for jj = 1: nloops % loop for columns
serdata = input_data2(:,jj)';
demodata =
dwt_channel_estimation_no_mapping_zg(
serdata,para,nd,m1,gilen,fftlen,sr,e
bno, br,fd,flat);
demodata1(:,jj) =
demodata(: ); % the
output of ofdm
columns
end
yy1 = reshape(yy11,[R1,T1]);
for i = 1: M1
for j = 1: N1
zn1(i,j) = num2str(yy1(i,j));
end;
App en d i x B 323
end;
hn1 = bin2dec(zn1);
gn1 = col2im(hn1, [M,N], [M,N], 'distinct');
%The Error between Trans ............................
output_image = gn1/255;
output_image1 = medfilt2(output_image);
MSE11 = s
um(sum((double(f)/255-output_image1).^2))/
prod(size(f));
PSNR1 = 10*log(1/MSE11)/log(10);
end
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
function outdemodata =
fft_channel(serdata,para,nd,m1,
gilen,fftlen,sr,ebno, br)
paradata = reshape(serdata,para,nd*m1);
%QPSK modulation .....................................
[ich,qch] = qpskmod(paradata,para,nd,m1);
% [ich0,qch0] = compoversamp(ich01,qch01,length(ich01)
,Ipoint);
kmod = 1/sqrt(2);
ich1 = ich.*kmod;
qch1 = qch.*kmod;
%IFFT ............... ................................
x = ich1 + qch1.*j;
y = ifft(x);
ich2 = real (y);
qch2 = imag (y);
[ich3,qch3] = giins(ich2,qch2,fftlen,gilen,nd);
fftlen2 = fftlen + gilen;
spow = sum(ich3.^2+qch3.^2)/nd./para;
attn = 0.5*spow*sr/br*10.^(-ebno/10);
attn = sqrt (attn);
%Receiver ...........................................
%AWGN addition .......................................
[ich4,qch4] = comb(ich3,qch3,attn);
%Demodulation ........................................
ich7 = ich6./kmod;
qch7 = qch6./kmod;
outdemodata = qpskdemod (ich7,qch7,para,nd,m1);
function outdemodata =
dct_channel(serdata,para,nd,m1,
gilen,dctlen,sr,ebno, br)
paradata = reshape(serdata,para,nd*m1);
%QPSK modulation .....................................
[ich,qch] = qpskmod(paradata,para,nd,m1);
% [ich0,qch0] =
compoversamp(ich01,qch01,length(ich01),Ipoint);
kmod = 1/sqrt(2);
ich1 = ich.*kmod;
qch1 = qch.*kmod;
%IDCT ................................................
x = ich1 + qch1.*j;
y = idct(x);
ich2 = real (y);
qch2 = imag (y);
[ich3,qch3] = giins(ich2,qch2,dctlen,gilen,nd);
dctlen2 = dctlen + gilen;
App en d i x B 325
spow = sum(ich3.^2+qch3.^2)/nd./para;
attn = 0.5*spow*sr/br*10.^(-ebno/10);
attn = sqrt (attn);
%Receiver ...........................................
[ich4,qch4] = comb(ich3,qch3,attn);
%Demodulation ........................................
ich7 = ich6./kmod;
qch7 = qch6./kmod;
outdemodata = qpskdemod (ich7,qch7,para,nd,m1);
function outdemodata =
dwt_channel(serdata,para,nd,m1,
gilen,dctlen,sr,ebno, br)
paradata = reshape(serdata,para,nd*m1);
%QPSK modulation .....................................
[ich,qch] = qpskmod(paradata,para,nd,m1);
% [ich0,qch0] =
compoversamp(ich01,qch01,length
(ich01),Ipoint);
kmod = 1/sqrt(2);
ich1 = ich.*kmod;
qch1 = qch.*kmod;
%IDWT ................................................
x = ich1 + qch1.*j;
y = wavelet('D6',-1,x,'zpd'); % Invert 5 stages
%; % 2D wavelet transform
% R = wavelet('2D CDF 9/7',-2,Y); % Recover X from Y%
Forward transform with 5 stages
326 App en d i x B
[ich3,qch3] = giins(ich2,qch2,dctlen,gilen,nd);
dctlen2 = dctlen + gilen;
spow = sum(ich3.^2+qch3.^2)/nd./para;
attn = 0.5*spow*sr/br*10.^(-ebno/10);
attn = sqrt (attn);
%Receiver ...........................................
[ich4,qch4] = comb(ich3,qch3,attn);
%Demodulation ........................................
ich7 = ich6./kmod;
qch7 = qch6./kmod;
outdemodata = qpskdemod (ich7,qch7,para,nd,m1);
function outdemodata =
fft_channel_clipping_companding
(serdata,para,nd,m1,gilen,fftle
n,sr,ebno, br)
paradata = reshape(serdata,para,nd*m1);
%QPSK modulation .....................................
[ich,qch] = qpskmod(paradata,para,nd,m1);
% [ich0,qch0] =
compoversamp(ich01,qch01,length
(ich01),Ipoint);
kmod = 1/sqrt(2);
ich1 = ich.*kmod;
App en d i x B 327
qch1 = qch.*kmod;
for ii = 1: length(y)
if y(ii) = = y(ii);
y(ii) = y(ii);
end
end
%companding .........................
u = 4;
TxSamples_lfdma1 =
tx_lfdma_max*((log10(1+u*(tx_
lfdma_Abs./tx_lfdma_max)))/
log10(u+1)).*sign(y(1:
nd*para));
[ich4,qch4] = giins(ich3,qch3,fftlen,gilen,nd);
328 App en d i x B
[ich5,qch5] = comb(ich4,qch4,attn);
%perfect fading compensation ..........................
%%%%%%%%%%% Expanding
rx_lfdma_Abs = abs(rx);
r_lfdma_max = tx_lfdma_max;
RxSamples_lfdma = (r_lfdma_max/u)*(exp(log10(1+u)*2.30
2585093*rx_lfdma_Abs./r_lfdma_max)-1).*sign(rx);
rx_ifdma_Abs = abs(rx);
r_ifdma_max = tx_ifdma_max;
rxx = (r_ifdma_max/u)*(exp(log10(1+u)*2.302585093
*rx_ifdma_Abs./r_ifdma_max)-1).*sign(rx);
ry = fft(rxx);
ich7 = real (ry);
qch7 = imag (ry);
%Demodulation ........................................
ich10 = ich7./kmod;
qch10 = qch7./kmod;
outdemodata = qpskdemod (ich10,qch10,para,nd,m1);
paradata = reshape(serdata,para,nd*m1);
%QPSK modulation .....................................
[ich,qch] = qpskmod(paradata,para,nd,m1);
% [ich0,qch0] =
compoversamp(ich01,qch01,length
(ich01),Ipoint);
kmod = 1/sqrt(2);
ich1 = ich.*kmod;
qch1 = qch.*kmod;
%IDCT ................................................
x = ich1 + qch1.*j;
y = idct(x);
CR = 4;
clipping_threshold =
(10^(CR/10))*sqrt(mean(ab
s(y).^2));
tx_signal_Ang = angle(y);
for ii = 1: length(y)
if y(ii) = = y(ii);
y(ii) = y(ii);
end
end
%companding .................................
u = 4;
TxSamples_lfdma1 =
tx_lfdma_max*((log10(1+u*
(tx_lfdma_Abs./tx_lfdma_
max)))/log10(u+1)).*sign(y
(1: nd*para));
yy = t
x_ifdma_max*((log10(1+u*(tx_ifdma_Abs./
tx_ifdma_max)))/log10(u+1)).*sign(y(1:
nd*para));
[ich3,qch3] = giins(ich2,qch2,dctlen,gilen,nd);
dctlen2 = dctlen + gilen;
spow = sum(ich3.^2+qch3.^2)/nd./para;
attn = 0.5*spow*sr/br*10.^(-ebno/10);
attn = sqrt (attn);
%Receiver ...........................................
[ich4,qch4] = comb(ich3,qch3,attn);
%%%%%%%%%%% Expanding
rx_lfdma_Abs = abs(rx);
r_lfdma_max = tx_lfdma_max;
RxSamples_lfdma =
(r_lfdma_max/u)*(exp(log10(1+u)*2.30
2585093*rx_lfdma_Abs./r_lfdma_max)-
1).*sign(rx);
rx_ifdma_Abs = abs(rx);
r_ifdma_max = tx_ifdma_max;
rxx = (r_ifdma_max/u)*(exp(log10(1+u)*2.302585093
*rx_ifdma_Abs./r_ifdma_max)-1).*sign(rx);
ry = dct(rxx);
ich6 = real (ry);
App en d i x B 3 31
%Demodulation ........................................
ich7 = ich6./kmod;
qch7 = qch6./kmod;
outdemodata = qpskdemod (ich7,qch7,para,nd,m1);
paradata = reshape(serdata,para,nd*m1);
%QPSK modulation .....................................
[ich,qch] = qpskmod(paradata,para,nd,m1);
% [ich0,qch0] = compoversamp(ich01,qch01,length
(ich01),Ipoint);
kmod = 1/sqrt(2);
ich1 = ich.*kmod;
qch1 = qch.*kmod;
%IDWT ................................................
x = ich1 + qch1.*j;
y = wavelet('D6',-1,x,'zpd'); % Invert 5 stages
%; % 2D wavelet transform
% R = wavelet('2D CDF 9/7',-2,Y); % Recover X from Y%
Forward transform with 5 stages
CR = 4;
clipping_threshold = (10^(CR/10))*sqrt(mean(ab
s(y).^2));
tx_signal_Ang = angle(y);
for ii = 1: length(y)
if y(ii) = = y(ii);
y(ii) = y(ii);
end
end
%companding ................................
u = 4;
332 App en d i x B
[ich3,qch3] = giins(ich2,qch2,dctlen,gilen,nd);
dctlen2 = dctlen + gilen;
spow = sum(ich3.^2+qch3.^2)/nd./para;
attn = 0.5*spow*sr/br*10.^(-ebno/10);
attn = sqrt (attn);
%Receiver ...........................................
%AWGN addition .......................................
[ich4,qch4] = comb(ich3,qch3,attn);
%%%%%%%%%%% Expanding
rx_lfdma_Abs = abs(rx);
r_lfdma_max = tx_lfdma_max;
RxSamples_lfdma =
(r_lfdma_max/u)*(exp(log10(1+u)*2.30
2585093*rx_lfdma_Abs./r_lfdma_max)
-1).*sign(rx);
App en d i x B 333
rx_ifdma_Abs = abs(rx);
r_ifdma_max = tx_ifdma_max;
rxx = (
r_ifdma_max/u)*(exp(log10(1+u)*2.302585093
*rx_ifdma_Abs./r_ifdma_max)-1).*sign(rx);
%Demodulation ........................................
ich7 = ich6./kmod;
qch7 = qch6./kmod;
outdemodata = qpskdemod (ich7,qch7,para,nd,m1);
paradata = reshape(serdata,para,nd*m1);
%QPSK modulation .....................................
[ich,qch] = qpskmod(paradata,para,nd,m1);
% [ich0,qch0] = compoversamp(ich01,qch01,length
(ich01),Ipoint);
kmod = 1/sqrt(2);
ich1 = ich.*kmod;
qch1 = qch.*kmod;
%channel estimation data generation ..................
kndata = zeros(1,fftlen);
kndata0 = 2.*(rand(1,para)<0.5)-1;
kndata(1: para/2) = kndata0(1: para/2);
kndata((para/2)+1: para) = kndata0((para/2)+1: para);
ceich = kndata;
ceqch = zeros(1,para);
%data mapping ........................................
ich2 = [ceich.' ich1];
qch2 = [ceqch.' qch1];
%IFFT ................................................
x = ich2 + qch2.*i;
y = ifft(x);
CR = 4;
clipping_threshold =
(10^(CR/10))*sqrt(mean(ab
s(y).^2));
334 App en d i x B
tx_signal_Ang = angle(y);
for ii = 1: length(y)
if y(ii) = = y(ii);
y(ii) = y(ii);
end
end
%Demodulation ........................................
ich10 = ich9./kmod;
qch10 = qch9./kmod;
outdemodata = qpskdemod (ich10,qch10,para,nd,m1);
336 App en d i x B
function outdemodata =
dct_channel_estimation_no_
mapping_clipping(serdata,para,n
d,m1,gilen,fftlen,sr,ebno,
br,fd,flat)
paradata = reshape(serdata,para,nd*m1);
y = idct(x);
CR = 4;
clipping_threshold = (10^(CR/10))*sqrt(mean(ab
s(y).^2));
tx_signal_Ang = angle(y);
for ii = 1: length(y)
if y(ii) = = y(ii);
y(ii) = y(ii);
elseif abs(y(ii)).^2> clipping_threshold
y(ii) = clipping_threshold.*exp(sqrt(-1)*tx_
signal_Ang(ii));
end
end
[ich4,qch4] = giins(ich3,qch3,fftlen,gilen,nd+1);
fftlen2 = fftlen + gilen;
spow = sum(ich4.^2+qch4.^2)/nd./para;
attn = 0.5*spow*sr/br*10.^(-ebno/10);
attn = sqrt (attn);
%fading ..............................................
%******* Create Rayleigh fading channel object.*******
tstp = 1/sr/(fftlen+gilen);
itau = [0,2,3,4];
dlvll = [0,10,20,25];
n0 = [6,7,6,7];
th1 = [0,0,0,0];
itnd1 = [1000,2000,3000,4000];
now1 = 4;
itnd0 = nd*(fftlen+gilen)*20;
[ifade,qfade,ramp,rcos,rsin] = sefade(ich4,qch4,itau,d
lvll,th1,n0,itnd1,now1,length(ich4),tstp,fd,flat);
itnd1 = itnd1+itnd0;
ich4 = ifade;
qch4 = qfade;
[ich5,qch5] = comb(ich4,qch4,attn);
%perfect fading compensation ...............
............... ..........
ifade2 = 1./ramp.*(rcos(1,: ).*ich5+rsin(1,: ).*qch5);
qfade2 = 1./ramp.*(-rsin(1,: ).*ich5+rcos(1,: ).*qch5);
ich5 = ifade2;
qch5 = qfade2;
ry = dct(rx);
ich7 = real (ry);
qch7 = imag (ry);
%fading compensation by channel estimation symbol ....
ce = 1;
ice0 = ich2(:,ce);
qce0 = qch2(:,ce);
ice1 = ich7(:,ce);
qce1 = qch7(:,ce);
%calculate reverse rotation ..........................
iv = real((1./(ice1.^2+qce1.^2)).*(ice0+i.*qce0).
*(ice1-i.*qce1));
qv = imag((1./(ice1.^2+qce1.^2)).*(ice0+i.*qce0).
*(ice1-i.*qce1));
%matrix for reverse rotation .........................
ieqv1 = [iv iv iv iv iv iv iv];
qeqv1 = [qv qv qv qv qv qv qv];
%reverse rotation ............... ........
icompen = real((ich7+i.*qch7).*(ieqv1+i.*qeqv1));
qcompen = imag((ich7+i.*qch7).*(ieqv1+i.*qeqv1));
ich7 = icompen;
qch7 = qcompen;
%channel estimation symbol removal ...................
knd = 1; %number of known channel
estimation ofdm symbol
ich9 = ich7(:,knd+1: nd+1);
qch9 = qch7(:,knd+1: nd+1);
%Demodulation ........................................
ich10 = ich9./kmod;
qch10 = qch9./kmod;
outdemodata = qpskdemod (ich10,qch10,para,nd,m1);
paradata = reshape(serdata,para,nd*m1);
%QPSK modulation .....................................
[ich,qch] = qpskmod(paradata,para,nd,m1);
% [ich0,qch0] =
compoversamp(ich01,qch01,length
(ich01),Ipoint);
kmod = 1/sqrt(2);
ich1 = ich.*kmod;
qch1 = qch.*kmod;
App en d i x B 339
%IDWT ................................................
x = ich2 + qch2.*j;
y = wavelet('D6',-1,x,'zpd'); % Invert 5 stages
%; % 2D wavelet transform
% R = wavelet('2D CDF 9/7',-2,Y); % Recover X from Y%
Forward transform with 5 stages
CR = 4;
clipping_threshold = (10^(CR/10))*sqrt(mean(ab
s(y).^2));
tx_signal_Ang = angle(y);
for ii = 1: length(y)
if y(ii) = = y(ii);
y(ii) = y(ii);
elseif abs(y(ii)).^2> clipping_threshold
y(ii) =
clipping_threshold.*exp(sqrt
(-1)*tx_signal_Ang(ii));
end
end
[ich4,qch4] = giins(ich3,qch3,fftlen,gilen,nd+1);
fftlen2 = fftlen + gilen;
spow = sum(ich4.^2+qch4.^2)/nd./para;
attn = 0.5*spow*sr/br*10.^(-ebno/10);
attn = sqrt (attn);
%fading ..............................................
%******* Create Rayleigh fading channel object.*******
340 App en d i x B
tstp = 1/sr/(fftlen+gilen);
itau = [0,2,3,4];
dlvll = [0,10,20,25];
n0 = [6,7,6,7];
th1 = [0,0,0,0];
itnd1 = [1000,2000,3000,4000];
now1 = 4;
itnd0 = nd*(fftlen+gilen)*20;
[ifade,qfade,ramp,rcos,rsin] = sefade(ich4,qch4,itau,d
lvll,th1,n0,itnd1,now1,length(ich4),tstp,fd,flat);
itnd1 = itnd1+itnd0;
ich4 = ifade;
qch4 = qfade;
qv = i
mag((1./(ice1.^2+qce1.^2)).*(ice0+i.*qce0).
*(ice1-i.*qce1));
%matrix for reverse rotation ..........................
ieqv1 = [iv iv iv iv iv iv iv];
qeqv1 = [qv qv qv qv qv qv qv];
%reverse rotation ............... ........
icompen = real((ich7+i.*qch7).*(ieqv1+i.*qeqv1));
qcompen = imag((ich7+i.*qch7).*(ieqv1+i.*qeqv1));
ich7 = icompen;
qch7 = qcompen;
%channel estimation symbol removal ...................
knd = 1; %number of known channel estimation ofdm
symbol
ich9 = ich7(:,knd+1: nd+1);
qch9 = qch7(:,knd+1: nd+1);
%Demodulation ........................................
ich10 = ich9./kmod;
qch10 = qch9./kmod;
outdemodata = qpskdemod (ich10,qch10,para,nd,m1);
% [ich0,qch0] = c
ompoversamp(ich01,qch01,length
(ich01),Ipoint);
kmod = 1/sqrt(2);
ich1 = ich.*kmod;
qch1 = qch.*kmod;
%IFFT ................................................
x = ich1 + qch1.*j;
y = ifft(x);
ich2 = real (y);
qch2 = imag (y);
%offset ..............................................
n = para/2;
offset = exp(j*2*pi*n*epsilon/para);
i_rx_signal = ich3.*offset;
q_rx_signal = qch3.*offset;
ich3a = i_rx_signal ;
qch3a = q_rx_signal ;
%Receiver ...........................................
%AWGN addition .......................................
[ich4,qch4] = comb(ich3a,qch3a,attn);
%FFT .................................................
rx = ich5 + qch5.*j;
ry = fft(rx);
ich6 = real (ry);
qch6 = imag (ry);
%Demodulation ........................................
ich7 = ich6./kmod;
qch7 = qch6./kmod;
outdemodata = qpskdemod (ich7,qch7,para,nd,m1);
% [ich0,qch0] = c
ompoversamp(ich01,qch01,length
(ich01),Ipoint);
kmod = 1/sqrt(2);
ich1 = ich.*kmod;
qch1 = qch.*kmod;
App en d i x B 343
%IDCT ................................................
x = ich1 + qch1.*j;
y = idct(x);
ich2 = real (y);
qch2 = imag (y);
%offset ..............................................
n = para/2;
offset = exp(j*2*pi*n*epsilon/para);
i_rx_signal = ich3.*offset;
q_rx_signal = qch3.*offset;
ich3a = i_rx_signal ;
qch3a = q_rx_signal ;
%Receiver ...........................................
%AWGN addition .......................................
[ich4,qch4] = comb(ich3a,qch3a,attn);
%DCT .................................................
rx = ich5 + qch5.*j;
ry = dct(rx);
ich6 = real (ry);
qch6 = imag (ry);
%Demodulation ........................................
ich7 = ich6./kmod;
qch7 = qch6./kmod;
outdemodata = qpskdemod (ich7,qch7,para,nd,m1);
function outdemodata =
dwt_channel_offset_g(serdata,pa
ra,nd,m1,gilen,dctlen,sr,ebno,
br,epsilon)
paradata = reshape(serdata,para,nd*m1);
%QPSK modulation .....................................
[ich,qch] = qpskmod(paradata,para,nd,m1);
% [ich0,qch0] = compoversamp(ich01,qch01,length
(ich01),Ipoint);
kmod = 1/sqrt(2);
ich1 = ich.*kmod;
qch1 = qch.*kmod;
%IDWT ................................................
x = ich1 + qch1.*j;
y = wavelet('D6',-1,x,'zpd'); % Invert 5 stages
% 2D wavelet transf
% R = w
avelet('2D CDF 9/7',-2,Y); % Recover X from Y%
Forward transform with 5 stages
ich2 = real (y);
qch2 = imag (y);
%offset ..............................................
n = para/2;
offset = exp(j*2*pi*n*epsilon/para);
i_rx_signal = ich3.*offset;
q_rx_signal = qch3.*offset;
ich3a = i_rx_signal ;
qch3a = q_rx_signal ;
%Receiver ...........................................
%AWGN addition .......................................
[ich4,qch4] = comb(ich3a,qch3a,attn);
%Guard interval removal ..............................
[ich5,qch5] = girem1 (ich4,qch4,dctlen2,gilen,nd);
%DWT .................................................
rx = ich5 + qch5.*j;
ry = wavelet('D6',1,rx,'zpd');; % 2D wavelet transform
% R = wavelet('2D CDF 9/7',-2,Y); % Recover X from Y;
ich6 = real (ry);
App en d i x B 345
%Demodulation ........................................
ich7 = ich6./kmod;
qch7 = qch6./kmod;
outdemodata = qpskdemod (ich7,qch7,para,nd,m1);
function outdemodata =
fft_channel_offset_zg(serdata,p
ara,nd,m1,gilen,fftlen,sr,ebno,
br,epsilon)
% [ich0,qch0] = c
ompoversamp(ich01,qch01,length
(ich01),Ipoint);
kmod = 1/sqrt(2);
ich1 = ich.*kmod;
qch1 = qch.*kmod;
%IFFT ................................................
x = ich1 + qch1.*j;
y = ifft(x);
ich2 = real (y);
qch2 = imag (y);
%offset ..............................................
n = para/2;
offset = exp(j*2*pi*n*epsilon/para);
i_rx_signal = ich3.*offset;
q_rx_signal = qch3.*offset;
ich3a = i_rx_signal ;
qch3a = q_rx_signal ;
346 App en d i x B
%Receiver ...........................................
%AWGN addition .......................................
[ich4,qch4] = comb(ich3a,qch3a,attn);
%FFT .................................................
rx = ich5 + qch5.*j;
ry = fft(rx);
ich6 = real (ry);
qch6 = imag (ry);
%Demodulation ........................................
ich7 = ich6./kmod;
qch7 = qch6./kmod;
outdemodata = qpskdemod (ich7,qch7,para,nd,m1);
function outdemodata =
dct_channel_offset_zg(serdata,p
ara,nd,m1,gilen,fftlen,sr,ebno,
br,epsilon)
% [ich0,qch0] = c
ompoversamp(ich01,qch01,length
(ich01),Ipoint);
kmod = 1/sqrt(2);
ich1 = ich.*kmod;
qch1 = qch.*kmod;
%IDCT ................................................
x = ich1 + qch1.*j;
y = idct(x);
ich2 = real (y);
qch2 = imag (y);
spow = sum(ich3.^2+qch3.^2)/nd./para;
attn = 0.5*spow*sr/br*10.^(-ebno/10);
attn = sqrt (attn);
%offset ..............................................
n = para/2;
offset = exp(j*2*pi*n*epsilon/para);
i_rx_signal = ich3.*offset;
q_rx_signal = qch3.*offset;
ich3a = i_rx_signal ;
qch3a = q_rx_signal ;
%Receiver ...........................................
%AWGN addition .......................................
[ich4,qch4] = comb(ich3a,qch3a,attn);
%DCT .................................................
rx = ich5 + qch5.*j;
ry = dct(rx);
ich6 = real (ry);
qch6 = imag (ry);
%Demodulation ........................................
ich7 = ich6./kmod;
qch7 = qch6./kmod;
outdemodata = qpskdemod (ich7,qch7,para,nd,m1);
function outdemodata =
dwt_channel_offset_zg(serdata,p
ara,nd,m1,gilen,dctlen,sr,ebno,
br,epsilon)
% 2D wavelet transf
% R = wavelet('2D CDF 9/7',-2,Y); % Recover X from Y%
Forward transform with 5 stages
ich2 = real (y);
qch2 = imag (y);
%offset ..............................................
n = para/2;
offset = exp(j*2*pi*n*epsilon/para);
i_rx_signal = ich3.*offset;
q_rx_signal = qch3.*offset;
ich3a = i_rx_signal ;
qch3a = q_rx_signal ;
%Receiver ...........................................
%AWGN addition .......................................
[ich4,qch4] = comb(ich3a,qch3a,attn);
%Guard interval removal ..............................
[ich5,qch5] = girem1 (ich4,qch4,dctlen2,gilen,nd);
%DWT .................................................
rx = ich5 + qch5.*j;
ry = wavelet('D6',1,rx,'zpd');; % 2D wavelet transform
% R = wavelet('2D CDF 9/7',-2,Y); % Recover X from Y;
ich6 = real (ry);
qch6 = imag (ry);
%Demodulation ........................................
ich7 = ich6./kmod;
qch7 = qch6./kmod;
outdemodata = qpskdemod (ich7,qch7,para,nd,m1);
function outdemodata =
fft_channel_estimation_no_mappi
ng_g(serdata,para,nd,m1,gilen,f
ftlen,sr,ebno, br,fd,flat)
App en d i x B 349
paradata = reshape(serdata,para,nd*m1);
%QPSK modulation .....................................
[ich,qch] = qpskmod(paradata,para,nd,m1);
% [ich0,qch0] = compoversamp(ich01,qch01,length(ich01)
,Ipoint);
kmod = 1/sqrt(2);
ich1 = ich.*kmod;
qch1 = qch.*kmod;
%channel estimation data generation ..................
kndata = zeros(1,fftlen);
kndata0 = 2.*(rand(1,para)<0.5)-1;
kndata(1: para/2) = kndata0(1: para/2);
kndata((para/2)+1: para) = kndata0((para/2)+1: para);
ceich = kndata;
ceqch = zeros(1,para);
%data mapping ........................................
ich2 = [ceich.' ich1];
qch2 = [ceqch.' qch1];
%IFFT ................................................
x = ich2 + qch2.*i;
y = ifft(x);
ich3 = real (y);
qch3 = imag (y);
%fading ..............................................
%******* Create Rayleigh fading channel object.*******
tstp = 1/sr/(fftlen+gilen);
itau = [0,2,3,4];
dlvll = [0,10,20,25];
n0 = [6,7,6,7];
th1 = [0,0,0,0];
itnd1 = [1000,2000,3000,4000];
now1 = 4;
itnd0 = nd*(fftlen+gilen)*20;
350 App en d i x B
[ifade,qfade,ramp,rcos,rsin] = sefade(ich4,qch4,itau,d
lvll,th1,n0,itnd1,now1,length(ich4),tstp,fd,flat);
itnd1 = itnd1+itnd0;
ich4 = ifade;
qch4 = qfade;
%Demodulation ........................................
ich10 = ich9./kmod;
qch10 = qch9./kmod;
outdemodata = qpskdemod (ich10,qch10,para,nd,m1);
function outdemodata =
dct_channel_estimation_no_mappi
ng_g(serdata,para,nd,m1,gilen,f
ftlen,sr,ebno, br,fd,flat)
paradata = reshape(serdata,para,nd*m1);
%QPSK modulation .....................................
[ich,qch] = qpskmod(paradata,para,nd,m1);
% [ich0,qch0] =
compoversamp(ich01,qch01,length
(ich01),Ipoint);
kmod = 1/sqrt(2);
ich1 = ich.*kmod;
qch1 = qch.*kmod;
%channel estimation data generation ..................
kndata = zeros(1,fftlen);
kndata0 = 2.*(rand(1,para)<0.5)-1;
kndata(1: para/2) = kndata0(1: para/2);
kndata((para/2)+1: para) = kndata0((para/2)+1: para);
ceich = kndata;
ceqch = zeros(1,para);
%data mapping ........................................
ich2 = [ceich.' ich1];
qch2 = [ceqch.' qch1];
%IDCT ................................................
x = ich2 + qch2.*i;
y = idct(x);
ich3 = real (y);
qch3 = imag (y);
[ich4,qch4] = giins1(ich3,qch3,fftlen,gilen,nd+1);
fftlen2 = fftlen + gilen;
spow = sum(ich4.^2+qch4.^2)/nd./para;
attn = 0.5*spow*sr/br*10.^(-ebno/10);
attn = sqrt (attn);
%fading ..............................................
%******* Create Rayleigh fading channel object.*******
tstp = 1/sr/(fftlen+gilen);
itau = [0,2,3,4];
dlvll = [0,10,20,25];
n0 = [6,7,6,7];
th1 = [0,0,0,0];
itnd1 = [1000,2000,3000,4000];
now1 = 4;
itnd0 = nd*(fftlen+gilen)*20;
[ifade,qfade,ramp,rcos,rsin] = sefade(ich4,qch4,itau,d
lvll,th1,n0,itnd1,now1,length(ich4),tstp,fd,flat);
itnd1 = itnd1+itnd0;
ich4 = ifade;
qch4 = qfade;
%Demodulation ........................................
ich10 = ich9./kmod;
qch10 = qch9./kmod;
outdemodata = qpskdemod (ich10,qch10,para,nd,m1);
function outdemodata =
dwt_channel_estimation_no_mappi
ng_g(serdata,para,nd,m1,gilen,f
ftlen,sr,ebno, br,fd,flat)
paradata = reshape(serdata,para,nd*m1);
%QPSK modulation .....................................
[ich,qch] = qpskmod(paradata,para,nd,m1);
% [ich0,qch0] = compoversamp(ich01,qch01,length(ich01)
,Ipoint);
kmod = 1/sqrt(2);
ich1 = ich.*kmod;
qch1 = qch.*kmod;
%channel estimation data generation ..................
kndata = zeros(1,fftlen);
kndata0 = 2.*(rand(1,para)<0.5)-1;
kndata(1: para/2) = kndata0(1: para/2);
kndata((para/2)+1: para) = kndata0((para/2)+1: para);
ceich = kndata;
ceqch = zeros(1,para);
%data mapping ........................................
ich2 = [ceich.' ich1];
354 App en d i x B
%IDWT ................................................
x = ich2 + qch2.*j;
y = wavelet('D6',-1,x,'zpd'); % Invert 5 stages
%; % 2D wavelet transform
% R = wavelet('2D CDF 9/7',-2,Y); % Recover X from Y%
Forward transform with 5 stages
spow = sum(ich4.^2+qch4.^2)/nd./para;
attn = 0.5*spow*sr/br*10.^(-ebno/10);
attn = sqrt (attn);
%fading ..............................................
%******* Create Rayleigh fading channel object.*******
tstp = 1/sr/(fftlen+gilen);
itau = [0,2,3,4];
dlvll = [0,10,20,25];
n0 = [6,7,6,7];
th1 = [0,0,0,0];
itnd1 = [1000,2000,3000,4000];
now1 = 4;
itnd0 = nd*(fftlen+gilen)*20;
[ifade,qfade,ramp,rcos,rsin] = sefade(ich4,qch4,itau,d
lvll,th1,n0,itnd1,now1,length(ich4),tstp,fd,flat);
itnd1 = itnd1+itnd0;
ich4 = ifade;
qch4 = qfade;
qfade2 = 1
./ramp.*(-rsin(1,: ).*ich5+rcos
(1,: ).*qch5);
ich5 = ifade2;
qch5 = qfade2;
%Demodulation ........................................
ich10 = ich9./kmod;
qch10 = qch9./kmod;
outdemodata = qpskdemod (ich10,qch10,para,nd,m1);
356 App en d i x B
function outdemodata =
fft_channel_estimation_no_map-
ping_zg(serdata,para,nd,m1,gile
n,fftlen,sr,ebno, br,fd,flat)
paradata = reshape(serdata,para,nd*m1);
%QPSK modulation .....................................
[ich,qch] = qpskmod(paradata,para,nd,m1);
% [ich0,qch0] = compoversamp(ich01,qch01,length
(ich01),Ipoint);
kmod = 1/sqrt(2);
ich1 = ich.*kmod;
qch1 = qch.*kmod;
%channel estimation data generation ..................
kndata = zeros(1,fftlen);
kndata0 = 2.*(rand(1,para)<0.5)-1;
kndata(1: para/2) = kndata0(1: para/2);
kndata((para/2)+1: para) = kndata0((para/2)+1: para);
ceich = kndata;
ceqch = zeros(1,para);
%data mapping ........................................
ich2 = [ceich.' ich1];
qch2 = [ceqch.' qch1];
%IFFT ................................................
x = ich2 + qch2.*i;
y = ifft(x);
ich3 = real (y);
qch3 = imag (y);
spow = sum(ich4.^2+qch4.^2)/nd./para;
attn = 0.5*spow*sr/br*10.^(-ebno/10);
attn = sqrt (attn);
%fading ..............................................
%*******Create Rayleigh fading channel object.********
tstp = 1/sr/(fftlen+gilen);
itau = [0,2,3,4];
dlvll = [0,10,20,25];
n0 = [6,7,6,7];
th1 = [0,0,0,0];
App en d i x B 357
itnd1 = [1000,2000,3000,4000];
now1 = 4;
itnd0 = nd*(fftlen+gilen)*20;
[ifade,qfade,ramp,rcos,rsin] = sefade(ich4,qch4,itau,d
lvll,th1,n0,itnd1,now1,length(ich4),tstp,fd,flat);
itnd1 = itnd1+itnd0;
ich4 = ifade;
qch4 = qfade;
[ich5,qch5] = comb(ich4,qch4,attn);
%perfect fading compensation ........................
ifade2 = 1
./ramp.*(rcos(1,: ).
*ich5+rsin(1,: ).*qch5);
qfade2 = 1./ramp.*(-rsin(1,: ).*ich5+rcos
(1,:).*qch5);
ich5 = ifade2;
qch5 = qfade2;
qcompen = imag((ich7+i.*qch7).*(ieqv1+i.*qeqv1));
ich7 = icompen;
qch7 = qcompen;
%channel estimation symbol removal ...................
knd = 1; %number of known channel estimation ofdm
symbol
ich9 = ich7(:,knd+1: nd+1);
qch9 = qch7(:,knd+1: nd+1);
%Demodulation ........................................
ich10 = ich9./kmod;
qch10 = qch9./kmod;
outdemodata = qpskdemod (ich10,qch10,para,nd,m1);
function outdemodata =
dct_channel_estimation_no_map-
ping_zg(serdata,para,nd,m1,gile
n,fftlen,sr,ebno, br,fd,flat)
paradata = reshape(serdata,para,nd*m1);
%QPSK modulation .....................................
[ich,qch] = qpskmod(paradata,para,nd,m1);
% [ich0,qch0] =
compoversamp(ich01,qch01,length
(ich01),Ipoint);
kmod = 1/sqrt(2);
ich1 = ich.*kmod;
qch1 = qch.*kmod;
%channel estimation data generation ..................
kndata = zeros(1,fftlen);
kndata0 = 2.*(rand(1,para)<0.5)-1;
kndata(1: para/2) = kndata0(1: para/2);
kndata((para/2)+1: para) = kndata0((para/2)+1: para);
ceich = kndata;
ceqch = zeros(1,para);
%data mapping ........................................
ich2 = [ceich.' ich1];
qch2 = [ceqch.' qch1];
%IDCT ................................................
x = ich2 + qch2.*i;
y = idct(x);
ich3 = real (y);
qch3 = imag (y);
%Guard interval insertion ............................
[ich4,qch4] = giins2(ich3,qch3,fftlen,gilen,nd+1);
fftlen2 = fftlen + gilen;
App en d i x B 359
[ich5,qch5] = comb(ich4,qch4,attn);
%perfect fading compensation ........................
ifade2 = 1./ramp.*(rcos(1,: ).
*ich5+rsin
(1,: ).*qch5);
qfade2 = 1./ramp.*(-rsin(1,: ).
*ich5+rcos
(1,: ).*qch5);
ich5 = ifade2;
qch5 = qfade2;
ice1 = ich7(:,ce);
qce1 = qch7(:,ce);
%calculate reverse rotation ..........................
iv = real((1./(ice1.^2+qce1.^2)).*(ice0+i.*qce0).
*(ice1-i.*qce1));
qv = imag((1./(ice1.^2+qce1.^2)).*(ice0+i.*qce0).
*(ice1-i.*qce1));
%matrix for reverse rotation ..........................
ieqv1 = [iv iv iv iv iv iv iv];
qeqv1 = [qv qv qv qv qv qv qv];
%reverse rotation ............... ........
icompen = real((ich7+i.*qch7).*(ieqv1+i.*qeqv1));
qcompen = imag((ich7+i.*qch7).*(ieqv1+i.*qeqv1));
ich7 = icompen;
qch7 = qcompen;
%channel estimation symbol removal ...................
knd = 1; %number of known channel estimation ofdm
symbol
ich9 = ich7(:,knd+1: nd+1);
qch9 = qch7(:,knd+1: nd+1);
%Demodulation ........................................
ich10 = ich9./kmod;
qch10 = qch9./kmod;
outdemodata = qpskdemod (ich10,qch10,para,nd,m1);
function outdemodata =
dwt_channel_estimation_no_map-
ping_zg(serdata,para,nd,m1,gile
n,fftlen,sr,ebno, br,fd,flat)
paradata = reshape(serdata,para,nd*m1);
%QPSK modulation .....................................
[ich,qch] = qpskmod(paradata,para,nd,m1);
% [ich0,qch0] = compoversamp(ich01,qch01,length(ich01)
,Ipoint);
kmod = 1/sqrt(2);
ich1 = ich.*kmod;
qch1 = qch.*kmod;
%channel estimation data generation ..................
kndata = zeros(1,fftlen);
kndata0 = 2.*(rand(1,para)<0.5)-1;
kndata(1: para/2) = kndata0(1: para/2);
kndata((para/2)+1: para) = kndata0((para/2)+1: para);
ceich = kndata;
ceqch = zeros(1,para);
App en d i x B 3 61
%IDWT ................................................
x = ich2 + qch2.*j;
y = wavelet('D6',-1,x,'zpd'); % Invert 5 stages
%; % 2D wavelet transform
% R = wavelet('2D CDF 9/7',-2,Y); % Recover X from Y%
Forward transform with 5 stages
[ich5,qch5] = comb(ich4,qch4,attn);
%perfect fading compensation ........................
362 App en d i x B
ifade2 = 1
./ramp.*(rcos(1,: ).*ich5+rsin
(1,: ).*qch5);
qfade2 =
1./ramp.*(-rsin(1,: ).*ich5+rcos
(1,: ).*qch5);
ich5 = ifade2;
qch5 = qfade2;
%Demodulation ........................................
ich10 = ich9./kmod;
qch10 = qch9./kmod;
outdemodata = qpskdemod (ich10,qch10,para,nd,m1);
App en d i x B 363
%*****************************************************
m2 = m1./2;
paradata2 = paradata.*2-1;
count2 = 0;
for jjj = 1: nd
isi = zeros (para,1);
isq = zeros (para,1);
for ii = 1 : m2
isi =
isi + 2.^(m2 - ii).*paradata2
((1: para),ii+count2) ;
isq =
isq + 2.^(m2 - ii).*paradata2
((1: para),m2+ii+count2) ;
end
iout((1: para),jjj) = isi;
qout((1: para),jjj) = isq;
count2 = count2 + m1;
end
%******************** End of file ********************
function [demodata] =
qpskdemod(idata,
qdata,para,nd,m1)
function varargout =
wavelet(WaveletName,Level,X,Ext,
Dim)
%WAVELET Discrete wavelet transform.
%
Y = WAVELET(W,L,X) computes the L-stage discrete
wavelet transform
%
(DWT) of signal X using wavelet W. The length of X
must be
%
divisible by 2^L. For the inverse transform,
WAVELET(W,-L,X)
% inverts L stages. Choices for W are
% 'Haar' Haar
% 'D1','D2','D3','D4','D5','D6' Daubechies'
% 'Sym1','Sym2','Sym3','Sym4','Sym5','Sym6' Symlets
% 'Coif1','Coif2' Coiflets
% 'BCoif1' Coiflet-like [2]
% 'Spline Nr.Nd' (or 'bior Nr.Nd') for Splines
% Nr = 0, Nd = 0,1,2,3,4,5,6,7, or 8
% Nr = 1, Nd = 0,1,3,5, or 7
% Nr = 2, Nd = 0,1,2,4,6, or 8
% Nr = 3, Nd = 0,1,3,5, or 7
% Nr = 4, Nd = 0,1,2,4,6, or 8
% Nr = 5, Nd = 0,1,3, or 5
%
'RSpline Nr.Nd' for the same Nr.Nd pairs Reverse
splines
%
'S+P (2,2)','S+P (4,2)','S+P (6,2)', S+P
wavelets [3]
% 'S+P (4,4)','S+P (2+2,2)'
% 'TT' “Two-Ten” [5]
%
'LC 5/3','LC 2/6','LC 9/7-M','LC 2/10', Low
Complexity [1]
% 'LC 5/11-C','LC 5/11-A','LC 6/14',
% 'LC 13/7-T','LC 13/7-C'
% 'Le Gall 5/3','CDF 9/7' JPEG2000 [7]
% 'V9/3' Visual [8]
% 'Lazy' Lazy wavelet
%
Case and spaces are ignored in wavelet names, for
example, 'Sym4'
App en d i x B 365
% m
ay also be written as 'sym 4'. Some wavelets have
multiple names,
%
'D1', 'Sym1', and 'Spline 1.1' are aliases of the
Haar wavelet.
%
%
WAVELET(W) displays information about wavelet W and
plots the
% primal and dual scaling and wavelet functions.
%
%
For 2D transforms, prefix W with '2D'. For example,
'2D S+P (2,2)'
%
specifies a 2D (tensor) transform with the S+P
(2,2) wavelet.
%
2D transforms require that X is either MxN or MxNxP
where M and N
% are divisible by 2^L.
%
%
WAVELET(W,L,X,EXT) specifies boundary handling EXT.
Choices are
% 'sym' Symmetric extension (same as 'wsws')
%
'asym' Antisymmetric extension, whole-point
antisymmetry
% 'zpd' Zero-padding
% 'per' Periodic extension
% 'sp0' Constant extrapolation
%
% Various symmetric extensions are supported:
% 'wsws' Whole-point symmetry (WS) on both boundaries
% 'hshs' Half-point symmetry (HS) on both boundaries
% 'wshs' WS left boundary, HS right boundary
% 'hsws' HS left boundary, WS right boundary
%
%
Antisymmetric boundary handling is used by default,
EXT = 'asym'.
%
% WAVELET(...,DIM) operates along dimension DIM.
%
%
[H1,G1,H2,G2] = WAVELET(W,'filters') returns the
filters
%
associated with wavelet transform W. Each filter is
represented
%
by a cell array where the first cell contains an
array of
%
coefficients and the second cell contains a scalar
of the leading
366 App en d i x B
% Z-power.
%
%
[X,PHI1] = WAVELET(W,'phi1') returns an
approximation of the
% scaling function associated with wavelet transform W.
%
[X,PHI1] = WAVELET(W,'phi1',N) approximates the
scaling function
% with resolution 2^-N. Similarly,
% [X,PSI1] = WAVELET(W,'psi1',...),
% [X,PHI2] = WAVELET(W,'phi2',...),
%
and [X,PSI2] = WAVELET(W,'psi2',...) return
approximations of the
%
wavelet function, dual scaling function, and dual
wavelet function.
%
%
Wavelet transforms are implemented using the lifting
scheme [4].
%
For general background on wavelets, see for example
[6].
%
%
% Examples:
% % Display information about the S+P (4,4) wavelet
% wavelet('S+P (4,4)');
%
% % Plot a wavelet decomposition
% t = linspace(0,1,256);
% X = exp(-t) + sqrt(t - 0.3).*(t > 0.3) - 0.2*
(t > 0.6);
%
wavelet('RSpline 3.1',3,X); % Plot the decomposition
of X
%
% % Sym4 with periodic boundaries
%
Y = wavelet('Sym4',5,X,'per'); % Forward transform
with 5 stages
% R = wavelet('Sym4',-5,Y,'per'); % Invert 5 stages
%
% % 2D transform on an image
% t = linspace(-1,1,128); [x,y] = meshgrid(t,t);
% X = ((x+1).*(x-1) - (y+1).*(y-1)) + real(sqrt(0.4 -
x.^2 - y.^2));
%
Y = wavelet('2D CDF 9/7',2,X); % 2D wavelet transform
% R = wavelet('2D CDF 9/7',-2,Y); % Recover X from Y
% imagesc(abs(Y).^0.2); colormap(gray); axis image;
%
App en d i x B 367
Flag1D = isempty(findstr(lower(WaveletName),'2d'));
[Seq,ScaleS,ScaleD,Family] = getwavelet(WaveletName);
if isempty(Seq)
error(['Unknown wavelet, ''',WaveletName,'''.']);
end
if nargin < 2, Level = ''; end
if ischar(Level)
[h1,g1] = seq2hg(Seq,ScaleS,ScaleD,0);
[h2,g2] = seq2hg(Seq,ScaleS,ScaleD,1);
if strcmpi(Level,'filters')
varargout = {h1,g1,h2,g2};
else
if nargin < 3, X = 6; end
switch lower(Level)
case {'phi1','phi'}
[x1,phi] = cascade(h1,g1,pow2(-X));
varargout = {x1,phi};
case {'psi1','psi'}
[x1,phi,x2,psi] = cascade(h1,g1,pow2(-X));
varargout = {x2,psi};
case 'phi2'
[x1,phi] = cascade(h2,g2,pow2(-X));
varargout = {x1,phi};
case 'psi2'
[x1,phi,x2,psi] = cascade(h2,g2,pow2(-X));
varargout = {x2,psi};
case ''
fprintf('\n%s wavelet ''%s'' ',Family,WaveletName);
if all(abs([norm(h1{1}),norm(h2{1})] - 1) < 1e-11)
fprintf('(orthogonal)\n');
else
fprintf('(biorthogonal)\n');
end
fprintf('h1(z) =%s\n',filterstr(h1,ScaleS));
fprintf('g1(z) =%s\n',filterstr(g1,ScaleD));
fprintf('h2(z) =%s\n',filterstr(h2,1/ScaleS));
fprintf('g2(z) =%s\n\n',filterstr(g2,1/ScaleD));
[x1,phi,x2,psi] = cascade(h1,g1,pow2(-X));
subplot(2,2,1);
plot(x1,phi,'b-');
if diff(x1([1,end])) > 0, xlim(x1([1,end])); end
title('\phi_1');
subplot(2,2,3);
plot(x2,psi,'b-');
if diff(x2([1,end])) > 0, xlim(x2([1,end])); end
title('\psi_1');
[x1,phi,x2,psi] = cascade(h2,g2,pow2(-X));
subplot(2,2,2);
plot(x1,phi,'b-');
if diff(x1([1,end])) > 0, xlim(x1([1,end])); end
title('\phi_2');
subplot(2,2,4);
plot(x2,psi,'b-');
if diff(x2([1,end])) > 0, xlim(x2([1,end])); end
title('\psi_2');
set(gcf,'NextPlot','replacechildren');
otherwise
error(['Invalid parameter, ''',Level,'''.']);
end
end
return;
elseif nargin < 5
% Use antisymmetric extension by default
if nargin < 4
if nargin < 3, error('Not enough input
arguments.'); end
Ext = 'asym';
end
if any(size(Level) ~ = 1),
error('Invalid
decomposition level.'); end
370 App en d i x B
NumStages = size(Seq,1);
EvenStages = ~rem(NumStages,2);
if Flag1D % 1D Transfrom
%%% Convert N-D array to a 2-D array with dimension
Dim along the columns%%%
XSize = size(X); % Save original dimensions
N = XSize(Dim);
M = prod(XSize)/N;
Perm = [Dim: max(length(XSize),Dim),1: Dim-1];
X = double(reshape(permute(X,Perm),N,M));
if M = = 1 & nargout = = 0 & Level > 0
% Create a figure of the wavelet decomposition
set(gcf,'NextPlot','replace');
subplot(Level+2,1,1);
plot(X);
title('Wavelet Decomposition');
axis tight; axis off;
X = feval(mfilename,WaveletName,Level,X,Ext,1);
for i = 1: Level
N2 = N;
N = 0.5*N;
subplot(Level+2,1,i+1);
a = max(abs(X(N+1: N2)))*1.1;
plot(N+1: N2,X(N+1: N2),'b-');
ylabel(['d',sprintf('_%c',num2str(i))]);
axis([N+1,N2,-a,a]);
end
subplot(Level+2,1,Level+2);
plot(X(1: N),'-');
xlabel('Coefficient Index');
ylabel('s_1');
axis tight;
set(gcf,'NextPlot','replacechildren');
varargout = {X};
return;
end
for k = 3: 2: NumStages
Xo = Xo + xfir(Seq{k-1,1},Seq
{k-1,2},Xe,Ext);
Xe = Xe + xfir(Seq{k,1},Seq{k,2},Xo,Ext);
end
if EvenStages
Xo =
Xo + xfir(Seq{NumStages,1},
Seq{NumStages,2},Xe,Ext);
end
for i = 1: -Level
N2 = 2*N;
Xe = X(1: N,: )/ScaleS;
Xo = X(N+1: N2,: )/ScaleD;
if EvenStages
Xo = Xo - xfir(Seq{NumStages,1},Seq{NumSta
ges,2},Xe,Ext);
end
X = i
permute(reshape(X,XSize(Perm)),Perm);
% Restore original array dimensions
372 App en d i x B
else % 2D Transfrom
N = size(X);
if length(N) > 3 |
any(rem(N([1,2]),pow2(abs(Level))))
error('Input size must be either MxN or MxNxP
where M and N are divisible by 2^L.');
end
for k = 3: 2: NumStages
Xo = Xo + xfir(Seq{k-1,1},Seq{k-1,2},
Xe,Ext);
Xe = Xe + xfir(Seq{k,1},Seq{k,2},Xo,Ext);
end
if EvenStages
Xo = Xo + xfir(Seq{NumStages,1},Seq{NumSta
ges,2},Xe,Ext);
end
for i = 1: -Level
N2 = 2*N;
Xe = permute(X(1: N2(1),1: N(2),:
),[2,1,3])/ScaleS;
Xo = permute(X(1: N2(1),N(2)+1: N2(2),:
),[2,1,3])/ScaleD;
if EvenStages
Xo = Xo - xfir(Seq{NumStages,1},Seq{NumStages,2}
,Xe,Ext);
end
if EvenStages
Xo = Xo - xfir(Seq{NumStages,1},Seq{NumStages,2}
,Xe,Ext);
end
for k = NumStages - EvenStages: -2: 3
Xe = Xe - xfir(Seq{k,1},Seq{k,2},Xo,Ext);
Xo = Xo - xfir(Seq{k-1,1},Seq{k-
1,2},Xe,Ext);
end
X([1: 2: N2(1),2: 2: N2(1)],1: N2(2),: )
=...
[Xe - xfir(Seq{1,1},Seq{1,2},Xo,Ext); Xo];
N = N2;
end
end
end
varargout{1} = X;
return;
3 74 App en d i x B
function [Seq,ScaleS,ScaleD,Family] =
getwavelet(WaveletName)
%GETWAVELET Get wavelet lifting scheme sequence.
% Pascal Getreuer 2005-2006
WaveletName = strrep(WaveletName,'bior','spline');
ScaleS = 1/sqrt(2);
ScaleD = 1/sqrt(2);
Family = 'Spline';
[-0.0121321866213973,
0.0775533344610336],3;0.035764924629411,-3};
ScaleS = 1.3101844387211246;
ScaleD = 0.7632513182465389;
Family = 'Daubechies';
case {'d6','db6'}
Seq = {4.4344683000391223,0;[-0.214593449940913,
0.0633131925095066],0;
[4.4931131753641633,-9.970015617571832],2;
[-0.0574139367993266,0.0236634936395882],-2;
[0.6787843541162683,-2.3564970162896977],4;
[-0.0071835631074942,0.0009911655293238],-4;
-0.0941066741175849,5};
ScaleS = 0.3203624223883869;
ScaleD = 3.1214647228121661;
Family = 'Daubechies';
case 'sym4'
Seq = {-0.3911469419700402,0; [0.339243991864945
1,0.1243902829333865],0;
[-0.1620314520393038,1.4195148522334731],1;
-[0.1459830772565225,
0.4312834159749964],1;1.049255198049293,-1};
ScaleS = 0.6366587855802818;
ScaleD = 1.5707000714496564;
Family = 'Symlet';
case 'sym5'
Seq = {0.9259329171294208,0; -[0.131923027028234
1,0.4985231842281166],1;
[1.452118924420613,0.4293261204657586],0;
[-0.2804023843755281,0.0948300395515551],0;
-[0.7680659387165244,1.9589167118877153],1;
0.1726400850543451,0};
ScaleS = 0.4914339446751972;
ScaleD = 2.0348614718930915;
Family = 'Symlet';
case 'sym6'
Seq = {-0.2266091476053614,0;
[0.2155407618197651,-1.2670686037583443],0;
[-4.2551584226048398,0.5047757263881194],2;
[0.2331599353469357 =,0.0447459687134724],-2;
[6.6244572505007815,-18.389000853969371],4;
[-0.0567684937266291,0.1443950619899142],-4;
-5.5119344180654508,5};
ScaleS = -0.5985483742581210;
ScaleD = -1.6707087396895259;
376 App en d i x B
Family = 'Symlet';
case 'coif1'
Seq = {-4.6457513110481772,0;[0.205718913884,
0.1171567416519999],0;
[0.6076252184992341,-7.468626966435207],2;
-0.0728756555332089,-2};
ScaleS = -0.5818609561112537;
ScaleD = -1.7186236496830642;
Family = 'Coiflet';
case 'coif2'
Seq = {-2.5303036209828274,0;
[0.3418203790296641,-0.2401406244344829],0;
[15.268378737252995,3.1631993897610227],2;
[-0.0646171619180252,0.005717132970962],-2;
[13.59117256930759,-63.95104824798802],4;
[-0.0018667030862775,0.0005087264425263],-4;
-3.7930423341992774,5};
ScaleS = 0.1076673102965570;
ScaleD = 9.2878701738310099;
Family = 'Coiflet';
case 'bcoif1'
Seq = {0,0; -[1,1]/5,1;[5,5]/14,0;
-[21,21]/100,1};
ScaleS = sqrt(2)*7/10;
ScaleD = sqrt(2)*5/7;
Family = 'Nearly orthonormal Coiflet-like';
case {'lazy','spline0.0','rspline0.0','d0'}
Seq = {0,0};
ScaleS = 1;
ScaleD = 1;
Family = 'Lazy';
case {'spline0.1','rspline0.1'}
Seq = {1,-1};
ScaleD = 1;
case {'spline0.2','rspline0.2'}
Seq = {[1,1]/2,0};
ScaleD = 1;
case {'spline0.3','rspline0.3'}
Seq = {[-1,6,3]/8,1};
ScaleD = 1;
case {'spline0.4','rspline0.4'}
Seq = {[-1,9,9,-1]/16,1};
ScaleD = 1;
case {'spline0.5','rspline0.5'}
Seq = {[3,-20,90,60,-5]/128,2};
App en d i x B 377
ScaleD = 1;
case {'spline0.6','rspline0.6'}
Seq = {[3,-25,150,150,-25,3]/256,2};
ScaleD = 1;
case {'spline0.7','rspline0.7'}
Seq = {[-5,42,-175,700,525,-70,7]/1024,3};
ScaleD = 1;
case {'spline0.8','rspline0.8'}
Seq = {[-5,49,-245,1225,1225,-245,49,-
5]/2048,3};
ScaleD = 1;
case {'spline1.0','rspline1.0'}
Seq = {0,0; -1,0};
ScaleS = sqrt(2);
ScaleD = -1/sqrt(2);
case {'spline1.3','rspline1.3'}
Seq = {0,0; -1,0; [-1,8,1]/16,1};
ScaleS = sqrt(2);
ScaleD = -1/sqrt(2);
case {'spline1.5','rspline1.5'}
Seq = {0,0; -1,0; [3,-22,128,22,-3]/256,2};
ScaleS = sqrt(2);
ScaleD = -1/sqrt(2);
case {'spline1.7','rspline1.7'}
Seq = {0,0; -1,0;
[-5,44,-201,1024,201,-44,5]/2048,3};
ScaleS = sqrt(2);
ScaleD = -1/sqrt(2);
case {'spline2.0','rspline2.0'}
Seq = {0,0; -[1,1]/2,1};
ScaleS = sqrt(2);
ScaleD = 1;
case {'spline2.1','rspline2.1'}
Seq = {0,0; -[1,1]/2,1;0.5,0};
ScaleS = sqrt(2);
case {'spline2.2','rspline2.2','cdf5/3','legall5/3','s
+p(2,2)','lc5/3'}
Seq = {0,0; -[1,1]/2,1;[1,1]/4,0};
ScaleS = sqrt(2);
case {'spline2.4','rspline2.4'}
Seq = {0,0; -[1,1]/2,1;[-3,19,19,-3]/64,1};
ScaleS = sqrt(2);
case {'spline2.6','rspline2.6'}
Seq =
{0,0; -[1,1]/2,1;[5,-39,162,162,-
39,5]/512,2};
3 78 App en d i x B
ScaleS = sqrt(2);
case {'spline2.8','rspline2.8'}
Seq =
{0,0; -[1,1]/2,1;[-35,335,-1563,
5359,5359,-1563,335,-35]/16384,3};
ScaleS = sqrt(2);
case {'spline3.0','rspline3.0'}
Seq = {-1/3,-1;-[3,9]/8,1};
ScaleS = 3/sqrt(2);
ScaleD = 2/3;
case {'spline3.1','rspline3.1'}
Seq = {-1/3,-1;-[3,9]/8,1;4/9,0};
ScaleS = 3/sqrt(2);
ScaleD = -2/3;
case {'spline3.3','rspline3.3'}
Seq = {-1/3,-1;-[3,9]/8,1;[-3,16,3]/36,1};
ScaleS = 3/sqrt(2);
ScaleD = -2/3;
case {'spline3.5','rspline3.5'}
Seq =
{-1/3,-1;-[3,9]/8,1;[5,-34,128,34,-5]
/288,2};
ScaleS = 3/sqrt(2);
ScaleD = -2/3;
case {'spline3.7','rspline3.7'}
Seq =
{-1/3,-1;-[3,9]/8,1;[-35,300,-1263,
4096,1263,-300,35]/9216,3};
ScaleS = 3/sqrt(2);
ScaleD = -2/3;
case {'spline4.0','rspline4.0'}
Seq = {-[1,1]/4,0; -[1,1],1};
ScaleS = 4/sqrt(2);
ScaleD = 1/sqrt(2);
ScaleS = 1; ScaleD = 1;
case {'spline4.1','rspline4.1'}
Seq = {-[1,1]/4,0; -[1,1],1;6/16,0};
ScaleS = 4/sqrt(2);
ScaleD = 1/2;
case {'spline4.2','rspline4.2'}
Seq = {-[1,1]/4,0; -[1,1],1;[3,3]/16,0};
ScaleS = 4/sqrt(2);
ScaleD = 1/2;
case {'spline4.4','rspline4.4'}
Seq =
{-[1,1]/4,0; -[1,1],1;[-5,29,29,-5]
/128,1};
ScaleS = 4/sqrt(2);
ScaleD = 1/2;
App en d i x B 3 79
case {'spline4.6','rspline4.6'}
Seq =
{-[1,1]/4,0; -[1,1],1;[35,-265,998,998,-
265,35]/4096,2};
ScaleS = 4/sqrt(2);
ScaleD = 1/2;
case {'spline4.8','rspline4.8'}
Seq =
{-[1,1]/4,0; -[1,1],1;[-63,595,-2687,
8299,8299,-2687,595,-63]/32768,3};
ScaleS = 4/sqrt(2);
ScaleD = 1/2;
case {'spline5.0','rspline5.0'}
Seq =
{0,0; -1/5,0; -[5,15]/24,0; -[9,15]/10,1};
ScaleS = 3*sqrt(2);
ScaleD = sqrt(2)/6;
case {'spline5.1','rspline5.1'}
Seq =
{0,0; -1/5,0; -[5,15]/24,0;
-[9,15]/10,1;1/3,0};
ScaleS = 3*sqrt(2);
ScaleD = sqrt(2)/6;
case {'spline5.3','rspline5.3'}
Seq =
{0,0; -1/5,0; -[5,15]/24,0;
-[9,15]/10,1;[-5,24,5]/72,1};
ScaleS = 3*sqrt(2);
ScaleD = sqrt(2)/6;
case {'spline5.5','rspline5.5'}
Seq =
{0,0; -1/5,0; -[5,15]/24,0;
-[9,15]/10,1;[35,-230,768,230,-35]
/2304,2};
ScaleS = 3*sqrt(2);
ScaleD = sqrt(2)/6;
case {'cdf9/7'}
Seq =
{0,0; [1,1]*-1.5861343420693648,1;[1,1]
*-0.0529801185718856,0;
[1,1]*0.8829110755411875,1;[1,1]*0.4435068520511
142,0};
ScaleS = 1.1496043988602418;
ScaleD = 1/ScaleS;
Family = 'Cohen-Daubechies-Feauveau';
case 'v9/3'
Seq = {0,0; [-1,-1]/2,1;[1,19,19,1]/80,1};
ScaleS = sqrt(2);
Family = 'HSV design';
case {'s+p(4,2)','lc9/7-m'}
Seq = {0,0; [1,-9,-9,1]/16,2;[1,1]/4,0};
ScaleS = sqrt(2);
380 App en d i x B
Family = 'S+P';
case 's+p(6,2)'
Seq = {0,0; [-3,25,-150,-150,25,-3]
/256,3;[1,1]/4,0};
ScaleS = sqrt(2);
Family = 'S+P';
case {'s+p(4,4)','lc13/7-t'}
Seq = {0,0; [1,-9,-9,1]/16,2;[-1,9,9,-1]/32,1};
ScaleS = sqrt(2);
Family = 'S+P';
case {'s+p(2+2,2)','lc5/11-c'}
Seq = {0,0; [-1,-1]/2,1;[1,1]/4,0; -[-1,1,1,-1]
/16,2};
ScaleS = sqrt(2);
Family = 'S+P';
case 'tt'
Seq = {1,0; [3,-22,-128,22,-3]/256,2};
ScaleD = sqrt(2);
Family = 'Le Gall-Tabatabai polynomial';
case 'lc2/6'
Seq = {0,0; -1,0; 1/2,0; [-1,0,1]/4,1};
ScaleS = sqrt(2);
ScaleD = -1/sqrt(2);
Family = 'Reverse spline';
case 'lc2/10'
Seq = {0,0; -1,0; 1/2,0; [3,-22,0,22,-3]/64,2};
ScaleS = sqrt(2);
ScaleD = -1/sqrt(2);
Family = 'Reverse spline';
case 'lc5/11-a'
Seq = {0,0; -[1,1]/2,1;[1,1]/4,0; [1,-1,-1,1]
/32,2};
ScaleS = sqrt(2);
ScaleD = -1/sqrt(2);
Family = 'Low complexity';
case 'lc6/14'
Seq = {0,0; -1,0; [-1,8,1]/16,1;[1,-6,0,6,-1]
/16,2};
ScaleS = sqrt(2);
ScaleD = -1/sqrt(2);
Family = 'Low complexity';
case 'lc13/7-c'
Seq = {0,0; [1,-9,-9,1]/16,2;[-1,5,5,-1]/16,1};
ScaleS = sqrt(2);
ScaleD = -1/sqrt(2);
App en d i x B 3 81
if ~isempty(findstr(lower(WaveletName),'rspline'))
[Seq,ScaleS,ScaleD] = seqdual(Seq,ScaleS,ScaleD);
Family = 'Reverse spline';
end
return;
function [Seq,ScaleS,ScaleD] =
seqdual(Seq,ScaleS,ScaleD)
% Dual of a lifting sequence
L = size(Seq,1);
for k = 1: L
% f'(z) = -f(z^-1)
Seq{k,2} = -(Seq{k,2} - length(Seq{k,1}) + 1);
Seq{k,1} = -fliplr(Seq{k,1});
end
if all(Seq{1,1} = = 0)
Seq = reshape({Seq{2: end,: }},L-1,2);
else
[Seq{1: L+1,: }] = deal(0,Seq{1: L,1},0,Seq{1:
L,2});
end
ScaleS = 1/ScaleS;
ScaleD = 1/ScaleD;
return;
h = {1,0};
g = {1,1};
382 App en d i x B
for k = 1: 2: size(Seq,1)
h = lp_lift(h,g,{Seq{k,: }});
g = lp_lift(g,h,{Seq{k+1,: }});
end
h = {ScaleS*h{1},h{2}};
g = {ScaleD*g{1},g{2}};
if Dual
h{2} = -(h{2} - length(h{1}) + 1);
h{1} = fliplr(h{1});
return;
function a = lp_lift(a,b,c)
% a(z) = a(z) + b(z) c(z^2)
d = zeros(1,length(c{1})*2-1);
d(1: 2: end) = c{1};
d = conv(b{1},d);
z = b{2}+c{2}*2;
zmax = max(a{2},z);
f = [zeros(1,zmax-
a{2}),a{1},zeros(1,a{2} - length(a{1}) - z +
length(d))];
i = zmax-z + (1: length(d));
f(i) = f(i) + d;
function X = xfir(B,Z,X,Ext)
%XFIR Noncausal FIR filtering with boundary handling.
% Y = XFIR(B,Z,X,EXT) filters X with FIR filter B with
leading
App en d i x B 383
N = size(X);
switch lower(Ext)
case {'sym','wsws'} % Symmetric extension, WSWS
if all([pl,pr] < N(1))
X =
filter(B,1,X([pl+1: -1: 2,1:
N(1),N(1)-1: -1: N(1)-pr],:,: ),[],1);
X = X(Z+pl+1: Z+pl+N(1),:,: );
return;
else
i = [1: N(1),N(1)-1: -1: 2];
Ns = 2*N(1) - 2 + (N(1) = = 1);
i =
i([rem(pl*(Ns-1): pl*Ns-1,Ns)+1,1:
N(1),rem(N(1): N(1)+pr-1,Ns)+1]);
end
case {'symh','hshs'} % Symmetric extension, HSHS
if all([pl,pr] < N(1))
i =
[pl: -1: 1,1: N(1),N(1): -1:
N(1)-pr+1];
else
i = [1: N(1),N(1): -1: 1];
Ns = 2*N(1);
384 App en d i x B
i =
i([rem(pl*(Ns-1): pl*Ns-1,Ns)+1,1:
N(1),rem(N(1): N(1)+pr-1,Ns)+1]);
end
case 'wshs' % Symmetric extension, WSHS
if all([pl,pr] < N(1))
i =
[pl+1: -1: 2,1: N(1),N(1): -1:
N(1)-pr+1];
else
i = [1: N(1),N(1): -1: 2];
Ns = 2*N(1) - 1;
i =
i([rem(pl*(Ns-1): pl*Ns-1,Ns)+1,1:
N(1),rem(N(1): N(1)+pr-1,Ns)+1]);
end
case 'hsws' % Symmetric extension, HSWS
if all([pl,pr] < N(1))
i = [pl: -1: 1,1: N(1),N(1)-1: -1:
N(1)-pr];
else
i = [1: N(1),N(1)-1: -1: 1];
Ns = 2*N(1) - 1;
i = i([rem(pl*(Ns-1): pl*Ns-1,Ns)+1,1:
N(1),rem(N(1): N(1)+pr-1,Ns)+1]);
end
case 'zpd'
Ml = N; Ml(1) = pl;
Mr = N; Mr(1) = pr;
X = filter(B,1,[zeros(Ml);X;zeros(Mr)],[],1);
X = X(Z+pl+1: Z+pl+N(1),:,: );
return;
case 'per' % Periodic
i = [rem(pl*(N(1)-1): pl*N(1)-1,N(1))+1,1:
N(1),rem(0: pr-1,N(1))+1];
case 'sp0' % Constant extrapolation
i = [ones(1,pl),1: N(1),N(1)+zeros(1,pr)];
case 'asym' % Asymmetric extension
i1 = [ones(1,pl),1: N(1),N(1)+zeros(1,pr)];
end
X =
filter(B,1,2*X(i1,:,: ) - X(i2,:,: ),[],1);
X =
X(Z+pl+1: Z+pl+N(1),:,: );
return;
otherwise
error(['Unknown boundary handling,
''',Ext,'''.']);
end
X = filter(B,1,X(i,:,: ),[],1);
X = X(Z+pl+1: Z+pl+N(1),:,: );
return;
c = h{1}*2/sum(h{1});
x = 0: dx: length(c) - 1;
x1 = x - h{2};
phi0 = 1 - abs(linspace(-1,1,length(x))).';
for k = 1: length(c)
xk = 2*x - (k-1);
i = find(xk > = 0 & xk < = length(c) - 1);
ii = [ii,i];
jj = [jj,floor(xk(i)/dx)+1];
s = [s,c(k)+zeros(size(i))];
end
Dilation = sparse(ii,jj,s,length(x),length(x));
for N = 1: 30
phi = Dilation*phi0;
if norm(phi - phi0,inf) < 1e-5, break; end
phi0 = phi;
end
if norm(phi) = = 0
phi = o
nes(size(phi))*sqrt(2); % Special case
for Haar scaling function
386 App en d i x B
else
phi = phi/(norm(phi)*sqrt(dx)); % Rescale result
end
if nargout > 2
phi2 = phi(1: 2: end); % phi2 is approximately
phi(2x)
if length(c) = = 2
L = length(phi2);
else
L = ceil(0.5/dx);
end
for k = 1: length(c)
i = (1: length(phi2)) + L*(k-1);
psi(i) = psi(i) + c(k)*phi2;
end
end
return;
function s = filterstr(a,K)
% Convert a filter to a string
[n,d] = rat(K/sqrt(2));
if d < 50
a{1} = a{1}/sqrt(2); % Scale filter by sqrt(2)
s = '(';
else
s = '';
end
for i = 1: length(Scale)
if norm(round(a{1}*Scale(i))/Scale(i) -
a{1},inf) < 1e-9
a{1} = a{1}*Scale(i); % Scale filter by a
power of 2 or 160
s = '(';
break;
end
end
App en d i x B 387
z = a{2};
LineOff = 0;
for k = 1: length(a{1})
v = a{1}(k);
if v ~ = 0 % Only display nonzero coefficients
if k > 1
s2 = [' ',char(44-sign(v)),' '];
v = abs(v);
else
s2 = '';
end
s2 = sprintf('%s%g',s2,v);
if z = = 1
s2 = sprintf('%s z',s2);
elseif z ~ = 0
s2 = sprintf('%s z^%d',s2,z);
end
if length(s) + length(s2) > 72 + LineOff % Wrap
long lines
s2 = [char(10),' ',s2];
LineOff = length(s);
end
s = [s,s2];
end
z = z - 1;
end
if s(1) = = '('
s = [s,')'];
if d < 50, s = [s,' sqrt(2)']; end
if i < length(Scale)
s = sprintf('%s/%d',s,Scale(i));
end
end
return;
function N = numvanish(g)
% Determine the number of vanishing moments from
highpass filter g(z)
[g,r] = deconv(g,[1,-1]);
if norm(r,inf) > 1e-7, break; end
end
return;
function [iout,qout] =
giins(idata,qdata,fftlen,gilen
,nd);
idata1 = reshape(idata,fftlen,nd);
qdata1 = reshape(qdata,fftlen,nd);
idata2 = [idata1(fftlen-gilen+1: fftlen,: );idata1];
qdata2 = [qdata1(fftlen-gilen+1: fftlen,: );qdata1];
iout = reshape(idata2,1,(fftlen+gilen)*nd);
qout = reshape(qdata2,1,(fftlen+gilen)*nd);
function [iout,qout] =
girem(idata,qdata,fftlen2,gilen
,nd);
idata2 = reshape(idata,fftlen2,nd);
qdata2 = reshape(qdata,fftlen2,nd);
iout = idata2(gilen+1: fftlen2,: );
qout = qdata2(gilen+1: fftlen2,: );
function [iout,qout] =
giins1(idata,qdata,fftlen,
gilen,nd);
idata1 = reshape(idata,fftlen,nd);
qdata1 = reshape(qdata,fftlen,nd);
gg = gilen/2;
idata2 = [
zeros(gg,nd);idata1(fftlen-gg+1: fftlen,: )
;idata1];
App en d i x B 389
qdata2 = [
zeros(gg,nd);qdata1(fftlen-gg+1:
fftlen,: );qdata1];
iout = reshape(idata2,1,(fftlen+gilen)*nd);
qout = reshape(qdata2,1,(fftlen+gilen)*nd);
function[iout,qout,ramp,rcos,rsin] = sefade(idata,qdat
a,itau,dlvl,th,n0,itn,n1,nsamp,tstp,fd,flat)
iout = zeros(1,nsamp);;
qout = zeros(1,nsamp);;
total_attn = sum(10.^(-1 .0. *dlvl./10.0));
for k = 1: n1
atts = 10.^(-0.05.*dlvl(k));
theta = th(k).*pi./180.0;
[itmp,qtmp] = delay(idata,qdata,nsamp,itau(k));
[itmp3,qtmp3,ramp,rcos,rsin] = fade(itmp,qtmp,ns
amp,tstp,fd,n0(k),itn(k),flat);
iout = iout+atts.*itmp3./sqrt(total_attn);
qout = qout+atts.*qtmp3./sqrt(total_attn);
end
function [iout,qout] =
girem1(idata,qdata,fftlen2,gile
n,nd);
idata2 = reshape(idata,fftlen2,nd);
qdata2 = reshape(qdata,fftlen2,nd);
iout = idata2(gilen+1: fftlen2,: );
qout = qdata2(gilen+1: fftlen2,: );
function [iout,qout] =
giins1(idata,qdata,fftlen,gilen
,nd);
idata1 = reshape(idata,fftlen,nd);
qdata1 = reshape(qdata,fftlen,nd);
idata2 = [zeros(gilen,nd);idata1];
qdata2 = [zeros(gilen,nd);qdata1];
iout = reshape(idata2,1,(fftlen+gilen)*nd);
qout = reshape(qdata2,1,(fftlen+gilen)*nd);
Digital & Wireless Communications
Covering the spectrum of image encryption principles and techniques, the book
compares image encryption with permutation- and diffusion-based approaches. It
explores number theory-based encryption algorithms such as the Data Encryption
Standard, the Advanced Encryption Standard, and the RC6 algorithms. It not only
details the strength of various encryption algorithms, but also describes their
ability to work within the limitations of wireless communication systems.
Since some ciphers were not designed for image encryption, the book explains
how to modify these ciphers to work for image encryption. It also provides
instruction on how to search for other approaches suitable for this task. To
make this work comprehensive, the authors explore communication concepts
concentrating on the orthogonal frequency division multiplexing (OFDM) system
and present a simplified model for the OFDM communication system with its
different implementations.
Complete with simulation experiments and MATLAB® codes for most of the
simulation experiments, this book will help you gain the understanding required
to select the encryption method that best fulfills your application requirements.
K16760
6000 Broken Sound Parkway, NW ISBN: 978-1-4665-7698-8
Suite 300, Boca Raton, FL 33487 90000
711 Third Avenue
New York, NY 10017
an informa business 2 Park Square, Milton Park
www.crcpress.com Abingdon, Oxon OX14 4RN, UK
9 781466 576988
w w w.crcpress.com