Singnal Encoding and Decoding Using CDMA Technique
Singnal Encoding and Decoding Using CDMA Technique
OVERVIEW
The global wireless communication market is booming. There are almost 500 million users
worldwide and should be nearly 1 billion within few years. So its a very challenging field to
discuss. But several constraints must be considered. Communication noise, limited
transmission band, multipath effect, interference of other signals is the main topics here. So a
reliable wireless system design is a vital factor to provide seamless services to the subscribers
here.
If we divide total wireless evolution in four generation then it looks like follows:
In first generation only voice was considered. So two analog system AMPS and DAMPS were
sufficient. As time progress 2nd generation system GSM came but still data is low rate. Now
3rd generation in wireless system is continuing .So at present and recent future many high
scaled data like video and e-mails needs to be transferred. As data needs to be transferred at
high rate through limited transmission bandwidth, an alternative wireless system needs to be
design. CDMA plays an important role to high speed data transfer by reusing the frequency
band. Comparison of different mobile systems with respect to active users and frequency
reuse capability is shown in the following chart:
2
Figure 1.2 Bandwidth and frequency reuse comparison.
From the above figure it is clear that CDMA can bear large load than others. Again a
frequency band can be used in each cell in CDMA.
At first generation analog system Advanced Mobile Phone System (AMPS) used
FDMA.
Here voice can be transmitted through dividing the total frequency in to several cells. When
digital system came then it used both TDMA and FDMA. Here frequency band is further
divided into time slots. As transmission frequency band is limited so a fixed amount of user
can communicate at a time. For additional users call fail occurs. As CDMA can reuse
frequency by coding theory it can handle additional user load.
3
CDMA can offer 7 to 10 times the capacity of analog technologies and up to 6 times the
capacity of digital technologies such as TDMA.
As the entire user can use total frequency at a time, data speed of CDMA system is several
times higher than previous one. CDMA provides 144 Kbps speed for mobile users and 2
Mbps for stationary users.
Again CDMA provides a solution to multipath effect. Multipath effect means when a signal is
transmitted then it can traverse several paths. So a delay is associated with every multipath
component. In CDMA system by designing a RAKE receiver properly multipath components
can be resolved.
Although all the user use same frequency band, their transmittable signals are
Separated by users unique code. So interference in CDMA is low.
Power management is an important matter in CDMA system. Less power is needed here than
others because of large bandwidth. So life time of battery of mobile set is much higher.
Finally CDMA allow soft handoff. Soft handoff means a station cant release a
Connection before accepting by other station. So probability of call drop in hand over places
is very low.
4
Day by Day progress of CDMA technique is shown in the following graph.
5
CHAPTER TWO
CDMA FUNDAMENTALS
2.1 INTRODUCTION
Multiple access means participating more than one user in any job at a time. There are three
multiple access techniques that are FDMA (Frequency Division Multiple Access), TDMA
(Time Division Multiple Access) and CDMA (Code Division Multiple Access).The relative
comparison of these three and details of CDMA are described here.
In FDMA total transmission bandwidth is divided into some fixed sized cells. These cells are
further divided into sub-cells. Frequency of a cell is divided into two links: uplink and
downlink frequencies. Here a frequency is allocated to the user to communicate. User
transmits the modulated signal modulating by this carrier frequency. It is analogous to a hall
room where several couples conversed to each other by making small sub-rooms in the hall
room.
6
2.1.2 Time Division Multiple Access (TDMA)
In TDMA many users communicate to each other by dividing transmission time into some
time slots. Users at present use time slots sequentially. In this case uplink and downlink
frequencies need not been separated. Different time slots are specified for incoming and
outgoing data.
7
In CDMA all the subscribers use the same large frequency band and it is the main power of
CDMA. With Code Division Multiple Access, network stations transmit continuously and
together on the same frequency. For each user in CDMA, there is a unique signature code that
consists of a binary sequence. Interference between the transmissions of different users is
resolved by the signature code. It is analogous to hall room where all couples can speak
together by using different languages.
Spread spectrum (SS) was initially developed for military anti-jamming communications in
the mid-1950. It has since found a wide range of applications in commercial wireless systems.
The underlying idea of spread spectrum is to spread a signal over a large frequency band and
transmit it with low power per unit bandwidth.
Following figure shows comparison of spread spectrum signal compared to traditional
communication system.
Figure 2.4 comparison of spread spectrum signal and traditional Communication system.
8
Among many possible ways of spreading the bandwidth, the two predominant types are as
follows:
DS spread spectrum achieves band spreading by modulating the information symbol stream
with a higher rate chip sequence. Each symbol of duration Ts is spread into multiple chips of
duration Tc < Ts. The bandwidth expansion factor L,
L = Ts / Tc
Determines the amount of redundancy infected during modulation. L is often called the
spread factor or the processor gain. Having a spreading factor L spectrum is spreaded L
9
times than symbol spectrum. Spreading the spectrum take place by multiplying each symbol
information by its chip sequence.
Where,
C (i) = each chip of spreading waveform.
P (t) = chip pulse shaping filter.
After spreading, the chip sequence is usually shaped by this filer P (t), to limit the bandwidth
of the output.
10
At the receiver end spreading waveform plays main role of user detection and reconstruction
of original symbol stream. In DS-SS spreading factor L has an important effect on CDMA
system. Because
Instead of using the code sequences to spread the signal in the time domain, frequency-
hopping spread spectrum transmits information through L possible frequency bands based on
an index provided by the codes.
Where binary code, {Ck (i)} that is a set of {0, 1} determines at which frequency the
information is transmitted. The frequency pattern is designed to vary with time, as illustrated
in the following figure:
11
Where the shaded area denotes the frequency bins through which the information is
transmitted at a given time for a given symbol. If only a single carrier frequency is used on
each hop, the data modulation is called single channel modulation.
Frequency hopping may also be classified as fast or slow. Fast frequency hopping occurs
when the hopping rate equals or exceeds the symbol rate, whereas Slow frequency hopping
implies that many symbols ate transmitted in the time interval between frequency hops.
Total CDMA structure has been divided into two channels that is
Forward channel and Reverse channel
The inside structure of these two channels are almost same but reverse. Definition of these
two channels is given bellow.
A forward channel is a link through which the network / base station transmits a signal to the
mobile user. A reverse channel is a link through which a mobile user transmits a signal to the
base station. These two channels are graphically shown bellow:
12
Figure 2.9 Reverse Channel
Last three blocks is the main region of interest of this thesis and will be discussed in the next
chapter. But a short note on the first twos is given in this chapter.
2.4 DIGITIZATION
Digitization is used for coding the analog voice signal to digital signal .The technique applied
here is called vocoding. This allows compression of the signal to occur at the same time.
The specific vocodor employed in IS-95 is not defined in specification. IS-96-A defines the
vocoding standard for CDMA.
13
2.5.1 Convolutional Encoder
Convolutional coding encodes the incoming bit stream of information, thus allowing the
receiver to correct the errors at the receiver and an improvement in communication reliability.
Alternatively, for a fixed communication reliability level, Convolutional coding allows a
lower power transmitter in the system.
2.5.2 Repetition
User data entering the system enters at a slower rate. The output of the block interleaver is
fixed at 19.2 Kbps; hence, the repeater repeats the data to achieve the fixed bit rate. For
example, if the user data rate was at 9.6 Kbps, the data would be repeated twice to achieve
19.2 Kbps at the output of the interleaver.
The Convolutional encoder / decoder corrects short burst of error in bit stream easily.
However, it is unable to correct long burst of errors in the bit stream through the channel. A
block interleaver rearranges the order of the bits in the bit stream. During transmission, if a
long burst of errors occurs in the bit stream, at the receiver, a block deinterleaver will
rearrange the bit stream into its original sequence. During this process, the long burst of errors
will appear on the Convolutional encoder as short burst of error. The Convolutional decoder
can now correct the errors.
14
CHAPTER THREE
3.1 INTRODUCTION
Spreading and Modulation are two important part of CDMA system. The purpose of
spreading is necessary to increase the bandwidth and the purpose of modulation is to efficient
transmission of spreaded signal.
3.2 SPREADING
Spreading is done by multiplying the input bit stream with a CDMA code. It is math
mathematically expressed as-
Where,
X (t) = spreaded signal.
a (t) = CDMA code.
s (t) =input stream.
There are different types of CDMA code that are mentioned bellow-
15
3.2.1 Walse Code
The walse code is calculated from a special type of matrix called walse matrix. Each row of
this matrix corresponds to a walse code and each code is unique. Each code is a sequence of 1
and -1. These 1 and -1 are called chips of walse code. A walse matrix contains one row of all
ones and the remaining rows each have equal number of ones and minus ones. Walse code
also called Hadamard code.
IS-95 CDMA system uses a 64 X 64 walse matrix for walse code generation. So 64 walse
codes are generated from the following walse matrix:
16
Each walse code consists of 64 chips. Each CDMA user is assigned a walse code for
spreading his bit stream. So only 64 users is possible in this system.
Where,
____
Where n is a power of two and Wn is the information of Wn such that 1 becomes - 1 and -1
becomes 1.
Orthogonality of each pair of Walse code is an important property that makes it popular for
CDMA encoding and decoding. This property indicates that bit wise multiplication and
summation of each pair of Walse code is zero. This is expressed mathematically as follows:
i=m
Wa, i * Wb, i = 0
i=1
Where,
17
Wa, i = ith chip of as Walse code.
Wb, i = ith chip of bs Walse code.
If two same walse code is bit wise multiplied and summed then result is number of chip in
that code. Again if a code is bitwise multiplied and summed with negation of code then result
is same as previous but negative signed. These are expressed mathematically as follows:
i=m
Wa, i * Wa, i = m
i=1
and
i=m
Wa, i * Wa, i = - m
i=1
These two are generally used for scrambling of spreaded bits. Scrambling means
encryption of bit stream making it noise like. Scrambling is different from spreading because
no bandwidth expansion occurs here. Uplink scrambling codes maintains separation among
different mobile stations. Short PN codes are recommended for base stations equipped with
advanced receivers employing multi-user detection or interference cancellation.
PN sequences are generated by combining the outputs of feedback resisters. A feedback shift
register consists of consecutive twostage memory or storage stages and feedback logic.
Binary sequences are shifted through the shift register in response to clock pulses. The
18
contents of the stages are logically combined to produce the input to the first stage. The initial
contents of the stages and feedback logic determine the successive contents of the stages. A
feedback shift register and its output are called linear when the feedback logic consists
entirely of modulo-2 adders.
19
The operation of the shift register is controlled by a sequence of clock pulses. At each clock
pulse the content of each stage in the register is shifted by one stage to the right. Also, at each
clock pulse the contents of stages X3 and X4 are modulo-2 added and the result is feedback to
stage X1. The shift register sequence is defined to be the result is fed back to stage.
X1 is initially filled with a 0 and the other remaining stages are filled with 0, 0 and 1 that is
the initial stage of register is 0 0 0 1. Next we perform the shifting, adding and feeding
operation where we obtain the result after each cycle that is shown in the following table:
20
We notice that contents of shift registers repeat after 2 ^ 4 -1 = 15 cycles. The output
sequence is given as 0 0 0 1 0 0 1 1 0 1 0 1 1 1 1 where left most bit is the earliest bit.
Sequences are best shown in the following figure.
1. An arbitrary data sequence S (t) is generated by a digital source. In this case, we use +1 and
-1 to represent 1 and 0 respectively.
2. A PN code sequence P (t) is generated by a feedback shift register.
3. We multiply S (t) and P (t) bitwise. This is called scrambling. The output of the multiplier
is transmitted to a distant receiver.
21
Figure 3.5 Descrambling at receiver end.
For circuit implementation modulo-2 operation is preferred since exclusive or gates are
cheaper than multiplication circuits. In modulo-2 operation 0 and 1s are used. But here for
modeling purpose multiplication is easier.
Now total operations are listed in the following table:
Instead of transmitting bit stream directly it is encoded by walse code. To transmit a bit 1
actually walse code chips are transmitted sequentially and to transmit a bit 0 ones
complement of walse code is transmitted. For 64 chip walse code chip rate is 64 times higher
than original bit stream.
22
CDMA encoding technique is described in the following example. Here for simplicity we
consider a case 8 chips are used per bit to generate the walse function. Stations A, B, C, and D
are assigned the following walse codes:
As mentioned previously the normalized correlation of any two distinct chip sequences is 0
and the normalized correlation of any chip sequence with itself is 1. By using this property we
23
want to show that the receiver recovers the bit stream of station C by computing the
normalized inner products of the received sequences with the chip sequence of station C.
The following figure shows the spreading and dispreading of input signal:
3.3 MODULATION
After spreading input stream spreaded data is modulated by a high frequency carrier. And it is
done for transmission purpose. There are three ways to modulate a waveform which are-
24
1. Amplitude Modulation (AM).
2. Frequency Modulation (FM).
3. Phase Modulation (PM).
Phase Shift Keying (PSK) also known as phase modulation. In case of PSK, the frequency
and amplitude of the carrier is constant, while the phase of the carrier (p) varies according to
the input data stream. The carrier signal is given by:
For a PSK modulation scheme the number of bits to represent one symbol is shown as
follows:
N = log2M
Where,
N = number of bits per symbol.
M = number of levels.
Depending on the number of bits per symbol two type of modulation can be applied in
CDMA. First one is Binary Phase Shift Keying (BPSK) that is simple to implement and
second one is Quadrature Phase Shift Keying (QPSK) that is little bit complex than BPSK but
efficient.
In BPSK total phase is divided into two parts. One is 0 degree phased carrier and another is
180 degree phased carrier. Each bit of bit stream can be represented by of these two different
phased carriers.
25
Bit 1 ==> 0 degree.
Bit 0 ==> 180 degree.
BPSK can be implemented by multiplying each bit of spreaded signal by a cosine wave
signal.
Here,
Y (t) = Transmitted signal.
X (t) = Spreaded signal.
Y(t) is then transmitted. At the receiver end if we multiply Y(t) by the same carrier cos (wt)
then original signal before modulation is recovered.
N = log2 M
If M = 4 then N=2. That means total phase is divided into four phase angles. Thus from the
above equation, QPSK uses two bits to represent one symbol. Each possible bit pair is
mapped to a phase angle. These two bits are modulated independently into two channels
called I-channel and Q-channel. Phase difference between these two modulated signals is 90
degree. QPSK act as two independent BPSKs.
26
QPSK phase and channel allocation and constellation diagram is shown bellow:
3.3.2.1 IQ-Modulation
27
Where,
A (t) = amplitude of the carrier signal,
P (t) = phase of carrier signal.
I(t) can be generated by scrambling odd positioned bit. And Q(t) can be generated by
scrambling the odd positioned bits. A short PN sequence scrambles the signal spreaded by
walse code. This is produced with a fifteen- stage feedback register. The short code is 2^15 -1
chip long. So period of short code is 2^15 -1. The PN sequence generator creates the codes at
a rate of 1.2288 Mcps, resulting it repeating every 26.67ms. I and Q channel uses different PN
sequence, this reduce the probability of errors of the transmitted signal. IQ-modulation is best
shown in the following figure:
Here, Y (t) = Xodd (t) * Ipn (n) * Cos (wt) + Xeven (t) * Qpn (n) * Sin (wt)
28
PQ (x) = x15 + x12 + x11 + x10 + x6 + x5 + x4 + x3 + 1
Based on the characteristic polynomials, the pilot PN sequences I(n) and Q(n) are generated
by the following linear recursions:
Pulse-shaping is required for both the I and Q channels. The purpose of this pulse shaping is
to band limit the signal to meet FCC regulations. This pulse-shaping filter is identical for both
I and Q channels. These coefficients are separated in time by one fourth a PN chip (203.5 ns).
Most filtering used in mobile communications obeys Nyquist's pulse-shaping criterion for
zero inter symbol interference (ISI). His theorem states that the received pulse shape, pr (t),
must have the property
Where T is the symbol period and n is any integer. For matched filtering, one would convolve
the transmitted pulse-shape with a time-reversed version in order to minimize the noise. All
sampling instants after convolution must occur at t = nT for there to be zero ISI. For IS-95,
the receiver filter is identical to the pulse shaping filter due to symmetry. The convolution of
the two filters is shown in Figure 3.11 with the sampling instances marked by the symbol `+'.
It is notable that where the sampling instances occur, the waveform is not equal to zero. The
modified pulse-shape has better spectral characteristics than convential raised cosine filter.
The resulting ISI is acceptable when attempting to meet stringent bandwidth constraints.
29
Figure 3.11 Convolution of pulse-shaping filter with matched filter; appropriate
Sampling instances for each chip are marked with +.
A base band filtering can be designed by its filter coefficients. As filter is symmetric, its
coefficients are also symmetric. A digital filter is specified with coefficients given in Table
3.4.
30
Table 3.4 Filter Coefficients for Base band Filtering
31
CHAPTER FOUR
4.1 INTRODUCTION
In this chapter BPSK modulation is shown in the figure for simplicity. But if system uses IQ-
modulation the BPSK will be replaced with this.
4.2 TRANSMITTER
The following figure shows a simple transmitter. Here after spreading the input signal it is
modulated and then transmitted.
32
4.3 MULTIPATH EFFECT
When a transmitter transmits signal it propagates through air medium. Some parts of the
signal reflect in the obstacles then reach to the receiver. So a time delayed signal as well as
primary signal reaches to the receiver. The signal that passes directly from transmitter to
receiver is called Line Of Sight (LOC) of the signal. Other delayed signals are called
multipath components.
The single user receiver is the basic receiver design for DS-CDMA system. This receiver can
decode only one users signal by his walse code. The signals from other users are treated as
33
interference, e.g.., multiple access interference (MAI). The single user receiver is the simplest
in complexity but its performance suffers in the presence of large MAI.
Correlation receivers are optimal in AWGN channel, while they have several drawbacks. As
we know multi path effect is a resistance to wireless communication. Correlation receiver
rejects multi path components regarding them noise like. Correlation receiver can receive only
LOC (line of sight) of the signal.
Where,
Y(t) = Received modulated signal.
S(t) = Signal after de-modulation and de-spreading.
LPF = Low Pass Filter.
Previously described problems can be resolved by designing a special type of receiver called
rake receiver. Actually rake receiver is a collection of several correlation receiver. It uses
34
multiple correlators to separately detect the M strongest multipath components. In rake
receiver after receiving the signals different multipath components are sent to different
correlator for decoding. In case of rake receiver a single correlator is called arm of receiver.
Following figure shows a rake receiver.
Each correlator takes as input a delayed signal and walse code to resolve that signal. Then the
output of all the correlators is combined to get aggregate result. Here only the maximum
output of the correlator is taken and multiplied with a large gain term and low outputs of the
correlator is multiplied with low gain term to reduce them.
After performing this operation over a walse period T, result is compared with the threshold
of a decision device for estimation of a bit.
Here one arm rake receiver is same as correlation receiver. Two arms rake receiver can
resolve one multipath component as well as original signal. Practically three arms rake
35
receiver is used in CDMA system and can resolve two multipath components. If number of
multipath components is large than number of arms then strongest components only survives.
If number of multipath components is equal to the number of arms then optimal result can be
found. Again if number of multipath components is less than number of arms, then some arm
resource is wasted.
Considering this problem a new type of rake receiver has been proposed that is slight
modification of the previous rake receiver.
Here an additional components counter included at the receiving point and each correlator
must have enable/disable input bit. Correlator becomes enable if 1 is send as input to
correlator.
In this receiver number of multipath components is found first from components counter.
Then a desired bit word is send to the correlators to make actual number of correlators enable.
All other operations of this receiver is same as previous RAKE receiver.
For example if at present number of multipath components are three including original signal
then bit word looks like follows.
36
Block diagram of proposed RAKE receiver looks like follows:
37
CHAPTER FIVE
SIMULATION
5.1 INTRODUCTION
Two input voice signal is captured from microphone sampling at 8 KHz. Following function
is used for this purpose-
Where, fs =8000 Hz
t = Total recording time in second.
y1=Captured samples in matrix form where each
sample contains a double type value.
In our simulation purpose we have captured two signals for 2 seconds that means total 16000
samples are coded. Off them 1000 samples are plotted in graph by the following function:
38
plot (y1 (1:1000, 1));
Voice signal 1:
Voice signal 2:
39
5.3 SPREADING THE INPUT SIGNALS
Taking sampled signals of double type each sample is converted into 16 bit unsigned integer.
Then each bit is spreaded by 4 chip walse code. Practically 64 bit walse code is used but here
for simplicity only 4 bit walse code is used. In our simulation following user defined function
is used- [note: all user defined function definition is given in the appendix.]
40
Here both are used in simulation. In BPSK modulation user defined function modulation () is
used. In IQ-modulation even and odd chips are grouped and using following function a
complex signal is formed-
As transmission medium is noisy, some random noise needs to add to signal. Noise is added
to the signal by user defined function-
Noise add ()
41
Received noisy modulated noisy signal at receiver end looks like follows:
After noise signal is received to the receiver end, it is demodulated and despreaded. But this
signal is distorted from original signal due to transmission noise. In our simulation user
defined function
Noisy signal after demodulation and noisy signal after de-spreading is given bellow-
42
De-modulated signal:
Despreaded signal no 1:
43
Despreaded signal no 2:
In fig: 5.7 and fig: 5.8 noise spikes are formed because of the noise of transmission channel.
Fig 5.7 is the noisy version of original signal in fig 5.1 and Fig 6.8 is the noisy version of
original signal in fig 5.2.
Frequency band of noise is different from that of voice signal. Voice signal contain frequency
from 0 to about 320 Hz. But frequency of noise is different from that of voice signal.
Frequency spectrum of the signal is obtained by Fourier transform.
Power spectrum of the voice signal in fig 5.1 is shown in the following figure where
horizontal line indicates frequency and vertical line indicates power-
44
Figure 5.9 power spectrum of original voice signal 1.
In figure 6.10 it is clear that many additional frequency components are added to the signal
for noise. As our input voice signal contain only low frequencies, then by applying a low pass
filter that pass only 0 to 300 Hz we can remove noise. In our simulation this can be done by a
user defined function named
noise_remove ();
45
Power spectrum of the filtered signal is shown bellow:
Yet a large amount of noise is removed, some noise is still present that is shown in he upper
figure.
So another technique for noise can be implemented. In this technique filter is imposed hen de-
spreading signal because walse code has low correlation with noise. As mentioned earlier
when a signal bit is spreaded by a 4 chip walse code then spreading actor is 4. When spreaded
signal is multiplied by same walse code then original signal bit is recovered. As noise is added
with each chip, so frequency of noise is same as that of chips. Knowing this things noise can
be removed by following technique-
46
Now-
(noisy spreaded code) * (walse code)
= ((spreaded code) + (noise)) * (walse code)
= (spreaded code) * (walse code) + (noise) * (walse code)
= Original signal bit + (noise) * (walse code)
As frequency of original signal bit and noise multiplied by walse code is different, so y
filtering noise frequencies properly noise can be removed.
47
CHAPTER SIX
6.1 RESULTS
When no transmission noise is not added then decoded voice signal was exactly same as the
original signal.
But when noise was added then the decoded signal was distorted. If we filter the decoded
signal then big amount of noise is removed but still present some noise. I think this noise can
be removed by the technique described previous chapter.
1. Receiver accuracy.
2. Capacity.
3. System accuracy.
Correlation receiver can detect only main signal component, other delay component is noticed
as noise. If at present there is no delay component then correlation receiver works with 100%
efficiency. But there is a delay component with the main signal then there is a possibility of
occurring error at 50% time. So accuracy graph of correlation receiver looks like follows:
48
Figure 6.1 Accuracy of correlation receiver.
Accuracy of three arms RAKE receiver against multipath components looks like follows:
49
Sometimes three arms RAKE receiver waste arm resource if multipath component is less than
arms number. The following figure shows number of active arms against multipath
components:
Here all the three arms active all the time even though it is no need to be active when there are
one or two components only.
Our proposed RAKE receiver with multipath components counter makes optimal use of arms
against multipath components:
50
6.2.2 System Accuracy
In case of noise addition about 80 samples are corrupted between 1000 samples.
Figure 6.5 System accuracy comparing corrupted samples with input samples.
6.2.3 Capacity
In case of fixed signal to noise ratio (S/N =9) capacity of AMPS, GSM and CDMA is found
from following equation-
C = Bw log2 (1 + S/N)
51
Following figure shows this phenomenon-
6.3 DISCUSSION
Implementation of CDMA system was real time by TMS320C50 dsp kit because its clock rate
is 40 MHz. In implementation spreading, modulation and de-spreading of signal is monitored
in LCD display and oscilloscope. Here only BPSK is implemented, IQ-modulation is not
considered in case of implementation.
52
Special attention is given to the receiver design. Existing receivers are described and a new
RAKE receiver is proposed in this thesis. Performance of proposed receiver and existing
receivers are compared shown that proposed receiver is effective in terms of resources uses.
6.4 LIMITATIONS
With the knowledge of this paper following extensions of the thesis can be made-
53
REFERENCES
[5] Imam Mahmud Taifur Rahman Al-wazedi and Makoto Kawai , A New Switching
54
[12] M. K. Simon, J. K. Omura, R. A. Scholtz, and B. K. Levitt, Spread Spectrum
[13] J. D. Parsons, the Mobile Radio Propagation Channel, Halsted Press, New York,
1992.
55
APPENDIX
global fs;
global t;
global y1;
t=2;
fs=8000;
y1 = wavrecord (t*fs, fs,'double');
y1 (1) =0.99;
y1 (2) =-0.99;
wavwrite (y1, fs,'C:\j1.wav');
global fs;
global y1;
fs=8000;
[y1, fs, n]=wavread ('c:\j1.wav');
plot (y1 (1:1000, 1));
wavplay (y1, fs,'sync');
global w;
w {1}= [1 1 1 -1];
w {2}= [1 1 -1 1];
w1{1}= [-1 -1 -1 1];
w1{2}= [-1 -1 1 -1];
56
for i=1:8000
e1 {i} = [];
e2 {i} = [];
for j=1:16
c1=bitget(v1(i),j);
c2=bitget(v2(i),j);
r=(j-1)*4;
if(c1==1)
e1{i}=horzcat(e1{i},w{1});
else
e1{i}=horzcat(e1{i},w1{1});
end
if(c2==1)
e2{i}=horzcat(e2{i},w{2});
else
e2{i}=horzcat(e2{i},w1{2});
end
end
et{i}=e1{i}+e2{i};
e{i}=complex(et {i}(1:2:64) , et {i}(2:2:64));
end
global w;
w{1}=[1 1 1 -1];
w{2}=[1 1 -1 1];
l=0;
k=0;
c=1;
d=1;
s1=0;
s2=0;
for i=1:8000
for n=1:32
p{i}((n-1)*2 + 1)=real(p1{i}(n));
57
p{i}((n-1)*2 + 2)=imag(p1{i}(n));
end
for j=1:4:61
s1=s1+sum(w{1}.* p{i}(j:j+3));
s2=s2+sum(w{2}.* p{i}(j:j+3));
k=k+1;
if(s1>0)
c=bitset(c,k,1);
else
c=bitset(c,k,0);
end
if(s2>0)
d=bitset(d,k,1);
else
d=bitset(d,k,0);
end
s1=0;
s2=0;
end
d1(i)=(c-10000)/10000;
d2(i)=(d-10000)/10000;
k=0;
c=1;
d=1;
end
58
function pushbutton5_Callback(hObject, eventdata, handles)
global fs;
global t;
global y2;
fs=8000;
y2 = wavrecord(t*fs,fs,'double');
y2(1)=1;
y2(2)=-1;
wavwrite(y2,fs,'C:\j2.wav');
59
function pushbutton10_Callback(hObject, eventdata, handles)
global fs;
fs=8000;
[y13,fs,n]=wavread('c:\e2.wav');
plot(y13(1:1000,1));
wavplay(y13,fs,'sync');
function modulation()
global z1;
for i=1:1
for j=1:64
for k=1:8
z11{i}((j-1)*8 + k) = z1{i}(j) * cos((3.142 *
k)/4);
end
end
end
t=(z11{1})';
plot(t(1:150,1));
function noise_add()
global z;
for i=1:8000
for j=1:32
z{i}(j)=z{i}(j) + complex(randn(1)*0.7,randn(1) *
0.7);
end
end
60
% Executes on button press in Error correction button. %%
function noise_remove()
global fs;
global flag;
flag=1;
fs=8000;
[y121,fs,n]=wavread('c:\e1.wav');
[y122,fs,n]=wavread('c:\e2.wav');
Y = fft(y121,1000);
F=[0 0.02 0.05 0.1 0.2 0.23 0.25 0.3 0.4 0.5 0.6 0.7 0.8 1];
A=[1 1 1 1 1 0 0 0 0 0 0 0 0 0];
b = firpm(23,F,A);
for j=1:24
oy1(j)=b(1:j)*y121(j:-1:1);
oy2(j)=b(1:j)*y122(j:-1:1);
end
for p=25:8000
oy1(p)=b*y121(p:-1:p-23);
oy2(p)=b*y122(p:-1:p-23);
end
oy1(1)=0.98;
oy2(1)=0.98;
oy1(2)=-0.98;
oy2(2)=-0.98;
wavwrite(oy1,'C:\e11.wav');
wavwrite(oy2,'C:\e21.wav');
wavplay(oy1,fs,'sync');
plot(oy1(1:1000));
Y = fft(oy1,1000);
yy = Y.* conj(Y) / 1000;
plot(yy);
61