Citation
Wavelet-based encoding and decoding algorithm for efficient, secure and noise-robust digital communication

Material Information

Title:
Wavelet-based encoding and decoding algorithm for efficient, secure and noise-robust digital communication
Creator:
Mbuyamba, John
Place of Publication:
Denver, Colo.
Publisher:
University of Colorado Denver
Publication Date:
Language:
English
Physical Description:
x, 84 leaves : ; 28 cm

Thesis/Dissertation Information

Degree:
Master's ( Master of Science)
Degree Grantor:
University of Colorado Denver
Degree Divisions:
Department of Electrical Engineering, CU Denver
Degree Disciplines:
Electrical Engineering
Committee Chair:
Bialasiewicz, Jan T.
Committee Members:
Deng, Yiming
Golkowski, Mark

Subjects

Subjects / Keywords:
Digital communications ( lcsh )
Wavelets (Mathematics) ( lcsh )
Data encryption (Computer science) ( lcsh )
Algorithms ( lcsh )
Algorithms ( fast )
Data encryption (Computer science) ( fast )
Digital communications ( fast )
Wavelets (Mathematics) ( fast )
Genre:
bibliography ( marcgt )
theses ( marcgt )
non-fiction ( marcgt )

Notes

Bibliography:
Includes bibliographical references (leaf 84).
General Note:
Department of Electrical Engineering
Statement of Responsibility:
by John Mbuyamba.

Record Information

Source Institution:
|University of Colorado Denver
Holding Location:
|Auraria Library
Rights Management:
All applicable rights reserved by the source institution and holding location.
Resource Identifier:
698184537 ( OCLC )
ocn698184537
Classification:
LD1193.E54 2010m M38 ( lcc )

Full Text
WAVELET-BASED DATA ENCODING AND DECODING ALGORITHM FOR
EFFICIENT, SECURE AND NOISE-ROBUST
DIGITAL COMMUNICATION
by
John Mbuyamba
B.S., University of Kinshasa, 2004
A thesis submitted to the
University of Colorado Denver
In partial fulfillment
of the requirements for the degree of
Master of Science
Electrical Engineering
2010


This thesis for the Master of Science
Degree by
John Mhuyamba
has been approved
by
Jan Bialasiewicz
Mark Golkowski
n-og^xo(o
Date


Mbuyamba, John (M.S. Electrical Engineering)
Wavelet-Based Data Encoding and Decoding Algorithm for Efficient, Secure and
Noise-Robust Digital Communication
Thesis directed by Associate Professor Jan Bialasiewicz
ABSTRACT
A wavelet transform is a linear operation that decomposes a signal into several
scales (or resolutions) that represent different frequency bands. This transform
provides a mapping of the signal into a two-dimensional function of time and
frequency by convolving the signal with a family of dilated band-pass filters. This
decomposition enables a time-frequency analysis technique that has been used widely
in signal processing applications. In order to implement the efficient transmission of
secure digital information through an analog communication channel, one can use the
wavelet transform in order to convert digital data into an analog signal.
The purpose of the present study was to investigate and demonstrate the
wavelet-based approach as an alternative encoding-decoding scheme for the efficient,
secure and noise-robust signal in digital communication system. To achieve this goal,
we developed an algorithm which will first transform digital data into an analog
signal, then transmit and decode thereafter. This algorithm approaches the problem by
encoding digital data from multiple users that are sharing the same analog
communication channel using wavelets. The individual encoded data streams are
summed up to obtain an analog signal to then be transmitted. It is assumed that during
the transmission this signal is contaminated by additive white Gaussian noise.


Therefore, the decoding process removes all noise by setting an acceptable threshold
value and then retrieves the original discrete data.
The developed algorithm was tested and verified using the simulator
implemented in MATLAB GUI (Graphical User Interface), which encodes digital
data, sums up all individual channels, transmits the obtained analog signal, and
decodes the received signal to retrieve the original digital data. The overall scheme
used in this algorithm has provided satisfactory results by not only minimizing the
probability of third party interception and decoding, but also minimizing transmission
errors.
This abstract accurately represents the content of the candidates thesis. I recommend
its publication.
Signed
Jan Bialasiewicz


DEDICATION
I would like to dedicate this thesis to my wife Nada, and to my two daughters, Gracie
and Christy for their support and understanding. First, Nada has been extremely
supportive of me since I started pursuing this degree. She has sacrificed much of our
time together by allowing me to complete this thesis to the best of my abilities.
Finally, to my daughters who were sometimes left disappointed because I could not
give them my full attention while completing this work as they are still very young.
Thank you for your love and patience.


ACKNOWLEDGMENT
I would like to express my sincere gratitude to my advisor Dr. Jan Bialasiewicz for
his continuous support of my Masters study and research, for his patience,
motivation, enthusiasm, and immense knowledge. His guidance helped me in all the
time of research and writing of this thesis.


TABLE OF CONTENTS
Figures.....................................................................ix
Tables......................................................................x
Chapter
1. Introduction..............................................................1
1.1 Motivation...............................................................1
1.2 Objectives...............................................................2
1.3 Outline................................................................. 3
2. Literature Review.........................................................4
2.1 Continuous Wavelet Transform (CWT).......................................4
2.2 Discrete Wavelet Transform (DWT)........................................6
2.3 Relation Scale-Frequency and Sampling Frequency.........................7
2.4 Morlet Wavelet..........................................................9
3. Digital Communication System.............................................12
3.1 Systems Components......................................................12
3.2 Wavelet Modulation.....................................................14
3.3 Wavelet Demodulation...................................................15
3.4 Noise Rejection........................................................16
3.5 Energy Threshold Detection and Bit Recovery............................16
3.6 Synchronization........................................................17
4. Wavelet-Based Data Algorithm and Implementation..........................18
4.1 Calculate Morlet Wavelet Utility........................................20
4.2 Encode Data Utility....................................................21
4.3 Add Noise Utility......................................................23
4.4 Decode Data Utility....................................................25
4.5 Bit Error Rate (BER) Calculation.......................................26
vii


5. Operations.............................................................27
5.1 GUI Main Menu.........................................................27
5.2 Input Parameters..............................................:.......28
5.3 Encode Data...........................................................30
5.4 Transmission of the Signal............................................31
5.5 Decode Data...........................................................32
5.6 Results...............................................................33
6. Results................................................................35
6.1 Noise Robustness......................................................35
6.2.1 Results of BER vs SNR in Case of Frequency Overlap..................36
6.2.2 Results of BER vs SNR in Case of no Frequency Overlap...............37
6.2.3 Results of BER vs SNR in Case of no Frequency and More Time.........38
6.2.4 Results of BER vs SNR in Case of frequency and More Time............39
6.3 Security..............................................................40
7. Conclusion.............................................................43
Appendix
A. MATLAB Computer Programs..............................................45
B. Determination of Subbands for the Communication Channel Bandwidth.....82
Bibliography..............................................................84
viii


LIST OF FIGURES
Figures
2.2 Real Part of Morlet Wavelet...........................................10
3.1 Digital Communication using Wavelet Encoder and Decoder...............13
3.2 Channel Allocation using Nonorthogonal Wavelet Multiple Access .......13
4.1 Flow Diagram of Wavelet-Based Algorithm...............................19
4.2 The Morlet Wavelet Utility............................................20
4.3 The Encode Data Utility...............................................21
4.4 Encoded Data..........................................................22
4.5 Create Summed Channel Utility.........................................22
4.6 Transmitted Signal....................................................23
4.7 The Add Noise Utility.................................................24
4.8 Noisy Transmitted Signal..............................................25
4.9 The Decoded Data Utility..............................................26
5.1. The Graphical User Interface Main Menu................................28
5.2 Digital Data of Four Users............................................29
5.3 Encoded Data for Individual User Channels.............................30
5.5 Noise Added to the Transmitted Analog Signal..........................32
5.6 Decoded Data for all Users............................................33
5.7 BER Calculation.......................................................34
6.1 Graph of BER vs SNR with Frequency Overlap............................36
6.2 Graph of BER vs SNR without Frequency Overlap.........................37
6.3 Graph of BER vs SNR with no Frequency Overlap and More Time...........38
6.4 Graph of BER vs SNR with Frequency Overlap and More Time..............39
IX


LIST OF TABLES
Table
6.1 Decoding Results Based on Guessed Shift and Scaling Parameters.........41
x


1. Introduction
1.1 Motivation
Methods to efficiently and securely transmit digital information over some
shared finite bandwidth among multiple users have been investigated for many years.
As the demand for bandwidth increases, service providers may face problems with
spectrum scarcity. If the bandwidth were infinite, then one could send the messages
of many users in an infinitely small fraction of time, but since the bandwidth is
usually rather limited, and since there are many users who want to send messages
over the same channel, it is important to design methods to let as many messages as
possible go through. Besides, the system should be robust to noise, so that there is a
low bit error rate. Finally, the system should be secure, i.e., should not allow for an
easy interception and decoding by outside parties.
This thesis presents an interesting variant of multiple access algorithms that
uses a nonorthogonal wavelet functions to encode and decode digital information for
transmission through an analog communication channel. Theoretically, conventional
communication systems use Frequency Division Multiple Access (FDMA), Time
Division Multiple Access (TDMA), Code Division Multiple Access (CDMA) or
Wavelet Packet Multiple Access (WPMA) as multiple access methods. In all these
methods, the atoms with which the transmission signal may be built are required to be
orthogonal. In fact, in FDMA orthogonal frequency bands are assigned to different
users; in TDMA they are orthogonal timeslots and orthogonal codes in CDMA. In
WPMA, the wavelet packet atomic functions are also orthogonal. In this thesis, the
atomic sets of nonorthogonal wavelet functions are used. The channel is represented
as a time-frequency plane which is partitioned in overlapping chunks. It is actually
1


seen as a rectangular region that describes both the channel bandwidth and the time
window in which a communication signal must be transmitted and decoded.
1.2 Objectives
The primary goal of this thesis is to develop an algorithm for efficient, secure,
and noise-robust encoding and decoding digital information (represented by user bit
vector) for multiple access analog communication. Our main interest is directed
toward the construction of low probability of intercept (secure) transmission signals
that satisfy channel constraints, in addition to having a low probability of bit error.
To meet these requirements, nonorthogonal wavelet functions were employed
as the basic building blocks for the construction of communication signals. To
demonstrate the feasibility of the proposed approach, we identified the following
specific objectives:
1. Determine methods to design a best atomic set of nonorthogonal wavelet
functions;
2. Develop an algorithm for bit vector recovery;
3. Develop a simulator with Graphical User Interface (GUI), which would
enable to perform properly designed numerical experiments
4. Demonstrate and evaluate noise robustness and security.
Our overall objective is to deliver the design rules for the wavelet communication
scheme along with simulation tools for implementation and performance evaluation.
2


1.3 Outline
We organize this thesis as follows. After a short introduction, chapter 2
provides a brief review on fundamentals of wavelets including the necessary
background theory. Topics covered include continuous and digital wavelet
transforms, relation of scale-frequency to sampling frequency, and Morlet wavelet
function. Chapter 3 briefly describes the details on wavelet modulation and
demodulation. Chapter 4 presents in detail the algorithm that is the main subject of
this thesis and afterwards, its concrete implementation. Chapter 5 explains the
operations of the designed graphical user interface. Chapter 6 discusses certain
performance results on noise robustness and security. A final conclusion is given in
chapter 7.
3


2. Literature Review
Wavelets are functions that satisfy certain mathematical requirements and are
used to represent data and other functions. Approximating functions using
superposition has existed since early 1800s, when Joseph Fourier discovered that he
could superpose sines and cosines to represent other functions. The fundamental idea
behind wavelets is to analyze according to scale. The wavelet analysis procedure is to
adopt a wavelet prototype function, called an analyzing wavelet or mother
wavelet. Because the original signal or function could be represented in terms of a
wavelet expansion (using coefficients in a linear combination of the wavelet
functions), data operations can be performed using just the corresponding wavelet
coefficients. If you further choose the best wavelets adapted to your data, or truncate
the coefficients below the threshold, your data is sparsely represented.
This chapter reviews some background materials important for the present
study, including continuous and discrete wavelet transforms. Given the necessity of
sharing the communication channel between multiple users using scaled wavelets, the
relationship between scale-frequency and sampling frequency will be presented. The
Morlet wavelet considered for encoding and decoding of digital data will also be
briefly introduced and reviewed.
2.1 Continuous Wavelet Transform (CWT)
Mathematically, the continuous wavelet transform of a function /(t) e L2 (R)
(space of square integrable functions) with respect to some analyzing wavelet if/ is
defined as
4


(2.1)
WÂ¥f{aib) = \ xf{t)y/*ab(t)dt,
where
1 (t-b
V'ab(t) = -j=W------
Vfl V )
a a e R+ ,b e R
(2.2)
is the doubly-indexed family of wavelets obtained by dilating and translating the
wavelet function y/(t). The normalizing coefficient /r ensures that the wavelets
/ 'JO
have the same energy at every scale and this energy is unity if the energy of the
mother wavelet is unity. The asterisk stands for complex conjugate. Parameters a
and b are called translation (shifting) and dilation or compression (scaling)
parameters of the mother wavelet y/(t), respectively. The mother wavelet is the
function with zero translation and a dilation of one.
A wavelet y/{t) is simply a function of time t that obeys a basic rule, known as the
wavelet admissibility condition:
r+ |'P()|2
Cw = f i-L-5 dco < +oo
^ Jo
<2-3>
where vP(, of y/(t). This condition ensures that
Â¥(0) = 0 that is, the wavelet has no zero frequency component. In other words, the
wavelet y/(t) must have a zero mean:
r riOdt = o. (2.4)
JcO
In addition to satisfying the expression (2.3), a wavelet is constructed to have higher
vanishing moments, that is,
£ f>(0<* = 0, p = 0,...,m-\. (2.5)
A wavelet should also have finite energy, that is,
n |y/ (0| dt < co
(2.6)
5


2.2 Discrete Wavelet Transform (DWT)
In the case of wavelet transform, the natural way to sample the time-frequency
plane is to take samples on the non-uniform grid (lattice) which defines parameters
{a,b) in (2.2) by
(a,b) = ,nbQa");a0 > 0,bQ > 0;m,n e Z ^J)
One classic choice by Daubechies in [4] sets(a0 = 2,b0 = 1). Therefore, the
quantization parameters a and b become a = 2m and b = n2m (m,ne Z),
respectively. This particular choice corresponds to a dyadic sampling of the time-
frequency plane as shown in Figure 2.1 and the resulting wavelet transform is known
as a dyadic wavelet transform.
A ^.(0
iili____
ft
t
Figure 2.1: Time-frequency boxes of a wavelet basis define a tiling of the time-
frequency plane
6


We obtain the dyadic orthonormal wavelet basis of the space I2 (R) with good time-
frequency localization properties given by
VmA<) = 2-^y,(rmt-n)Mz2 (2.8)
Substituting (2.7 into (2.1) gives the discrete wavelet transform (DWT) which is
defined by
W¥f(m,n) = £/(0^1(0<* (2-9)
2.3 Relation Scale-Frequency and Sampling Frequency
Assume that the wavelet [ ^max ] In other words, its Fourier transform ^(oj) can be neglected outside this
interval. Then, the spectrum 'Â¥mn(a>) (of the wavelety/mn) can be neglected outside
the interval [a>mm /2m,ft>max /2m]. So, we have
4^(0) = 2m/2vF(2 moy)e-j2mnm. (2.10)
We can introduce the center frequency of the wavelet
a0 = do> (2.11)
and its bandwidth B0 = the direction of the frequency axis is given by the following integral
<*i= <2i2>
So, we have B0 = a 6), amax = wavelet of the scale a the bandwidth and the center frequency are respectively
defined by the following equations:
7


(2.13)
a
a
a
which means that Bx = B0
At lower scales, the wavelet transform represents high-frequency components
of analyzed signals. The scale increase results in a shift of the bandwidth of the
wavelet bandpass filter towards lower frequencies. Simultaneously (for increasing
scale), the bandwidth decreases, which means improved frequency resolution. In
addition, we should remember that the center frequency coQ and the bandwidth
B0 depend on our choice of the analyzing wavelet. Signal analysis requires good
localization of the wavelet Fourier transform around the center frequency.
Let us recall that both in the cases of continuous and discrete wavelet transforms, we
use discrete representation of a signal, which is sampled at a certain frequency cop .
Then mpl 2 is the Nyquist frequency limiting the bandwidth of the discrete
representation of a signal. The variation of frequency of the continuous signal
between 0 and cop / 2, to which corresponds a point moving between these limiting
values along the imaginary axis of the complex plane .v = cr + ja>, is represented by a
point moving in the complex plane z along the unit circle centered at the origin. The
circle is described by the equation.
where T is the sampling interval of the continuous signal. This means that to the
frequency change of the continuous signal in the interval [0,cop 12] corresponds the
angle change or frequency change of the discrete signal, represented in radians, in the
interval [0,n ]. This is justified by the following calculation:
z = ej0>1 orZz = a>T}z\ = 1.
(2.14)
Zz
= fpj£_
a=m>n 2 ap
(2.15)
8


In other words to the frequency a>p / 2 [ rad / s ] of the continuous signal corresponds
the frequency of n radians. Thus, the frequency of the discrete time signal can be
represented as a normalized or relative frequency, obtained by dividing by n each
frequency a> from the interval [ 0, tt ]. The relative frequency coln = \ corresponds
the angle maximum frequency of the continuous-time signal preserved in its discrete-
time representation, which equals cop / 2 [ rad / s ] or fp/2[Hz]( a>p = 2nf ). We can
represent graphically the amplitude of the Fourier transform of wavelets at different
scales as a function of the relative frequency. We obtain the real value of frequency
by multiplying the relative frequency by the sampling frequency (represented in
radians per second or hertz).
2.4 Morlet Wavelet
Several wavelet basis functions have been proposed in wavelets theory.
However, each basis function has its suitable application. In this thesis, the Morlet
wavelet serves as the wavelet basis function for the encoding and decoding of digital
data. The Morlet wavelet contains exponential decay in both time and frequency,
which makes it optimal for the wavelet-based encoding and decoding algorithm. It
results from a sinusoidal signal modulated by a Gaussian wave and its frequency
support is the entire frequency axis. The Morlet wavelet is defined by [1]:
where am, a)0 are bandwidth and wavelet center frequency parameters respectively.
We will be focusing on the real part of the wavelet which is extracted from the
analytic expression of the Morlet wavelet given in (2.16). The basic Morlet wavelet
used in this thesis is expressed as follows:
(2.16)
9


(2.17)
y/{t) = e /2 cos(5/)
The Fourier transform is given by:
Â¥(<) =
(2.18)
This Morlet function satisfies equation (2.4). In fact, the Fourier transform value at
the origin can be practically considered as zero. In addition, it can also satisfy (2.6);
therefore, it can be used as a mother wavelet. This wavelet is shown in Figure 2.2.
Figure 2.2 Real part of Morlet Wavelet
10


Using (2.2), we can generate a family of Morlet wavelets:
Vablf) = -\=e
<(' h)la) /2cos(G>(t-b)/a)
(2.19)
11


3. Digital Communication System
In general, the purpose of a digital communication system is to convey a set of
raw bits from one location to another. In this section, we will describe the details of
the multiple access communication of digital information using an analog
communication channel. The approach considered is based on the idea of using
nonorthogonal sets of wavelets as building blocks or atoms for encoding of signals
for transmission over a given channel. The channel constraints are thought of as time-
frequency region in which signals for transmission are forced to reside. This may be a
rectangular region (as shown in Figure 2.1) that describes both channel bandwidth
and the time window in which a communication signal must be transmitted and
decoded.
After describing the system model, we will develop the construction procedure in
which to encode the desired digital information represented by the user bit vector.
Hereafter, the recovery procedure of the transmitted information from the received
signal, assumed corrupted with an additive noise, is developed. Noise rejection,
energy threshold detection and bit recovery, and synchronization will also be
discussed.
3.1 Systems components
We consider a multiple access setting with N users each of whom transmits a
single bit uk,k = 1,2,..., A over an Additive White Gaussian Noise (AWGN) channel
common to all users. The designed communication system can be illustrated by the
functional block diagram depicted in Figure 3.1. It is mainly composed of three basic
components: encoder, channel, and decoder. The encoder and decoder consist of the
12


following elements: digital wavelet processing, analog to/from digital conversion, and
transmitter/receiver. The digital data streams from these N users are being encoded
using Morlet wavelet functions, summed up into a single analog signal, and then send
through the channel. The decoding process will retrieve the original transmitted data
from the possibly corrupted signal received.
Figure 3.1 Digital communication System using Wavelet Encoder and Decoder
13


3.2 Wavelet Modulation
The nonorthogonal wavelet function sets are proposed to perform the partition
of the time-frequency region into smaller atomic regions. This allows for the time-
frequency region (representing the channel) to be partitioned in almost arbitrary and
overlapping chunks as shown in Figure 3.2. The number of bits to be represented
through the wavelet modulation in this time-frequency rectangle equals to the number
of these chunks.
Thus, a transmitted signal/is given by
m,n
where both the elements bmn of the user bit vector and the wavelet atoms
(elements of the set of atoms y/ to be designed) are doubly indexed, with
m representing scale, and n representing the translation in time at a particular scale
level. We assume that N is the number of (m, n) pairs assigned in the time-frequency
rectangle. In other words, it is assumed that bits are encoded in bundles of cells each
containing N bits where N is determined by the channel (or time-frequency
rectangle) and modulation scheme parameters (time-scale set of time-frequency grid
corresponding to the set of atoms y/). Mathematically, the main tool employed for the
encoding process is the Overcomplete Wavelet Transform (OWCT) determined by
specification of an analyzing wavelet y/ and a discrete sample set {tm,sm}in the
time-scale plane. More details about OWCT can be found on [1]. The fundamental
idea of the wavelet encoding scheme is to assign each element in the set of N bits
{um }the wavelet function y/m that is translated by tm and dilated (at scale level m)
version of the analyzing wavelet y/.
14


NWMA
Freq
wms
&

Time
Figure 3.2 Channel Allocation Using Nonorthogonal Wavelet Multiple Access
Scheme
3.3 Wavelet demodulation
The receiver input signal observed through the noise can be written as
/r=Z*WV+aW (32)
where w is a normalized noise process, and cr indicates the associated noise level.
Given a possibly corrupted version of the transmitted signal /, it is the objective of
the demodulation to recover the embedded bit set n}. The wavelet demodulator
requires the knowledge of the mother wavelet y/, the discrete time-scale set
^e essential support factor Sfac e[0,l], and the synchronization signal
indicating the start of a given bit packet of the length N. Using this information we
can determine rectangles Rmn in time-frequency plane, which contains
Sfac percentage of the energy of a given atom. In addition, we can introduce two
thresholds Sd e [0,l], and a noise rejection threshold Sn > 0. These two thresholds are
discussed in the following sections.
15


3.4 Noise rejection
In the wavelet domain, we introduce a thresholded wavelet transform
Wv £ f of a signal /, which results from using hard threshold in the wavelet domain.
Such operation in the wavelet domain performs noise suppression in the signal
domain. This is due to the fact that the signal is well correlated or coherent with a
small number of the underlying atomic wavelet functions, i.e., its energy is
concentrated in a small area in the time-frequency plane. On the contrary, energy of
the incoherent portion of the signal, which represents noise is spread throughout the
time-frequency plane and, consequently, will result in small wavelet coefficients.
Hence, a thresholding operation will naturally reject incoherence and preserve strong
coherence.
3.5 Energy threshold detection and bit recovery
Given the set of wavelet energy rectangles [Rm n} a simple energy threshold
detector may be employed to recover the embedded bit information. This bit recovery
process measures the energy emin each region indicating the start of a given bit
packet of the length N of the thresholded wavelet transform W s f of the received
and possibly noise corrupted signal /.
The energy of the encoded signal is defined by:
(3.3)
From the set {em n} of energies the embedded bits \um n }are estimated by,
d
0, otherwise
(3.4)
16


3.6 Synchronization
Since the receiver is continuously receiving the channel signal, it is necessary
to synchronize the detection process with the incoming signal. In other words, there is
a need for indication of the start of every bit packet of length N. The position of time-
frequency rectangular bit masks Rm n must be related to the indicator of the start of the
current bit packet. Lack of synchronization will likely result in unacceptably high bit
error rates [1].
17


4. Wavelet-Based Data Algorithm and Implementation
In this section, we present the designed wavelet-based algorithm and its
implementation. The flow diagram outlining our algorithm is described in Figure 4.1.
The algorithm uses Morlet wavelet function to encode and decode digital information.
Its implementation has been written in MATLAB. The algorithm consists of seven
different parts connected to each other. It starts with user bit vectors that are
randomly generated for each user. In this particular case, we have considered four
users that are generating bit vectors of length ten each. In the following sections, we
are going to explain in details each component of the algorithm.
18


Figure 4.1 Flow Diagram of wavelet-based Algorithm
19


4.1 Calculate Morlet Wavelet Utility
The Calculate Morlet Wavelet Utility creates scaled and shifted Morlet
wavelet functions for each user. These functions are used in the encoding and
decoding processes. From relation (2.10), it can be seen that two important
parameters (scale a and shift b) are needed in order to create these functions. The
scale parameter for each user is determined in Appendix B and the shift parameter,
which determines how much interference in time domain we will be dealing with, is
left to the designer choice. Figure 4.2 shows how the Morlet wavelet functions are
created in MATLAB language.
% Create user data (random)
for i = 1 :nusers
%U{i} = [0 0 1 00 1 0 1 0 1];
U{i} = randint(1,10);
end
% Create time and wavelet multiplier
t = 0:0.05:8*bitpuser*scale(nusers);
Ao = 1./sqrt(scale);
% Create wavelet vectors for each user for the transmit and receive functions
for i = 1 :nusers
for j = 1;bitpuser
phi{i}(j,:) = Ao(i)*exp(-(((t-(j*8-4)*scale(i))/scale(i)).A2)/2).*...
cos(5*((t-(j*8-4)*scale(i))/scale(i)));
end
end
Figure 4.2 The Morlet Wavelet Utility
20


4.2 Encode Data Utility
The Encode Data Utility, represented in Figure 4.3, constitutes the main part
of the wavelet-based algorithm. To encode a binary sequence of a particular user, we
will form a time sequence of his shifted wavelet. For a binary sequence of length ten,
we form a sequence of ten identical time-shifted wavelets and multiply consecutive
elements of this sequence by consecutive elements of binary sequence. Those
multiplied by zero will not be included in a continuous-time representation of the
binary sequence.
% Initializes all channels for each user
for i = 1:nusers
ch{i} = 0;
end
% Creates encoded/modulated signal for all users
for i = 1:nusers
forj =1:bitpuser
ch{i} = ch{i} + U{i}(j)*phi{i}(j,:);
end
end
% Plots of individual channels
figure(2)
plot(t,ch{1},t,ch{2},t,ch{3},t,ch{4})
titlef Individual User Channels')
xlabelf Time)
ylabelf Amplitude')
axis([0 300 -1.3 1.3])
grid;
Figure 4.3 The Encode Data Utility
Figure 4.4 shows the encoded digital data for four users plotted as analog signals
utilizing the Morlet wavelet functions. Each color represents an individual user
channel at a particular scale.
21


Individual User Channels
M
f
-i
o
50
100
150
Timo
200
250
300
Figure 4.4 Encoded Data
After the data have been encoded, we sum up individual channels to obtain the analog
communication channel using equation (3.1). Figure 4.5 demonstrates how to perform
been added.
% Sum the channels into one channel
for i = 1:nusers
f = f + ch{i};
end
% Plots the summed single channel without noise
figure(3)
plot(t,f)
titlef Summed Channel Without Noise')
xlabel( 'Time')
ylabel('Amplitude')
axis([0 300 -1.3 1.3])
grid;
Figure 4.5 Create Summed Channel Utility
the addition of individual channels in Matab language. At this point, noise has not yet
f = 0;
22


Figure 4.6 shows the transmitted signal without noise. All four signals are combined
into one signal and sent over a single communication channel.
Summed Channel Without Noise
0.6
-0 5
60
U V
Jri| |(F]
too
300
Figure 4.6 Transmitted Signal
During the transmission of this signal through the channel, it will inevitably
encounter some amount of noise or unwanted signal which will be picked up from the
environment. In the next section, we will examine a particular type of noise that
affects the signal into the channel.
4.3 Add Noise Utility
In this section, we are considering that the analog signal will be affected by
noise during its transmission in the channel. The simplest noise model is the Additive
White Gaussian Noise (AWGN) and is assumed in our case. We need to generate a
23


noise vector of the same length as our signal vector presented in (3.1). MATLAB
function randn generates normally distributed random numbers with mean zero and
a variance of one. Therefore, to create a noisy signal, we multiply the output of the
randn function by the standard deviation sqrt(varn). Figure 4.7 shows how the
noise is created in MATLAB language.
% Add guassian white noise at a level specified SNR
var s = (std(f))A2;
var_n = 10A(log10(var_s) (SNR/10));
eta = sqrt(var_n)*randn(size(f));
fnoise = f + eta;
% Plots the summed single channel with noise
figure(4)
plot(t, fnoise)
titlefl'Summed Channel With Noise SNR = ',num2str(SNR),'dB'])
xlabelf Time1)
ylabelf Amplitude')
axis([0 300 -1.3 1.3])
grid;
Figure 4.7 The Add Noise Utility
The noisy transmitted signal is simply obtained by adding the noise vector to the
signal vector. Figure 4.8 demonstrates the summed channel with noise of 0 dB added.
24


-§
f
Summed Channel With Noise SNR QdB
05
OS
300
Figure 4.8 Noisy Transmitted Signal
4.4 Decode Data Utility
To decode the corrupted version of the transmitted signal into the original
discrete data, the knowledge of the scaled-shifted wavelets used in the encoding
process is required. In fact to retrieve the signal for each users channel, the received
signal is subdivided (by convolution) according to each user set of scaled-shifted
wavelets. The threshold value is used to determine which coefficients represent ones
or zeros. Coefficients above this value are considered to be ones; those below this
value are considered to be zeros as indicated in Figure 4.9.
25


% Decode the signals for each user's channel
for i = 1:nusers
for j = 1:bitpuser
% Decodes the signal with a specified threshold
decoded{i}(j) = fnoise / phi{i}(j,:);
if abs(decoded{i}(j)) > threshold
decoded{i}(j) = 1;
else
decoded{i}(j) = 0;
end
% Calculates the total number of errors
if decoded{i}(j) ~= U{i}(j)
error_count(i) = error_count(i) + 1;
end
end
end
Figure 4.9 The Decoded Data Utility
4.5 Bit error Rate (BER) Calculation
The BER of digital communication system can be defined as the estimated
probability that any bit transmitted through the system will be received in error. It is
measured by transmitting a finite number of bits through the system and counting the
number of bit errors received. Therefore, the BER is defined as the ratio between the
number of erroneous bits detected to the total number of transmitted bits:
BER =
Number of erroneous bits
Total number of transmitted bits
*100
(4.1)
We are transmitting a well-defined bit stream over an interconnection channel. For
each bit, the receiver will decide whether a one or zero is received. Once all bits are
detected and compared with the transmitted bits, the erroneous bits are counted and
the BER can be calculated as shown in equation (4.1).
26


5. Operations
This chapter explains the operations of the wavelet-based encoding and
decoding algorithm using the graphical user interface (GUI) of MATLAB software.
MATLAB is viewed by many users not only as high-performance language for
technical computing and visualization but also as convenient environment for
building graphical users interfaces. A graphical user interface is a graphical display in
one or more windows containing controls called components that enable a user to
perform interactive tasks. GUI components can include menus, toolbars, push
buttons, radio buttons, list boxes, and sliders just to name a few. GUIs created using
MATLAB tools can also perform any type of computation, read and write data files,
communicate with other GUIs, and display data as tables or as plots. Therefore, it is a
convenient and efficient tool for program development.
5.1 GUI Main Menu
To launch the application, we have created a GUI code file wendgui, which
is an acronym for Wavelet-based Encoding and Decoding Graphical User Interface.
This file must reside on your path or in your current folder before running the
application. To execute this code file, the user enters wendgui at the command line
and MATLAB returns the interface shows in Figure 5.1.
The interface comprises four main sections. The top area at the right side of
the interface is designated to show the user bit vectors that will be securely
transmitted to intended recipients. The top graph area is used to represent the encoded
wavelet data. In fact, the discrete data is converted to continuous analog data by
utilizing Morlet wavelet function. The bottom graph area is used to show the
transmitted signal which is a multiplexing of four individual user data. Noise may
27


also be added to the signal and transmitted through the channel. The bottom area is
designated to show the decoded data of individual users.
WAVIII l HASH. IiAIAINIOOIMj AND DECODING SIMULATOR
Eb EA Bew Insert look Qesttop ygndow tjeb

jtia)*)
Decode OH Thresh) o 0.5-
o -iLLii1
Decode | oL
Output Detsj
TrantmltodDrt*
tx.ui: FFFFFFFFFF
Tx.w; FFFFFFFF # F
Txjn F F F F F F F F F F
Txj* f F F F F F F F F F
0.5
Time
Received Date
Figure 5.1. The Graphical User Interface Main Menu
5.2 Input Parameters
The Input Data pushbutton allows the user to randomly generate four user
bit vectors Tx_Ui (i = 1,2,3,4) with ten bits sequence each. When the application is
launched, the transmitted user bit vectors are all ones by default as shown in Figure
28


5.1. User may also choose to enter manually these discrete data as desired. However,
the MATLAB dialog function questdlg will prompt the user with a message The
value must be a binary if something else than a binary was typed in. Figure 5.2
shows how random digital data can be generated in the simulator.
V/AVIll l It ASf f> I'AI A M UDirst, AND DECODING SIMULATOR '
tf Eft SJew Ipote Qt&op Kflndow Bate
.lolxl
K
Input TranandtedDota
nrmtmar* fT (T (o F F F F F F F
Inesrowil Tx_U2 (o fT [o F F F F F F F
Genera LTsa-gwfeiF F F F F F F F
Dete Txjja: fi [i jo F F F F F F F
Encode
Plot Signal I
if 11120
n
Data
Thrwh-J 0
ojILl!1
Decode |
OulpUDela|
Received Dale
Dteplav |
ErrorCourt
BER %
ftxJJl:
Rx_U*
Rx_U3:
RxJJ4:
Figure 5.2 Digital Data of four Users
29


5.3 Encode Data
The Encode pushbutton will plot the encoded data for individual user
channels as shown in Figure 5.3. The encoded data is plotted with different colors
where every color represents an individual user channel as specified by the legend on
the graph. Basically this legend will obscure some part of the graph, but a feature was
added to be able to move it around. The encoding process is such that the binary
signal 0 is represented by no line and the binary signal 1 is represented by the
Morlet wavelet function.
* WAV! 11 i HAS! i. |>AI A I M IIUIW, AMD DECODING SIMULATOR v>'#;
0e EdK JJtvn Insert loots Qpdtop Jtfndow yrip
.jQjxJ
*
Input
Peremetace
Inpul Dtg|
Encod*
Data
Traramtted Data
TxJLH: |i-|Tfo|ofF'fo"fo"|,o"fi-|T
TxjafTfriFfrfrfrirfrfo'fo'
txj. fi"frfrfT[i"frfrfrfrfo'
TxJM: pi f7 fo fo |T fo fo fT fT fo
r Nolee
ThreahfT
o _iLLid1
Decade |
1------------------,-----------------j.
0.5...................\.................i
Output Deta|
Time
Received Pete
Dupny |
ErrorCount
BBT. %
Rx_U1:
Rx_U2
Rx.ua
RX.U4:
Figure 5.3 Encoded Data for Individual User Channels
30


5.4 Transmission of the Signal
Once all user bit vectors data have been encoded, we performed their addition
using equation (3.1). When the button Plot Signal is pushed, the encoded data from
all four users will be summed up to generate one single signal to be transmitted
through the channel. Figure 5.4 demonstrates the transmitted signal with zero value
for noise. To add noise levels to the transmitted signal, one will adjust the noise slider
by clicking on the right or left arrow of the slider; subsequently, the desired value of
the noise will be shown on the top part of the noise slider. Then click the Noise
checkbox to add noise to the transmitted analog signal. Figure 5.5 shows the
transmitted analog signal with noise.
* w A Vi 11 I HAM I > l *A I A I M I AND DECODING SIMULATOR
Efe E* Vm* Inert loob Qtrtoo Jtfndow tMp
-lalxl
v
Input
ParmMturi
Input Onto |
Onto
-M-J
i reniHWHKi dpW
txjui; fT [T fT fT fT (T |F (T (T F"
Txjn: fTfTfriTfrfrfrfrfrfF
Txjua FFFliFFFFrF
TxJJ*: fi|TfFfo"[T"fF(o"frfrfo
Dtxptny |
ErrofCount
BEIt: %
RxJJI:
RxJJ2
RX.U3:
Rx.LW:
Figure 5.4 The Transmitted Analog Signal
31


WAVIM 1 BAsi l > (AIA I N( AND DECODING SIMULATOR
EDe Edit iflaw Insert loots Desktop jyndow tjeb
-Ini x|
*
Input
Parawwtere
Input Dote I
Encode
Output Dala|
Dtaptay
ErrorCourt
Tranemltted Data
TxJJI: FFFFFFFFFF
Txjjz FFFFFFFFFF
tx.u ffffffffff
txjm; F F F F F F F F F F
fWmiMP UMr WnOTMW
PtoS Signal |
rrso"
pm
1 1 1 1 II 1 1 1 1 1 1 I pjWrpifTi|rppifi if w i TxJJl Tx_U2 Tx_U3 Tx_U4
1 L 1 1 1
SO 100 ISO 200 250
Summed Channel VUth Nolee SNR -5cB
300
nrniiR'ipiwrfTip'iM'r

liijJiliilli Llilli iUlk
i It jjdfti*
50
100
150
Time
--1--
nmnwB ww
BE
200
250
300
RxJJI:
Rxjtt
Rx.ua
RxJJS;
Figure 5.5 Noise Added to the Transmitted Analog Signal
5.5 Decode Data
Once the noisy transmitted signal is received, it must be decoded into the
original discrete data. Decoding data is done through two different steps. Before
decoding the received signal, the threshold needs to be set in order to decide which
coefficients represent ones and zeros. The threshold slider will eventually adjust the
threshold value. Next, by clicking on the button Decode the noisy transmitted
signal will be automatically decoded according to the threshold value set. The
32


decoded data can be displayed by clicking the button Output Data as shown in
Figure 5.6.
WAVELEI -BASED DATA ENCODING AND DECODING SIMULATOR
Rte Edit 55ew Insert loots Qpsfctop UJndow yelp
JOJx]
Parameters
Input Data I
Encode
Encode
Transmit Signal Plot Signal | pSaT -20^1^20 W Noise | o, 1 -1 0
Decode 1 \
Data m 1
ThrestrfoSOO 1 o
ojllJJi -if
Decode | 0
Transmitted Data
TxJJI: pT fT fo fo~ fo- fo~ fo~ fo- f7~ |T
tx_u2 pr[F(Tfr[r(r[r|rfrpr
ixuafT" {7* f7" f7" f7" fo" (7" |7" f7" Jo"
Tx_U4: fi~ f7" [o |flT pr fo" fo" [7 fl fo"
Individual User Channels
1 -
1 1 1 1 A AMfc ill1 .'.iliil. { pf 1 Iff f ¥ ¥ if i

TxJJ3 '

i i i i i
50 100 150 200
Sunned Channel VWi Noise SNR -SdB
250
300
Output the received data |
Received Data
Display )
ErrcrCourt
BER: %
RxJLM: 1
Rx_U2 1
Rx_U3; 0
Rx_U4: 0
Figure 5.6 Decoded Data for all Users
5.6 Results
Finally, the button Display will display the total number of bits
(ErrorCount) which have been flipped during the transmission of the analog signal
and the Bit Error Rate (BER) calculated based on the total number of bits transmitted.
Figure 5.7 shows the ErrorCount and BER for the noisy transmitted signal.
33


WAVEIET BASED DATA ENCODING AND DECODING SIMULATOR
ge e* SJew Insert loots Qesktop window tldp
input
Parameters
$$-

hpUDala I
Tx_U1: F F F F Transited Data F F F F F F
Tx_U2 F F F F F F F F F F
Tx_U3: F F F F F F F F F F
Tx_U4: F F F F F F F F F F
IndMdual User Channels
ErrorCount
BBt 125%
Figure 5.7 BER Calculation
34


6. Results
This chapter shows the experiments that have been carried out in order to
evaluate the performance of the proposed algorithm which is implemented on the
graphical user interface in the previous chapter. They are focused on performing
simulations and testing under different conditions to discuss the performance of the
designed communication scheme on noise robustness and security. The results are
presented along with conclusions that have been drawn. To evaluate the noise
robustness of our communication scheme, graphs of BER for different levels of noise
are examined. For the security part of the algorithm, we examine different attempts
to decode the transmitted signal without any knowledge of decoding parameters. The
following two sections present the performance results on the noise robustness and
security evaluations of the algorithm.
6.1 Noise Robustness
The addition of noise to the transmitted signal will degrade necessarily the
decoding performance of the overall communication system by increasing the bit
error rate. To compensate this degradation, a threshold value will need to be adjusted
accordingly. This threshold value plays an important role in the robustness of the
algorithm by determining which coefficients represent a one or zero.
Let us evaluate the noise robustness of the algorithm by running different simulations
of the BER versus SNR graphs of individual user channels. The curves represent the
overall performance of the receiver.
35


6.2.1 Results of BER vs SNR in Case of Frequency Overlap
The simulation was done with the following parameters: iterations = 100,
SNRRange = -25:1:25, THD = 0.5, nusers = 4, bitpuser = 10, scale = [1.87 2.2 2.8
3.3], t = 0:0.05:8*bitpuser*scale.
BER vs SNR
Figure 6.1 Graph of BER vs SNR with Frequency Overlap
It can be seen that the user bits are transmitted with low bit error rate for signal-
to-noise ratio as low as -10 dB. For low noise levels (i.e, SNR large), BER is small.
However, as noise increases beyond a certain threshold i.e. -12 dB, the BER rapidly
becomes unacceptable. Therefore, the scheme is reasonably robust for SNR values of
-10 dB and more.
36


6.2.2 Results of BER vs SNR in Case of no Frequency Overlap
The simulation was done with the following parameters: iterations = 100,
SNR Range = -25:1:25, THD = 0.5, nusers = 4, bitpuser = 10, scale = [1.9 2.7 3.9
5.6], t = 0:0.05:8*bitpuser*scale.
BER vs SNR
Figure 6.2 Graph of BER vs SNR without Frequency Overlap
From Figure 6.2, it is seen that all user bits are perfectly transmitted with low bit error
rate for signal-to-noise rate as low as 0 dB. For low noise levels, BER is extremely
small.
37


6.2.3 Results of BER vs SNR in Case of no Frequency Overlap and More Time
The simulation was done with the following parameters: iterations = 100,
SNR Range = -25:1:25, THD = 0.5, nusers = 4, bitpuser =10, scale = [1.9 2.7 3.9
5.6], t = 0:0.05:8*bitpuser*scale*n (n is a multiplier factor).
BER vs SNR
Figure 6.3 Graph of BER vs SNR with no Frequency Overlap and More Time
We will see that the all user bits were perfectly transmitted (no error) for signal-to-
noise ratio as low as -10 dB. For low noise levels (i.e, SNR large), BER is small.
However, as noise increases beyond a certain threshold i.e. -20 dB, the BER rapidly
became inacceptable.
38


6.2.4 Results of BER vs SNR in Case of Frequency Overlap and More Time
The simulation was done with the following parameters: iterations = 100,
SNRRange = -25:1:25, THD = 0.5, nusers = 4, bitpuser = 10, scale = [1.87 2.2 2.8
3.3], t = 0:0.05:8*bitpuser*scale*n.
BER vs SNR
Figure 6.4 Graph of BER vs SNR with Frequency Overlap and More Time
It is also shown from Figure 6.4 that two user bits ( blue and dark green) can
be perfectly transmitted (no error) for signal-to-noise ratio as low as -8 dB and two
others (red and light green) can be transmitted with no error for signal-to-noise ratio
as low as -14 dB as well. The comparative results show a performance improvement
by decreasing frequency overlap and increasing the maximum transmission time as
shown in Figure 6.4. Therefore, the overall scheme is robust to noise.
39


6.3 Security
A communication system is secure when the transmitted signal cannot be
decoded by outside parties. In other words, only the receiver will have knowledge of
parameters needed to decode the information. As mentioned earlier, the receiver will
be required to have the knowledge of the wavelet atoms and their associated discrete
sample set in the time-frequency plane (time shift and scaling parameters) in order to
decode the transmitted signal. To evaluate how secure our designed communication
algorithm is, we will be examining different attempts of decoding the transmitted
signal without any knowledge of the scaling parameters. It is assumed in this
evaluation that the Morlet wavelet atoms are used. The results of different scenarios
analyzed are grouped in the table 6.1.
40


Table 6.1 Decoding Results Based on Guessed Scaling Parameters
Case Scenario Threshold SNR Scale and Bit Error Rate Scale and Bit Error Rate Scale and Bit Error Rate
a BER a BER a BER
1 Decode user 1 0.250 0 1.87 0.125 1.50 0.225 2 0.250
2 Decode user 1 0.500 5 1.87 0.100 1.50 0.125 2 0.125
3 Decode user 2 0.250 0 2.2 0.200 1.5 0.275 2 0.175
4 Decode user 2 0.500 5 2.2 0.075 1.5 0.175 2 0.250
5 Decode user 3 0.250 0 2.8 0.200 2 0.250 4 0.225
6 Decode user 3 0.500 5 2.8 0.100 3 0.175 4 0.200
7 Decode user 4 0.250 0 3.3 0.100 2 0.225 1 0.325
8 Decode user 4 0.500 5 3.3 0.050 2 0.275 1 0.325
41


The above table shows the users digital data being decoded with different
scale values, thresholds and SNRs. It can be interpreted that the decoding of an
intercepted message without knowledge of the scale parameter seems highly unlikely
because the BER increases dramatically. Therefore, the poor performance based on
higher BER values indicates a high degree of security. Some other cases have
revealed a decrease in BER value when decoding with guessed scales. This is due to
the non-linearity of the relationship between the scale and BER. The threshold value
would have to be adjusted accordingly to either lower or increase the BER.
42


7. Conclusion
This thesis addresses the fact that every day there is a need for an accurate and
secure transmission of signal from one location to another. The wavelet-based
algorithm for the coding and decoding of digital information for transmission through
an analog channel described by time-frequency rectangle has been proposed and
proven beneficial. In the wavelet transform, time-frequency domain is segmented into
smaller atomic regions which allow the decomposition of discrete data. In this thesis,
the nonorthogonal wavelet function sets were proposed to perform the partition of the
time-frequency domain into these smaller atomic parts. It is being partitioned in
almost arbitrary and overlapping chunks, which will always equate to the number of
bits to encode in the time domain. The multiple access technique was taken into
consideration by the division of the frequency domain in bands corresponding to
scales where users are transmitting bits of information to the receiver.
The Morlet wavelet was chosen to encode multiple users discrete data and
obtain analog signals, which were summed up into one transmitted analog signal. It
was assumed that an unwanted amount of noise will affect the signal during its
transmission through the channel. The receiver has to have the knowledge of the
mother wavelet function and discrete time-scale used in the encoding process, and
eventually will set the threshold value in order to retrieve the original discrete data.
Once the noise level is set, a good choice of the threshold value allows the decoding
process with low bit error rates.
We have designed and implemented an efficient algorithm in MATLAB as
solution to the above described problems. The algorithm has been divided into seven
major parts which play an important role in the performance of the overall
communication system. At first, discrete data for multiple users are being generated
43


randomly. The Calculate Morlet Wavelet Utility finds scaled and shifted Morlet
wavelet functions for each user. These Morlet wavelet functions created are used in
the Encode Data Utility to encode the discrete data into an analog signal. At the
receiver, the Decode Data Utility transforms the encoded data into its original discrete
form and filters any noise associated with the transmitted signal. In fact, the receiver
sets the threshold value and requires the knowledge of the wavelet function, the
discrete time-scale in order to retrieve the original discrete data. A simulator with a
graphical user interface was developed in MATLAB as only one application for the
utilities. It has been shown that when the time parameter is increased, the overall
scheme is highly robust to noise (AWGN) with low bit error rates in noise levels as
high as -15 dB SNR. Moreover, it has been demonstrated that the scheme has an
inherent level of security that makes the decoding process ineffective without
knowledge of the scale parameter.
44


APPENDIX A
MATLAB Computer Programs
function h = wendgui()
% WAVELET-BASED DATA ENCODING AND DECODING
% Author: John Mbuyamba
% Contact information: jmbuyamb'(/ hotmail.com
% University of Colorado Denver
%========-========DESCRIPTION===================
% wendgui is a wavelet-based data encoding and decoding GUI constructed from
o the MATLAB editor rather then using GUIDE. This GUI encodes 10 random bits
% sequence of 4 users each using Morlet wavelet.Multiplex, add white
% gaussian noise, and decode them using a specify threshold.
% Add data that needs to be shared and accessed by different controls
% and functions to the handles structure "h". This structure will be passed
% to each control Callback when executed.
h.nusers = 4; % total number of users
h.bitpuser = 10; % number of bit per each user
h.scale = [1.87 2.2 2.8 3.3]; % scale of each user
h.Ao = l./sqrt([1.87 2.2 2.8 3.3]); % wavelet multiplier
h.m = 0;
h.n = 0;
%=======================BEGIN CREATING L.AYOUT=========
%To set the position of a control, you need to specif) the follow ing properties:
loCreate the main figure (mainFig) in middle of screen.
oStore all control handles in structure "h"
h.mainFig = figure('Color',[.8 .8 .8],...
PaperPosition',[18 180 576 432],...
45


'Paper! 'nitsVpoints',...
'Position', [340 144 600 525],...
TagVFigl,...
'Name',' \\ \\ II LI-BASI D DMA ENCODING AND DFCODING SIM! LA FOR,...
'Number I itle','olT,...
'Resi/e','o IT,...
' loolBarVnone);
/oAdd frames to separate different pushbuttons
h.framel = uicontrol('l nitsVpoints,...
BaekgroundColor',[.847058823529412.815686274509804 .7843137254901%],...
'ListboxTop'.O,...
Position',[0 330.25 63 .75],...
'St> le','Frame',...
' I agVFrame I');
h.frame2 = uicontrol(! :nits','points',...
BackgroundC olor ,[.847058823529412 .815686274509804 .7843137254901%],...
'Listbo\Top',0,...
'Position',[0 273.25 63 .75],...
'St\ le,'l rame',...
' I ag','l rante2');
h.frame3 = uicontrol('l nits',points',...
'IlaekgroundC 'olor ,[.847058823529412 .815686274509804 .7843137254901%],...
'I islbox l op',Op-
position',[0 182.25 63 .75],...
'St x le','Frame',...
' l ag','Frame.)');
h.frame4 = uicontrolCl'nits','points',...
'Background! o!or,[.847058823529412 .815686274509804 .784313725490196],...
'l.istbo\Top',0,...
'Position',[0 73.25 63 .75],...
'St x le','Frame',...
'Tag','Framed');
h.ffame5 = uicontrol( nits','points',...
'I .isthoxTop',Op-
position,[62.25 .75 .75 480],...
Six le','frame,...
46


' lag','I-runic:?');
%Add labels for edit boxes, sliders, and pushbuttons
h.statictextl = uicontrol('l nits','points',...
'BaekgroundColor',[.78 .78 .78],...
'iontW eighl','bold',...
'I.istho\Top',0,...
Position,[6.75 360 48.75 23.25],...
'String','Input Parameters',...
'Sts le','te\t',...
' I ag','statiete\tl');
h.statictext2 = uicontrol('l nits','points',...
UaekgroundC'olor',[.78 .78 .78],...
'IontW eighl','hold',...
'Listbox l op',0,...
'Position',[6.75 302.25 48.75 23.25],...
'String',' Pneode Data',...
Six le','te\f,...
TagVstatietextl');
h.statictext3 = uicontrol('l nits',points',...
'Background!. olor',[.78 .78 .78],...
'Font Weight','hoId',...
I isthox l op',0,...
'Position', [6.75 248 48.75 23.25],...
'String',' I ransmit Signal,...
'Sts le','te\t',.
' I'agVsiatietext.V);
h.statictext4 = uicontrol('BaekgroundColor',[.78 .78 .78],...
'I j'stbo\Top',0,...
'Position',[5 277 14 15],...
'String',1-20',...
'Sts le'.'text',...
' I ag','staticte\t4');
h.statictext5 = uicontrol('Baekground( olor',[.78 .78 .78],...
'listbox lop',0,...
'Position',[65 273 18 20],...
String','20',...
47


'Sty le','te\T,...
'Tag','statictext5');
% h.statictext6 = uicontrol('Units'.'points'....
% 'BackgroundColor'.[.78 .78 .78]....
% 'ListboxTop'.O....
% 'Position'.] 15.5 226.25 21 12.75]....
% 'String'.'Noise:'....
% 'Style'.'text'....
% 'Tag'.'statictextfi'):
h.statictext8 = uicontrol('l nitsVpoinls',...
'HaekgroundC'olor',[.78 .78 .78],...
'[ ont\\ eight','hold',...
I isthox l op',0,...
'Position',[6.75 156.5 48.75 23.25],...
'String',' Decode Data',...
'Sty le','text',...
' rag','statiete.\t8');
h.statictext9 = uicontrol('BaekgroundColor',[.78 .78 .78],...
'l.isibo\Top',0,...
'Position',[5 166 14 15],...
'StringVO',...
'Sty le','ie\l',...
' I ag'.'Statietextd');
h.statictextlO = uicontrol('BaekgrotindC'olor',[.78 .78 .78],...
'i.istboxTop',0,...
'Position',[64 162 18 20],...
'String','I',...
'Sty le','te\t',...
' I ag','statictext 10');
h.statictextl 1 = uicontrol('l 'nits','points',...
'B;iekground(.'olor',[.78 .78 .78],...
'l.istboxTop',0,...
'Position ,[.75 148.25 30.75 10.5],...
'String',' Thresh:',...
'Sty leVtext',...
' 1 ag.'statietext I T);
h.statictextl2 = uicontrol('l 'nitsVpoinls',...
48


'BaekgroundC'olor',[.78 .78 .78],...
TontWeight','bold',...
'l.istboxTop',0,...
Position',[6.75 43.5 48.75 23.25],...
'String1,'BTR Tstimation',...
'Six le','te\t',...
'Iag','statictexll2');
h.stalictextl3 = uicontrol(l nils','points',...
BackgroundC'olor,[.78 .78 .78],...
'lont Weight','light',...
'I isthoxTop,0,...
'Position',[214.75 365 72.75 23.25],...
'String','Transmitted Data,...
'St\ le',text,...
' l agVstatictextl .V);
h.statictextl4 = uicontrol('l nits','points1,...
'BackgroundColor,[.78 .78 .78],...
T'ontW eight','light',...
'I istho\Top',0,...
'Position',[215.75 58 72.75 23.25],...
'String','Reeeiv ed I )ata',...
'St\le','te\t',...
I ag','staticte\l 14');
h.stalictextl5 = uicontrol('BaekgH)undC'olor',[.78 .78 .78],...
'st> le','te.\t','Position, [96 478 35 20],...
'string',' 1 \ U1lori/ontalAligmnent',''right');
h.statictextl6 = uicontrol('BtiekgroundC'oior',[.78 .78 .78],...
'st_\ le','te\t',''Position', [96 456 35 20],...
'string','T\ l '2:','l lori/ontalAlignmenl','center');
h.statictextl7 = uicontrol('BackgroundColor',[.78 .78 .78],...
'st_\ le','text','Position', [96 434 35 20],...
'string',' l \ l'3:',' 1 lori/ontalAlignment',''center');
h.statictextl8 = uicontrol('BackgronndColor',[.78 .78 .78],...
st\ le','text','Position', [96 412 35 20],...
'string',' I \ l i4:','l lori/ontalAlignment','center');
h.statictextl9 = uicontrol('B;ickgroundColor',[.78 .78 .78],...
'stxle','text','Position',[96 68 35 20],...
49


'string','Rx 1' Ilori/ontalAlignmenlYcenter');
h.statictext20 = uicontrol('BackgroundColor',[.78 .78 .78],...
st\ le','text','Position',[96 46 35 20],...
'string','R\ I !2:','I lori/ontalAlignmenl','center');
h.statictext21 = uicontrol('BackgroundColor',[.78 .78 .78],...
'st\ le','text','Position',[96 24 35 20],...
'string','R\ l;.3:','i lori/ontalAlignnicnt','center');
h.statictext22 = uicontrol('BaekgroundColor',[.78 .78 .78],...
'st\ lc,'text','Position',[96 2 35 20],...
'string','Rx 114:','! lori/onutl Alignment','ctiitor');
h.statictext23 = uicontrol('BackgroundColor',[.78 .78 .78],...
'stx le','text','Position',[298.75 108 72.75 23.25],...
'string',' l ime,'! lori/ontal.Alignment','center');
h.noise_checkbox = uicontrol('l nits','points',...
'BaekgroundColor',[.78 .78 .78],...
'Listbox l op',0,...
'Position',[1.5 226.25 51 12.75],...
'String'.'Noise',...
'Nt> le','checkbox,...
' l ag','noise checkbox');
h.pushbuttonl = uicontrol('l nits','points',...
'BaekgroundC olor',[.84 .81 .78],...
'Listbox l op',0,...
Position',[8.625 342 45 15],...
String',Input Data',...
'lag','pushbutton 1',...
'TooltipString','Generate random data for 4 users.');
h.pushbutton2 = uicontrol('l nits','points',...
'BackgroundColor',[.84 .81 .78],...
'listbox Top',0,...
'Position',[8.625 285.25 45 15],...
'StringVLincode',...
' 1 ag','pushbutlon2',...
TooltipString','Plot the [.needed Data for indixidtial user channels')
h.pushbutton3 = uicontrol( l 'nits,points,...
50


BackgroundC'olor',[.84 .81 .78],...
'Listbox I op',0,...
'Position', [8.625 187 45 15],...
'String','Plot Signal',...
'TagYpushbultona',...
' 1 ooltipString','Plot the transmitted signal. Noise can he added to the signal.');
h.pushbutton4 = uicontrol('l nits','points',...
'BaekgroundColor',[.84 .81 .78],...
l istbox I op',0,...
Position',[8.625 100.75 45 15],...
'String','Decode',...
' I ag',pushbutton4',...
'TooltipString',''Return the l.neoded Data, along with atn noise, to the original binarx data.');
h.pushbutton5 = uicontrol('l nits', poims',...
'BackgroundColor',[.84 .81 .78],...
'I istbox lop',Op-
position',[8.625 80.25 45 15],...
'String','Output Data',...
' I ag','pushbuttons',...
' I ooltipString','Output the receixed data');
h.pushbutton6 = uicontrol('l nitsVpoims',...
'BackgroundColor',[.84 .81 .78],...
'l.istboxTop',0,...
'Position', [8.625 28.25 45 15],...
'String','Displa\ lil iR',...
lagYpushbuitonb',...
'TooltipString','Displa> the BLR in %');
"ocreate sliders
"oslider StepSize = (rna\-min)/number_ot'_steps ==>(use 40 steps)
h.slidernoise = uicontrol(l nits',points',...
'BackgroundC olor',[.847058823529412 .815686274509804 .788823594117647],...
'l istbox I op,0,...
'Min',-20,...
Max,20,...
Value1,h.m,...
SliderStep,[0.025 0.025],...
51


'Position',[14.5 207 34 14],...
St\ lc','slider',...
' l ag','slider noise,...
'TooltipString','Add noise to the Pneoded Data');
h.slider_threshold = uicontrol(BackgroundColor',[.84 .81 .78],...
'I.istbo\Top',0,...
'Min',0,...
'Ma\',l,...
Value,h.n,...
'SliderStep',[0.1 0.1],...
Position',[20.5 165 44 20],...
'St\le',''slider',...
' I ag','Slider threshold',...
' I ooltipString','Smaller \ allies give tighter thresholds');
/ocreate edit boxes
h.editboxl = uicontrol('BaekgroundColor',[.78 .78 .78],...
'st\ le','edit','Position',[141 482 20 20],...
'string', 1,'I lori/ontalAlignment',1'center');
h.editbox2 = uicontrol('BaekgroundColor',[.78 .78 .78],...
'six le','edit','Position',[184 482 20 20], ...
'string',1,'Horizontal Alignment','center');
h.editbox3 = uicontrol(BaekgroundColor',[.78 .78 .78],...
'st_\ le','edit','Position',[227 482 20 20], ...
'string', 1,'I lori/ontal Alignment',1'center');
h.editbox4 = uicontrol( Baekgroundt olor',[.78 .78 .78],...
'st\ le','edit','Position',[270 482 20 20],...
'string', 1,'I lori/ontal Alignment','center');
h.editbox5 = uicontrol('BackgroundColor',[.78 .78 .78],...
'st\ le','edit','Position',[313 482 20 20],...
'string', 1,'I lori/ontal.Alignment','center');
h.editbox6 = uicontrol('BaekgroundColor',[.78 .78 .78],...
'st> le','edit','Position',[356 482 20 20],...
'string',l,'l lori/ontal Alignment','center');
h.editbox7 = uicontrol('BackgroundColor',[.78 .78 .78],...
'st\ le','edit','Position', [399 482 20 20],...
'string', 1 ,'l lori/ontal Alignment',''center');
52


h.editbox8 = uicontroI('BackgroundColor',[.78 .78 .78],...
st> le','edit','Position',[442 482 20 20],...
'string',1,'1 lori/ontal Alignment','center');
h.editbox9 = uicontrol('Baekground(.olor',[.78 .78 .78],...
'st> le,'edit','Position', [485 482 20 20],...
'string',1,'1 lori/ontal Alignment, 'center');
h.editboxlO = uicontrol('BackgroundColor',[.78 .78 .78],...
'st\ le','edit','Position',[528 482 20 20],...
'string',1,'1 lori/ontal.Alignment','center');
h.editboxl 1 = uicontrol('Baekgroundtolor',[.78 .78 .78],...
'st\ le','edit','Position', [141 460 20 20],...
'string,1,'1 lori/ontal Alignment','center');
h.editboxl2 = uicontrol( Backgroundt olor',[.78 .78 .78],...
'st\ le','edit','Position', [184 460 20 20],...
'string', l,'l lori/ontal Alignment','center');
h.editboxl3 = uicontrol('Background(olor,[.78 .78 .78],...
'sl\ le','edit','Position', [227 460 20 20],...
'string',1,'1 lori/ontal. Alignment','center');
h.editboxl4 = uicontrol('BaekgroundColor,[.78 .78 .78],...
'st> le','edit','Position',[270 460 20 20],...
'string',1,1 lori/ontal.'Alignment','center');
h.editboxl5 = uicontrol('BaekgroundColor',[.78 .78 .78],...
st\ le','edit','Position', [313 460 20 20],...
'string',1,'1 lori/ontal Alignment','center');
h.editboxl6 = uicontrol('BackgroundColor',[.78 .78 .78],...
'st\ le','edit','Posit ion, [356 460 20 20],...
'string',1,'1 lori/ontal Align ment','center');
h.editboxl7 = uicontrol('BackgroimdColor',[.78 .78 .78],...
st\ le,'edit','Position',[399 460 20 20],...
'string',1,'1 lori/ontal Alignment','center');
h.editboxl8 = uicontrol('BackgroiindColor',[.78 .78 .78],...
'st> le','edit','Position',[442 460 20 20], ...
'string',1,'1 lori/ontal.Alignment','center');
h.editboxl9 = uicontrol('Backgmundt'olor',[.78 .78 .78],...
'st\ le','edit','Position', [485 460 20 20],...
'string',1,'1 lori/ontal Align ment','center');
h.editbox20 = uicontrol('BackgroundColor,[.78 .78 .78],...
53


'sl\ le','edit','Position',[528 460 20 20],...
'string', 1,'! lori/ontal Alignment','center');
h.editbox21 = uicontrol('Baekground(_'olor',[.78 .78 .78],...
'st\ le','edit','Position',[141 438 20 20],...
'string', 1,'I lori/ontal Alignment','center');
h.editbox22 = uicontrol('BackgroundColor',[.78 .78 .78],...
'st> le','edit,Position',[184 438 20 20],...
'string', l,'l lori/ontal Alignment','center');
h.editbox23 = uicontroI('BackgroundCo!or',[.78 .78 .78],...
'st\ le','edit','Position',[227 438 20 20],...
'string', l,'l lori/ontal Alignment','center);
h.editbox24 = uicontrol('BaekgroundC'olor',[.78 .78 .78],...
st\ le','edit','Position',[270 438 20 20], ...
'string', 1,'I lori/ontal Alignment','center');
h.editbox25 = uicontrol('BaekgroundC'olor,[.78 .78 .78],...
'st> le','edit','Position',[313 438 20 20],...
'string', 1,'I lori/ontal Alignment','center');
h.editbox26 = uicontrol('BackgroundC olor',[.78 .78 .78],...
'st\ le','edit','Position',[356 438 20 20], ...
'string', 1,'I lori/ontal Alignment','een ter');
h.editbox27 = uicontroI(Baekgroiind(olor,[.78 .78 .78],...
'st\ le','edit','Position',[399 438 20 20],...
'string', 1,'I lori/ontal Alignment','center');
h.editbox28 = uicontrol('BackgroundColor,[.78 .78 .78],...
st> le','edit','Position',[442 438 20 20],...
string, 1,'I lori/ontal Alignment','center');
h.editbox29 = uicontrol('BaekgroundColor',[.78 .78 .78],...
'six le','edit','Position',[485 438 20 20],...
'string', 1,'I lori/ontal.Alignment','center');
h.editbox30 = uicontrol('BackgroundColor',[.78 .78 .78],...
"six le','edit',''Position',[528 438 20 20],...
'string', 1,'I lori/ontal Alignment','center');
h.editbox31 = uicontrolC Back groundcolor, [.78 .78 .78],...
st> le','edit','Position', [141 416 20 20],...
'string', 1,'I lori/ontal AlignmentVcenter');
h.editbox32 = uicontrol('BaekgroiindColor',[.78 .78 .78],...
six le',1'edit',''Position', [184 416 20 20],...
54


'siring', 1,'I lori/ontal Alignment','center');
h.editbox33 = uicontrol('BaekgroundColor',[.78 .78 .78],...
'sn le','edit','Position', [227 416 20 20],...
'siring', 1,'I lori/ontal Alignment','center');
h.editbox34 = uicontrol(Backgruund( olor,[,78 .78 .78],...
'st\ le',''edit',1'Position', [270 416 20 20],...
'string', 1,'I lori/ontalAlignment',1'center');
h.editbox35 = uicontrol('Backgronnd(.'olor',[.78 .78 .78],...
'st\ le',''edit',''Position',[313 416 20 20],...
'string', 1,'I lori/ontal Alignment','center');
h.editbox36 = uicontrol('BackgroundC'olor',[.78 .78 .78],...
sl> le','edit','Position',[356 416 20 20],...
'siring', 1,'I lori/ontal Alignment','center');
h.editbox37 = uicontrol('BackgroimdC'olor',[.78 .78 .78],...
'st\le','ediiVPosition',[399 416 20 20],...
'string', 1,'I lori/ontal Alignment','center');
h.editbox38 = uicontrol('Baekground<_'olor',[.78 .78 .78],...
'st\ le','edit','Position',[442 416 20 20],...
'string',1,'1 lori/ontal Alignment',''center');
h.editbox39 = uicontrol('BackgroundColor,[.78 .78 .78],...
's!\ le','edit','Position',[485 416 20 20],...
'string', 1,'] lori/ontal Alignment', 'center');
h.editbox40 = uicontrol(Baekgroundt olor,[.78 .78 .78],...
'st\ le','edit','Position',[528 416 20 20], ...
'string', 1,'I lori/ont;il.Alignment','center');
h.editbox41 = uicontrol('BackgroundC'olor',[.78 .78 .78],...
st\Ic',^'text','Position',[141 68 20 20],...
'I lori/ontal Alignment',''center');
h.editbox42 = uicontrol('BackgroundC olor',[.78 .78 .78],...
'st\ le','text','Position',[184 68 20 20],...
'I lori/ontal Alignment',''center');
h.editbox43 = uicontrol('BaekgroundColor,[.78 .78 .78],...
'style','te.\t','Position',[227 68 20 20],...
'I lori/ontalAlignment',''center');
h.editbox44 = u!Control('Background(.'olor',[.78 .78 .78],...
'stx le','text','Position',[270 68 20 20],...
I lori/ontal Alignment','center);
55


h.editbox45 = uicontrol('BackgroundColor',[.78 .78 .78],...
'stx le','text','Position',[313 68 20 20],...
'I lori/ontal Alignment',center');
h.editbox46 = uicontrol('BackgroundColor',[.78 .78 .78],...
'st\ le1,'text','Position',[356 68 20 20],...
'I lori/ontalAlignment',''eenter');
h.editbox47 = uicontrol('Backgroundt oior',[.78 .78 .78],...
'stx le',''text',''Position',[399 68 20 20],...
'I lori/ontal.Alignment','eenter');
h.editbox48 = uicontrol(BackgroundColor',[.78 .78 .78],...
'st\ le','text','Position',[442 68 20 20],...
'I lori/ontalAlignment,1'eenter');
h.editbox49 = uicontroI('Backgroundtolor',[.78 .78 .78],...
'stx le','text','Position',[485 68 20 20],...
'1 lori/ontal Alignment','eenter');
h.editbox50 = uicontroI('BaekgroimdColor',[.78 .78 .78],...
'six le','text','Position',[528 68 20 20],...
'I lori/ontal Alignment','center');
h.editbox51 = uicontrol('BaekgroundColor',[.78 .78 .78],...
'st\ le','text','Position',[141 46 20 20], ...
'I lori/ontal.Alignment','center');
h.editbox52 = uicontrol('BackgroundColor',[.78 .78 .78],...
'stx le','text','Position',[184 46 20 20],...
'Horizontal Alignment','center');
h.editbox53 = uicontrol('BackgroundColor',[.78 .78 .78],...
'stx le','text','Position',[227 46 20 20],...
'I lori/ontalA ligament','center');
h.editbox54 = uicontrol('BackgroimdC.'olor',[.78 .78 .78],...
'stx le','text','Position',[270 46 20 20],...
'1 lori/ontal Alignment','center');
h.editbox55 = uicontrol('Background( olor',[.78 .78 .78],...
'stx le,'text','Position',[313 46 20 20],...
'I lori/ontal Alignment,'center');
h.editbox56 = uicontrol('BaekgroundColor',[.78 .78 .78],...
'stx le',1'text',''Position',[356 46 20 20],...
'I lori/ontal.Alignment','center');
h.editbox57 = uicontrol('BackgronndColor',[.78 .78 .78],...
56


'six le','text','Position',[399 46 20 20],...
'I lori/ontal Alignment,'center');
h.editbox58 = uicontrol('Background(_olor',[.78 .78 .78],...
'sty le','text','Position',[442 46 20 20],...
'I lori/ontalAlignment,center');
h.editbox59 = uicontrol('BackgroundC'olor',[.78 .78 .78],...
'six le','text','Position',[485 46 20 20],...
'Hori/ontal Alignment',''center');
h.editbox60 = uicontrol('BackgroundC olor',[.78 .78 .78],...
six le,'text','Position',[528 46 20 20],...
'I lori/onla! Alignment',1'center');
h.editbox61 = uicontrol('Backgroimd( olor',[.78 .78 .78],...
'style','text','Position',[141 24 20 20],...
'I lori/ontalAlignment',''center');
h.editbox62 = uicontrol('BaekgroundColor',[.78 .78 .78],...
'style','text','Position',[184 24 20 20],...
'I lori/ontal Alignment','center');
h.editbox63 = uicontrol('BackgroundC'olor',[.78 .78 .78],...
'sty le','text','Position',[227 24 20 20],...
'I lori/ontalAlignment',''center');
h.editbox64 = uicontroI('BaekgroundColor',[.78 .78 .78],...
'six le','text','Position',[270 24 20 20],...
'I lori/ontal Alignment',''center');
h.editbox65 = uicontrol(BackgroundC olor',[.78 .78 .78],...
'sty le','text','Position',[313 24 20 20],...
'I lori/ontal Alignment',center);
h.editbox66 = uicontrol('BackgroimdColor',[.78 .78 .78],...
'sty Ie,'text','Position',[356 24 20 20],...
'I lori/ontal Alignment','center');
h.editbox67 = uicontrol('BackgroimdColor',[.78 .78 .78],...
'sty le','text','Position',[399 24 20 20], ...
'1 lori/ontal Alignment',''center');
h.editbox68 = uicontrol('Baekgroundt'olor',[.78 .78 .78],...
'sty le','text','Position',[442 24 20 20],...
'I lori/ontal Alignment','center');
h.editbox69 = uicontrol('BackgroundColor',[.78 .78 .78],...
'sty le','text','Position',[485 24 20 20],...
57


'I lori/ontal Alignment','center');
h.editbox70 = uicontroi('BackgroiindColor',[.78 .78 .78],...
'sty lo','icntI*osiI it>n',[528 24 20 20],...
'i lori/ontal Alignment','center');
h.editbox71 = uicontrol('Baekgroiindt'olor',[.78 .78 .78],...
'st\ le','te\t',''Position',[141 2 20 20],...
'I lori/ontalAlignment','center');
h.editbox72 = uicontrol('BackgroimdColor,[.78 .78 .78],...
'sty Ie',''text',''Position',[184 2 20 20],...
I lori/ontal Alignment','center');
h.editbox73 = uicontrol('BackgroundC'olor,[.78 .78 .78],...
'sly le','text','Position',[227 2 20 20],...
'1 lori/ontal Alignment',1'center');
h.editbox74 = uicontrol('Backgroundt'olor',[.78 .78 .78],...
'sty le','text','Position',[270 2 20 20],...
I lori/ontal Alignment','center');
h.editbox75 = uicontrol('BaekgroundColor',[.78 .78.78],...
'style','text','Position',[313 2 20 20],...
'I lori/ontal Alignment','center');
h.editbox76 = uicontrol(Background( olor',[.78 .78 .78],...
'sty Ie','text','Position',[356 2 20 20],...
'I lori/ontal.Alignment','center');
h.editbox77 = uicontrol('BaekgroundColor',[.78 .78 .78],...
st> Ie','text', Position',[399 2 20 20],...
1 lori/ontal Alignment','center');
h.editbox78 = uicontrol('Backgroiind('olor',[.78 .78 .78],...
'sty Ie','text','Position',[442 2 20 20],...
'I lori/ontal Alignment','center');
h.editbox79 = uicontrol('BackgroundColor',[.78 .78 .78],...
'sty Ie','text','Position',[485 2 20 20],...
'I lori/ontal Alignment,'center');
h.editbox80 = uicontrol('Background(dolor',[.78 .78 .78],...
six le,'text','Position',[528 2 20 20], ...
'I lori/ontal Alignment','center');
h.editbox81 = uicontrol('BackgroimdC'olor',[.78 .78 .78],...
'Sty le',''edit','Position',[53 306.25 25 16],...
'String','()','I lori/ontal.Alignment','center');
58


h.editbox82 = uicontrol('BackgroundColor,[.78 .78 .78],...
Si\ Ic','cdit.'Posiiin,[40 197 25 16],...
String','O',I lori/ontal Alignment',''center');
h.editbox83 = uicontrol('BackgroundColor',[.78 .78 .78],...
'Style','text','Position',[24 15 23 16],...
'I Iori/omalAlignment',center');
h.editbox84 = uicontrol('BackgroundColor',[.78 .78 .78],...
'Six le','text','Position',[49 15 15 16],...
'String','0<>','I lori/ontnlAlignment','center');
%add some axes to plot on
%l have used pixels as the units to describe the position so the
%distance between the axes and other controls does not change if a
%bigger window size is used for mainFig
h.axesi = axes('t 'nits','pixels',...
'Box','on',...
'(. ameral 'pVeetor',[0 1 0],...
'Cameral 'pVeetorYlodeVmanual',...
'Color',[1 I I],...
Position,[141 290 406 97],...
I agVaxesI',...
'XColor',[0 0 0],...
'.\(irid','on',...
'XI. ini Mode','manual',...
X lick',[0.2 .4 .6 .8 1],...
'X Tickl.ahel Mode','manual',...
'X I ickModcVinttnual',...
A'Color, [0 00],...
'Y(irid','on',...
'/Color',[0 0 0],...
'/(jrid,'on');
h.axes2 = axesfl Inits','pixels',...
'Box','on',...
'Cameral pVector',[0 1 0],...
'Cameral 'p Vector VlodeVinanual',...
Color,[1 1 1],...
'Position', [141 150 406 97],...
59


' lag','axes I
'XColor',[0 0 0],...
'\( irid','on',...
'XI. im.Mode','manual',...
X lick',[0.2 .4 .6 .8 I],...
'XTickl.abelModeYmanual',...
'X kick Mode,'man uni',...
'YColor',[0 0 0],...
'YGrid','on',...
'/Color',[0 0 0],...
'/CiridYon');
%================F;Nn CREATING TAYOH'l ===
%====================BE(jIN SETTING CAI MACKS
%set callbacks for sliders
set(h.sIider_noise,callback',{@slider_noise_CalIback h});
set(h.slider_threshold,callback',{@slider_threshold_Callback h});
set(h.pushbuttonl,'callback',(@pushbuttonl_Callback h});
set(h.pushbutton2,'eal I back', {@pushbutton2 Callback h});
set(h.pushbutton3,'cal Iback', {@pushbutton3_Callback h});
set(h.pushbutton4,'cal 1 back1, {@pushbutton4_Callback h});
set(h.pushbutton5,'cal Iback, {@pushbutton5_Callback h});
set(h.pushbutton6,'cal I back,{ @pushbutton6_Callback h});
set(h.noise_checkbox,callback',{@noise_checkbox_Callback h});
0/oset callbacks for edit boxes
o/0===================EN[) SETTING CAEBACKS=
guidata(h.mainFig,h)oupdate the entire handle structure to include everything defined above
'o==============BEGIN DEFINING CALBACKS
function slider_noise_Callback(hObject, eventdata, h)
global val 1;
h = guidata(hObject);%get the entire handle structure for the GUI
60


vail = get(hObject,'Value');0oget the value from the slider
str = sprintfl "create a string
set(h.editbox81,' String',str);%put siring in text box for a
h.m = vall;%update handles
guidata(hObject,h);%update entire handle strueture
function slider_threshold_Callback(hObject, eventdata, h)
global val2;
h = guidata(hObject);
val2 = get(hObject,'Value);
str = sprintfl"<](). I f,val2);
set(h.editbox82,'String,str);
h.n = val2;
guidata(hObject,h);
% Executes on button press in InputData.
function pushbutton l_Callback(hObject, eventdata, h)
% hObject handle to Input Data (see CJCBO)
% eventdata reserved to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
nusers = h.nusers;
global a;
global b;
global c;
global d;
% Create user data (random)
for i = 1:nusers
U{i} = round(rand(l,10));
end
a = U{ 1,1};
ran=[a( 1 ),a(2),a(3),a(4),a(5),a(6),a(7),a(8),a(9),a(l 0)];
setfh.editbox 1,'Stri ng',ran( 1));
set(h.editbox2,'String',ran(2));
61


set(h.editbox3,'String',ran(3));
set(h.editbox4,'Suing',ran(4));
set(h.editbox5,String,ran(5));
set(h.editbox6,String',ran(6;
set(h.editbox7,'String',ran(7));
set(h.editbox8,'String',ran(8));
set(h.editbox9,String',ran(9));
set(h.editboxl0,String',ran(10));
b= U{ 1,2};
ran 1 =[b( 1 ),b(2),b(3),b(4),b(5),b(6),b(7),b(8),b(9),b( 10)];
set(h.editboxl 1,'String',ranl(I));
set(h.editboxl2,String',ranl(2));
set(h.editboxl3,'String',ranl(3));
set(h.editboxl4,'String',ranl(4));
set(h.editboxl5,'String',ranl(5));
set(h.editbox i 6,'String',ran 1 (6));
set(h.editboxl7,'String',ranl(7));
set(h.editbox 18,'St ring',ran 1 (8));
set(h.editboxl9,'String',ranl(9));
set(h.editbox20,String',ranl(10));
c = U{ 1,3};
ran2=[c(l),c(2),c(3),c(4),c(5),c(6),c(7),c(8),c(9),c(10)];
set(h.editbox21,'String,ran2(l));
set(h.editbox22,'String',ran2(2));
set(h.editbox23,'String',ran2(3));
set(h.editbox24,'String',ran2(4));
set(h.editbox25,'String',ran2(5));
set(h.editbox26,''String', ran2(6));
set(h.editbox27,'String',ran2(7));
set(h.editbox28,'String',ran2(8));
set(h.editbox29,'Si ri ng',ran2(9));
set(h.editbox30,'Stri ng',ran2( 10));
d = U{1,4};
ran3=[d(l),d(2),d(3),d(4),d(5),d(6),d(7),d(8),d(9),d(10)];
62


set(h.editbox31, 'String', ran3(l));
set(h.editbox32,Siring,ran3(2));
set(h.editbox33,'Siring',ran3(3));
set(h.editbox34,'Siring,ran3(4));
set(h.editbox35,'String',ran3(5));
set(h.editbox36,'Siring',ran3(6));
set(h.editbox37,'String',ran3(7));
set(h.editbox38,'St ri ng',ran3(8));
set(h.editbox39,'String',ran3(9));
set(h.editbox40,String',ran3( 10));
o Executes on button press in Encode Data,
function pushbutton2 Callback(hObject, eventdata, h)
% hObject handle to pushbutton2 (see GCBO)
% eventdata reserved to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
global hi,
global h2,
global h3,
global h4,
a 1 =str2double(get(h.editbox 1,'String'));
a2=str2double(get(h.editbox2,'String'));
a3=str2double(get(h.editbox3,'String'));
a4=str2double(get(h.editbox4,'String'));
a5=str2double(get(h.editbox5,String));
a6=str2double(get(h.editbox6,'String'));
a7=str2double(get(h.editbox7,String'));
a8=str2double(get(h.editbox8,'S t ring'));
a9=str2double(get(h.editbox9,'Slring,));
al 0=str2double(get(h.editbox 10,'Stri ng'));
% if user inputs something that is not a binary.the slider value defaults
% to 0 or 1
if (al~=0 & al~=l)
co=questdlg(' I he vtilue must he binary,'ERROR',T,'()',T);
63


if strcmp(co,' I )
set(h.editboxl,'String',T);al=l;
else
set(h.editboxl,String','f)');al=0;
end
elseif (a2~=0 & a2~=l)
co=questdlg('flic value must he binary','1 RROR,T,'0','I');
if strcmp(co,' I')
set(h.editbox2,String',' I );a2=l;
else
set(h.editbox2,'Siring','0');a2=0;
end
elseif (a3~^=0 & a3~= 1)
co=questdlg(' I he \alue must he binary ',I:RR()R', II');
if strcmp(co,' I')
set(h.editbox3,'String',' 1 );a3=l;
else
set(h.editbox3,'String','0');a3=0;
end
elseif (a4~=0 & a4~=l)
co=questdlg('I he \ alue must he binary',T.RROR','l1');
if strcmp(co,' 1')
set(h.editbox4,'String',' 1 ');a4=l;
else
set(h.editbox4,String','0');a4=0;
end
elseif (a5~=0 & a5~= 1)
co=questdlg( I lie value must he binary',T!RR()R','r,'0',T);
if strcmp(co,' 1')
set(h.editbox5,'String','I );a5=l;
else
set(h.editbox5,'String','0');a5=0;
end
64


elseif (a6~=0 & a6~=l)
co=questdlg(' I lie value mu si be binarv ','1 RR( )R VI 70', I');
if strcmp(co,' 1')
set(h.editbox6,String,' I ');a6=l;
else
set(h.editbox6,'StringVO');a6=0;
end
elseif (a7~=0 & a7~=l)
co=questdlg('The value must be hin;ir\7hRROR',T,'0',T);
if strcmp(co, I )
set(h.editbox7,'String',I );a7=l;
else
set(h.editbox7,'String','());a7=0;
end
elseif (a80 & a8~l)
co=questdlg('I he value must be hinary','1 -.RROR',1'IT);
if strcmp(co, I')
set(h.editbox8,'String,' I );a8=l;
else
set(h.editbox8,'String','(I');a8=0;
end
elseif (a9~=0 & a91)
co==questdlg('! lie value must be binarv','MRR()R','r,'0',T);
if strempfeo, I')
set(h.editbox9,'String',' I );a9=l;
else
set(h.editbox9,'String','()');a9=0;
end
elseif(al0~=0 & alO~=l)
co=questdlg(' I he value must be binary',T.RROR',T,'()',T);
if strempfeo,'!')
set(h.editbox 10,'Si ring',' l);a 10= 1;
else
65


set(h.editbox 10,' Si ri )');al0=0;
end
end
b 1 =str2double(get(h.editbox 11,'Siring'));
b2=str2double(get(h.editboxl 2,'Siring'));
b3=str2double(get(h.editbox 13,'St ring'));
b4=str2double{get(h.edi tbox 14,'String'));
b5=str2double(get(h.editbox 15,'Si ri ng));
b6=str2double(get(h.editboxl 6,'Siring'));
b7=str2double(get(h.editboxl7,'Siring'));
b8=str2double(get(h.editboxl 8,'Siring'));
b9=str2double(get(h.editbox 19,Siring));
bl0=str2double(get(h.editbox20,'Siring'));
if (bl~=0 & bl~=l)
co=questdlgf Hie value must be hinarv',T'.RR()R',T,'0',T);
if strcmp{co,' I')
set(h.editbox 11 ,'Siri ng',' I ');bl=I;
else
set(h.editboxl l,'String','0');bl=0;
end
elseif (b2~=0 & b2~=l)
co=questdlg('the value must be binary',hRRORVIVOVr);
if strcmp{co,' I )
set(h.editboxl2,'Siring', I ');b2=l;
else
set(h.editbox 12,'Stri ng','0');b2=0;
end
elseif (b3~H) & b3~l)
co=questdlg(' Hie value must be binary',T,RR()R',T,I');
if strcmp(co,' I')
set(h.editboxl3,'Siring',' I );b3=l;
else
set(h.editboxl 3,'Siring','0');b3=0;
end
66


elseif (b4~=0 & b4~=l)
co=questdlg(' lhe value must be binarv','TRROR',T,'0',T);
if strcmp(co,' I')
set(h.editboxl4,'String',' I ');b4=l;
else
set(h.editboxl4,'String','0');b4=0;
end
elseif (b5^K) & b5 1)
co=questdIg('The value must be binarv','TRR()R',T,'0',T);
if strcmp(co,' I')
set(h.editboxl5,''String',' I );b5=l;
else
set(h.editboxl5,'Siriiig70');b5=0;
end
elseif (b6~=0 & b6~=l)
co=questdlg( The \nlue must be binarv','TRROR',' IT);
if strcmp(co,T)
set(h.editboxI6,'Stiing',T);b6=I;
else
set(h.editboxl6,'SiringV());b6=0;
end
elseif (b7-^0 & b7 1)
co=questdlg('Hie value must be binarv',T!RR()R',T,'0',T);
if strcmp(co, 1')
set(h.editboxl7,String,' T);b7=l;
else
set(h.editboxl 7,'String','0');b7=0;
end
elseif (b8-^=0 & b8~=l)
co=questdlg( The value must be binary','TRROR',T,'()',T);
if strcmp(co,' I')
set(h.editboxl8,'Siring',' I );b8=l;
else
67


set(h.editboxl8,'String','0);b8=0;
end
eiseif (b9~=0 & b9~=l)
co=questdlg(' I he \ aluc must be binar\ ','!eRR( )K'.' 11');
if strcmp(co,' 1')
set(h.editbox 19,'String',' I );b9=l;
else
seUh.editbox19,'Siring','0');b9=0;
end
eiseif (bl0~=0 & blO~=l)
co=questdlg(' I he \aluc must he hinar\','1 KR()R,' 1 VO', I');
if strcmp(co,' 1 )
set(h.editbox20,'Siring','r);bl0=l;
else
set(h.editbox20,'String','0');blO=0;
end
end
cl=str2double(get(h.editbox21,'String'));
c2=str2double(get(h.editbox22,'Siring'));
c3=str2double(get(h.editbox23,,String'));
c4=str2double(get(h.editbox24,'String'));
c5=str2double(get(h.editbox25,String'));
c6=str2double(get(h.editbox26,String'));
c7=str2double(get(h.editbox27,String'));
c8=str2double(get(h.editbox28,'String'));
c9=str2double(get(h. editbox29, String'));
c 10=str2double(get(h.editbox30,' St ri ng));
if(cl~=0&cl~=1)
co=questdlg(' 1 he value must be binary ,T;RROR',T,'(>',T);
if strcmpfco,' I')
set(h.editbox21,'String','l');cl=l;
else
set(h.editbox21 ,'Stri ng','());c 1 =0;
end
68


eiseif (c2^=0 & c2~=l)
co=questdlg(' I he \aluo musi he binary,'I iRROR','1 ','0', I );
if strcmpKco, 1')
set(h.editbox22,'String',' 1 );c2=l;
else
set(h.editbox22,'String','0');c2=0;
end
eiseif (c3-^0 & c3l)
co=questdlg('I he value must he hin:ir\','1!I if strcmp(co,T)
set(h.editbox23,'Suing',' I ');c3=l;
else
set(h.editbox23,'StringVO');c3=0;
end
eiseif (c4~=0 & c4~=l)
co=questdlg('Ihe value musi he binary,T!RROR',T,'(l',T);
if strcmp(co,' I')
set(h.editbox24,'String',' I ');c4=I;
else
set(h.editbox24,Siring','0');c4=0;
end
eiseif (c50 & c5~=l)
co=questdlg(The value must he binary,TlRROR',T,'()',T);
if strcmpfco,' I')
set(h.editbox25,' S i r i ng VI' );c5= 1;
else
set(h.editbox25,'Siring','O');c5=0;
end
eiseif (c6~=0 & c6= 1)
CO=questdlg(The value must he binarv',TiRR()R','r,'0',T);
if strcmp^co, I')
set(h.editbox26,Siring',' I');c6=l;
else
69


set(h.editbox26,'String','0');c6=0;
end
elseif (c7~^=0 & c7~=l)
CO=questdlg('Hie value must be hinarv',TiRR()R',T,'0',T);
if strcmp(co,' I )
set(h.editbox27,'String1,11 ');bc=l;
else
set(h.editbox27,'String','0');c7=0;
end
elseif (c8~^=0 & c81)
co=questdlg(' I lie value must be binarv','1 iRR()R','r,'(),' 1');
if strcmpfco, I')
set(h.editbox28,'String',' I ');c8=l;
else
set(h.editbox28,'String','()');c8=0;
end
elseif (c9~=0 & c9~=l)
co=questdlg('The value must he hitutrx ',1 iRR()R', I1');
if strcmp(co,' I')
set(h.editbox29,'String', I );c9=l;
else
set(h.editbox29,String','o');c9=0;
end
elseif(cl0~=0 & clO~^=l)
co=questdlg(1 he value must he binarv','liRROR','I','0','I');
if strcmp(co,' I')
set(h.editbox30,'String',' I ');cl0=l;
else
set(h.editbox30,'String',O');cl0=0;
end
end
d 1 =str2double(get(h.editbox31,String'));
70


d2=str2double(get(h.editbox32,'String'));
d3=str2double(get(h.editbox33,'String'));
d4=str2double(get(h.editbox34,'Siring'));
d5=str2double(get(h.editbox3 5,St ri ng'));
d6=str2double(get(h.editbox36,'String'));
d7=str2double(get(h.editbox37,String'));
d8=str2double(get(h.editbox38,'String'));
d9=str2double(get(h.editbox39,' St ri ng'));
dl0=str2double(get(h.editbox40,String'));
if (dl~^0 & dl~=l)
co=questdlg('The value must be binarv',T,RR()R',T,T);
if strcmp(co,' i')
set(h.editbox31,'String',l');dl=l;
else
set(h.editbox31,'String','()');dl=0;
end
elseif (d2~=0 & d2~=l)
co=questdlg('I he \alite must be binarv','TRR()R',T,'I');
if strcmp(co,' I')
set(h.editbox32,'Stri ng',' I ');d2= 1;
else
set(h.editbox32,'String,'()');d2=0;
end
elseif (d3~=0 & d3~=l)
co=questdlg('The value must be hinar\','liRR()R7r,'0','r);
if strcmp(co,' I )
set(h.editbox33,'St ri ng',' 1 );d3=1;
else
set(h.editbox33,'StringVO');d3=0;
end
elseif (d4=0 & d4~=l)
co=questdlg('I he value must be binar\',TiRR()R','lI');
if strcmp(co,' I')
set(h.editbox34,,String',' 1 );d4=l;
else
71


set(h.editbox34,'Si ri ng,'< >);d4=0;
end
elseif (d5~=0 & d5~=1)
ca=questdlg('I he \alue must he binary','!tRROR','1 ,'0',T);
if strcmpico, I')
set(h.editbox35,'String',T);d5=l;
else
set(h.editbox35,'St ring',1 )');d5=0;
end
elseif (d6~=0 & d6 1)
co=questdlg('lhe \alue must he binar\','1 RROR',' 1 ','0',' 1');
if strcmp(co,' I')
set(h.editbox36,'String',' I );d6=l;
else
set(h.editbox36,String','()');d6=0;
end
elseif (d7~=0 & d7~=l)
co=questdlg('1 he \altie must be hinar\',T!RR()R',T,'()',T);
if strcmp{co,' I')
set(h.editbox37,'String,' 1 ');d7=l;
else
set(h.editbox37,'Siring','0,);d7=0;
end
elseif (d8^=0 & d8~l)
co=questdlg('1 he value must he binary','! RROR',T,'()',T);
if strcmp(co, I')
set(h.editbox38,'String',' I ');d8=l;
else
set(h.editbox38,'Siring','()');d8=0;
end
elseif (d9~=0 & d9~=l)
co=questdlg('I he \alue must he hinarv','1 Rk()R',T,I');
72


if strcmp(co,' I')
set(h.editbox39,String',' I ');d9=I;
else
set(h.editbox39,'String',()');d9=0;
end
elseif (dl0~=0 & d 10=1)
co=questdlg('The \ nine must be binar\',T.RR()R','l1');
if strcmp(co,' 1')
set(h.editbox40,'String',' I ');dl0=l;
else
set(h.editbox40,'Stri ng','( )');dl 0=0;
end
end
axes(h.axesl);
bitpuser = h.bitpuser;
nusers = h.nusers;
scale = h.scale;
Ao = h.Ao;
% Create time and wavelet multiplier
t = 0:0.05:8*bitpuser*scale( nusers);
U{1} = [al,a2,a3,a4,a5,a6,a7,a8,a9,al0];
U{2} = [b 1 ,b2,b3,b4,b5,b6,b7,b8,b9,b 10];
U{3} = [cl,c2,c3,c4,c5,c6,c7,c8,c9,c!0];
U{4} = [d 1 ,d2,d3 ,d4,d5,d6,d7,d8,d9,d 10];
for i = 1 tnusers
for j = 1 ibitpuser
phi{i}(j,:) = Ao(i)*exp(-(((t-(j*8-4)*scale(i))/scale(i)).A2)/2).* ...
cos(5*((t-(j*8-4)*scale(i))/scale(i)));
end
end
% Initializes all channels for each user
73


for i = 1 :nusers
ch{i} =0;
end
% Creates eneoded/modulated signal for all users
for i = 1 tnusers
for j =l:bitpuser
ch{i} = ch (i} + U{i}(j)*phi{i}(j,:);
end
end
% Plots of individual channels
plot(t,ch {1} ,t,ch {2} ,t,ch {3} ,t,ch {4})
title('lndi\ idual I 'ser Channels)
% xlabel('Time')
ylabelfAmplitude')
axis([0 300 -1.3 1.3])
grid;
hi = U{ 1,1};
h2 = U{l,2};
h3 = U{ 1.3};
h4 = TJ{ 1,4};
function noise_checkbox_Callback(hObject, eventdata, h)
global f;
global fnoise;
global eta;
/ocheckboxStatus = 0. if the box is unchecked.
" ocheckboxStatus = 1. if the box is checked
% checkboxStatus = get(h.noise_checkbox.'Value'):
% iff checkboxStatus)
% %if box is checked, text is set to bold
0 %set(handles.display_statieText.'FontWeighf 'bold'):
o fnoise = f;
% else
% %if box is unchecked, text is set to normal
74


% %set(handles.displav_statieText.'FontWeight', 'normal'):
% fnoise = f + eta:
%
o end
% Executes on button press in Plot Signal,
function pushbutton3_Callback(hObject, eventdata, h)
% hObject handle to pushbutton2 (see GCBO)
% eventdata reserved to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
global hi;
global h2;
global h3;
global h4;
global fhoise;
global f;
global eta;
axes(h.axes2);
bitpuser = h.bitpuser;
nusers = h.nusers;
scale = h. scale;
Ao = h.Ao;
n = h.n;
% Create time and wavelet multiplier
t = 0:0.05:8*bitpuser*scale( nusers);
U{ 1 > = hi;
U{2} = h2;
U{3} =h3;
U{4} = h4;
% Create wavelet vectors for each user for each bit vector for the
% transmit and receive functions
for i = 1 tnusers
for j = Cbitpuser
phi{i}(j,0 = Ao(i)*exp(-(((t-(j*8-4)*scale(i))/scale(i)).A2)/2).* ...
cos(5*((t-(j*8-4)*scale(i))/scale(i)));
75


end
end
% Initializes all channels for each user
for i = 1 :nusers
ch{i} = 0;
end
% Creates eneoded/modulated signal for all users
for i = 1 tnusers
for j =l:bitpuser
ch{i> = ch{i] + U{i}(j)*phi{i}(j,:);
end
end
% Sum the channels into one channel
f = 0;
for i = 1 :nusers
f = f + ch {i};
end
SNR = str2double(get(h.editbox81,'.String'));;
% Add guassian white noise at a level specified SNR
vars = (std(f))A2;
var_n= lfK(loglO(var_s) (SNR710));
eta = sqrt(var_n)*randn(size(f));
fnoise = f + eta;
% Plots the summed single channel without noise
plot(t, fnoise)
titleCSummed Channel Without Noise')
xlabelf 1ime')
ylabel(Amplitude')
axis([0 300 -1.3 1.3])
grid on;
% Plots the summed single channel with noise
76


% plot(t.fnoise)
% title(['Summed Channel With Noise SNR = '.num2str(SNR).'dB'])
% xlahel('Time')
% ylabel('Amplitude')
% axis( [0 300 -1.3 1.3])
o Executes on button press in Plot Signal,
function pushbutton4_Callback(hObject, eventdata, h)
o hObject handle to pushbutton2 (see GCBO)
% eventdata reserved to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
'o Decode the signals for each user's channel
% BER is then calculated per channel
global I;
global g;
global k;
global p;
global x;
global w;
global y;
global z;
global h 1;
global h2;
global h3;
global h4;
global fhoise;
bitpuser = h.bitpuser;
nusers = h.nusers;
scale = h.scale;
Ao = h.Ao;
n = h.n;
o Create time and wavelet multiplier
t = 0:0.05:8*bitpuser*scale( nusers);
U{ 1} = hi;
77


U{2}=h2;
U{3} =h3;
U{4} = h4;
% Create wavelet vectors for each user for each bit vector for the
% transmit and receive functions
for i = I tnusers
for j = 1 :bitpuser
phi{i}(j,:) = Ao(i)*exp(-(((t-(j*8-4)*scale(i))/sca!e(i)).A2)/2).* ...
cos(5*((t-(j*8-4)*scale(i))/scale(i)));
end
end
threshold = str2double(get(h.editbox82,'String'));
errorcount} I tnusers) = 0;
for i = 1 tnusers
for j = l;bitpuser
% Decodes the signal with a specified threshold
decoded{i}(j) = fnoise / phi{i}(j,:);
if abs(decoded{i}(j)) > threshold
decoded{i}(j)= 1;
else
decoded}i}(j) = 0;
end
% Calculates the BER of the signal
if decoded{i}(j) ~= U{i)(j)
error_count(i) = error_count(i) + 1;
end
end
end
1 = decoded} 1,1};
g = decoded} 1,2};
k = decoded} 1,3};
p = decoded} 1,4};
w = error_count(l);
x = error_count(2);
78


y = error_count(3);
z = error_count(4);
% Executes on button press in Output Data,
function pushbutton5_Callback(hObject, eventdata, h)
% hObject handle to Output Data (see GCBO)
% eventdata reserved to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
global 1;
global g;
global k;
global p;
ran4 =[1( 1), 1(2), 1(3), 1(4), 1(5), 1(6), 1(7), 1(8), 1(9), 1( 10)];
set(h.editbox41,'String',ran4(l));
set(h.editbox42,'String',ran4(2));
set(h.editbox43,'String',ran4(3));
set(h.editbox44,'String',ran4(4));
set(h.editbox45,' St ri ng',ran4(5));
set(h.editbox46,'Stri ng',ran4(6));
set(h.editbox47,'String',ran4(7));
set(h.editbox48,'String',ran4(8));
set(h.editbox49,'Siring',ran4(9));
set(h.editbox50,String',ran4(10));
g = g;
ran5 = [g(l),g(2),g(3),g(4),g(5),g(6),g(7),g(8),g(9),g(10)];
set(h.editbox51,''String', ran5( 1));
set(h.editbox52,'Stri ng',ran5(2));
set(h.editbox53,'String',ran5(3));
set(h.editbox54,String',ran5(4));
set(h.editbox55,'String,ran5(5));
set(h.editbox56,'String',tan5(6));
set(h.editbox57,'String',ran5(7));
set(h.editbox58,'String',ran5(8));
set(h.editbox59,'String',ran5(9));
79


set(h.editbox60,'String',ran5( 10));
k = k;
ran6 = [k(l),k(2),k(3),k(4),k(5),k(6),k(7),k(8),k(9),k(10)];
set(h.editbox61,'String',ran6( 1));
set(h.editbox62,'String',ran6{2));
set(h.editbox63,'String,ran6(3));
set(h.editbox64,'String',ran6(4));
set(h.editbox65,'String,ran6(5));
set(h.editbox66,'String',ran 6(6));
set(h.editbox67,'String',ran6(7));
set(h.editbox68,'Siring'.ran6(8));
set(h.editbox69,'String,ran6(9));
set(h.editbox70,'S t ri n g,ran6( 10));
p = p;
ran7 = [p(l),p(2),p(3),p(4),p(5),p(6),p(7),p(8),p(9),p(10)];
set(h.editbox71,'String',ran7(l));
set(h.editbox72,'String,ran7(2));
set(h.editbox73,S t ri ng',ran7(3));
set(h.editbox74,'String',ran7(4));
set(h.editbox75,'String',ran7(5));
set(h.editbox76,'String,ran7(6));
set(h.editbox77,'String',ran7(7));
set(h.editbox78,String',ran 7(8));
set(h.editbox79,'String,ran7(9));
set(h.editbox80,'String',ran7( 10));
% Executes on button press in Plot Signal,
function pushbutton6_Callback(hObject, eventdata, h)
global x;
global w;
global y;
global z;
Totalerrorcount = w+x+y+z;
80


bitpuser = h.bitpuser;
nusers = h.nusers;
BER = Total_error_count/(bitpuser*nusers)*100;
sprintf^ I he overall BER is *oJ0(>"(> %d',BER);
se^h.editboxSS,' Si ri ng',BER);


APPENDIX B
Determination of Subbands for the Communication Channel Bandwidth
For the scaled wavelet of the scale a, the bandwidth and the center frequency are
determined using equation (2.17) in order to compute the subbands. For all four users
considered to be transmitting in the communication channel bandwidth of[l6,40]
MHz, scales will be determined by trial and error. For the Morlet wavelet at scale 1,
we have a>0 = 2^/0 =5 rad Is, and Bf) =\J0\rad / s.
Subband determination for the first user
a =1.87,
x g7 = .85 40 = 34MHz
a 1.87 n
Bx g7 = ^ = .29, B. = .29*40 = 11.6MHz
18 a 1.87 n '
Then, the subband is [ Subband determination for the second user
a = 2.2,
(O-y -> 5 *>2.2 = .72, co22 =.72*40 = 28.mHz
a 2.2 7t
^22 II * 1.701 2.2 ^22 7t = .25, B22 =.25*40 = 10MHz
B B
Then, the subband is [a)22 + , a>22 2A] = [33.8, 23.8] MHz
82


Subband determination for the third user
a =2.8,
_
*>2 8
a
_5_
2.8:
_g0 .1.701
28 a 2.8
ia
2.8
n
B
= -57,
2.8
7T
= .19,
ft2g = .57 40:
5, =.19*40
B B
Then, the subband is [2 8 + , co2s 2J-] = [26.6, 19] MHz
Subband determination for the fourth user
a = 3.3,
*>3 3 =
*>o _ 5
a 3.3
(O
n
= -48,
ft>33 = .48 40 =
_ _ 1-701
.3.3
a,. 3.3
B
^-s.16,
7t
B4 =.16*40:
B B
Then, the sub-band is [a>3 3 + -22-, (o3 3 21] = [22.4, 16] MHz
22.% MHz
= 7.6MHz
19.2 MHz
= 6.4MHz
83


BIBLIOGRAPHY
[1] Teolis, Anthony. Computational Signal Processing with Wavelets. Boston:
Birkhauser, 1998.
[2] Mallat, Setephane. A Wavelet Tour of Signal Processing. 2nd ed. California:
Academic Press, 1999.
[3] Klingman, Joseph. Efficient, Secure and Noise Robust Data Encoding and
Decoding Wavelet-based Algorithm. Masters thesis, University of
Colorado at Denver, 2002.
[4] Ingrid, Daubechies. Ten Lectures on wavelets. Philadelphia: Society for
Industrial and Applied Mathematics Press, vol. 61 of CBMS-NSF
Regional Conference Series in Applied Mathematics, 1992.
[5] Goswami, Jaideva, and Chan, Andrew. Fundamentals of Wavelets: theory,
algorithms, and applications. New York: John Wiley & Sons, Inc., 1999
[6] Duane, Hanselman, and Bruce, Littlefield. Mastering Matlab 5: A
Comprehensive Tutorial and Reference. New Jersey: Prentice Hall, 1998
84