s.eeweb.coms.eeweb.com/.../projects/2011/05/23/digicommreport-1… · web viewwe have included...
TRANSCRIPT
![Page 1: s.eeweb.coms.eeweb.com/.../projects/2011/05/23/DigicommReport-1… · Web viewWe have included the following elements in this report about the ... Hamming code. In this ... Now](https://reader034.vdocuments.site/reader034/viewer/2022051717/5a6fc55d7f8b9aac538b60d2/html5/thumbnails/1.jpg)
DIGITAL COMMUNICATION
SYSTEMDESIGN
EE 5362DIGITAL COMMUNICATION PROJECT
FALL 2010
INSTRUCTOR:
Dr. Tracy Jing Liang
Chirag Pandya: 1000722427 Safwan Ahmed Muneer: 1000718848
Saurabh Ghorpade: 1000718850
1
![Page 2: s.eeweb.coms.eeweb.com/.../projects/2011/05/23/DigicommReport-1… · Web viewWe have included the following elements in this report about the ... Hamming code. In this ... Now](https://reader034.vdocuments.site/reader034/viewer/2022051717/5a6fc55d7f8b9aac538b60d2/html5/thumbnails/2.jpg)
ACKNOWLEDGEMENT
It is a great pleasure to have completed the project under Dr. Tracy Jing Liang. We take this opportunity in thanking her and her teaching assistants Davis Kirachaiwanich and Junjie Chen who have taken their precious time and effort in helping us finishing the different stages of the project successfully.
Your’s Faithfully,
Chirag Pandya
Safwan Ahmed Muneer
Saurabh Ghorpade
2
![Page 3: s.eeweb.coms.eeweb.com/.../projects/2011/05/23/DigicommReport-1… · Web viewWe have included the following elements in this report about the ... Hamming code. In this ... Now](https://reader034.vdocuments.site/reader034/viewer/2022051717/5a6fc55d7f8b9aac538b60d2/html5/thumbnails/3.jpg)
CONTENTS
1) About the Project 03
2) Abstract 04
3) System Description 06
i) Transmitterii) Receiver
4) Channel Equalizer 11
i) Minimum Distance Decision ii) Maximum Likelihood Sequence Estimation
5) Channel Coding 17
6) Channel Decoding 18
7) Performance Analysis 19
8) Acknowledgement 22
9) Conclusion 23
10) Program Code (Matlab®) 24
11) References 47
3
![Page 4: s.eeweb.coms.eeweb.com/.../projects/2011/05/23/DigicommReport-1… · Web viewWe have included the following elements in this report about the ... Hamming code. In this ... Now](https://reader034.vdocuments.site/reader034/viewer/2022051717/5a6fc55d7f8b9aac538b60d2/html5/thumbnails/4.jpg)
ABSTRACT
Digital communications is the physical transfer of data (a digital bit stream) over a point-to-point or point-to-multipoint communication channel. Examples of such channels are copper wires, optical fibres, wireless communication channels, and storage media. The data is represented as an electromagnetic signal, such as an electrical voltage, radio-wave, microwave or infrared signal.
While analog communications is the transfer of continuously varying information signal, digital communications is the transfer of discrete messages. The messages are either represented by a sequence of pulses i.e. by means of a line code, or by a limited set of continuously varying wave forms, using a digital modulation method. The pass-band modulation and corresponding demodulation (also known as detection) is carried out by modem equipment. Transmitting data in discrete messages allows for greater signal processing capability.
According to the most common definition of digital signal, both baseband and pass-band signals representing bit-streams are considered as digital transmission, while an alternative definition only considers the baseband signal as digital, and pass-band transmission of digital data as a form of digital-to-analog conversion.
Data transmitted may be digital messages originating from a data source, for example a computer or a keyboard. It may also be an analog signal such as a phone call or a video signal, digitized into a bit-stream for example using pulse-code modulation (PCM) or more advanced source coding (analog-to-digital conversion and data compression) schemes. This source coding and decoding is carried out by codec equipment.
We have designed such a digital communication system in our project with a fixed wireless local area network using MATLAB. In the design of the physical layer of the digital system, we have assumed initially that the noise is zero and then ascertained whether the BER is zero or not. This is done in order to insure the correct design of the digital system. Then we design and make use of 2 types of equalizers:
Maximum Likelihood Sequence Equalizer. Minimum Distance Detection Equalizer.
In a practical digital system, Inter symbol interference is studied and a equalizer is designed in order to overcome it. In order to realize Inter symbol interference, a channel is designed as a finite impulse response filter, so that the output of the channel not only depends on the present value, but also on the past values. In this way Inter symbol interference is introduced in the channel.
4
![Page 5: s.eeweb.coms.eeweb.com/.../projects/2011/05/23/DigicommReport-1… · Web viewWe have included the following elements in this report about the ... Hamming code. In this ... Now](https://reader034.vdocuments.site/reader034/viewer/2022051717/5a6fc55d7f8b9aac538b60d2/html5/thumbnails/5.jpg)
PROJECT SPECIFICATION In this project we had to design a physical layer simulation reference system for a digital
communication system, a fixed wireless local area network (WLAN). The specifications are listed as follows:
• Modulation: BPSK with bits to symbol mapping: 0 → -1, 1 → +1.• Burst structure:
and transmitting such a burst needs 2 ms.• A multipath channel containing three paths, which was modeled as a FIR filter, with filter coefficients H(z) = 1+2z-1-1.5z-2
• Based on hardware requirements, 32 samples/symbol was used.• We used a roll-off factor of 0.25 for the square root raised cosine filter.
We designed a simulation system using MATLAB®, a channel equalizer using MLSE (Viterbi algorithm) and a Minimum Distance Decision (MDD) channel equalizer that we had learnt in this course. We introduced Inter symbol interference for this multipath channel with BPSK modulation and assumed that the channel can be perfectly estimated at the receiver. We have included the following elements in this report about the channel equalizer design :
MLSE and MDD channel equalization scheme that we designed in this project. A plot of the raw bit error rate (BER) obtained via MLSE, i.e., without channel
coding, at (Eb/No) = 10, 12, 14, 16, 18, 20 dB obtained in our simulation. A plot of the raw bit error rate (BER) obtained via MDD channel equalization,
i.e., without channel coding, at (Eb/No) = 10, 12, 14, 16, 18, 20 dB obtained in our simulation. Also we have compared the results with the BER curves obtained via MLSE.
We have also plotted the theoretical BER curve using MDD and compared it with the BER curves obtained in the simulation.
We have made use of linear block codes [6,3,3] with parity check matrix
H=[10 1100111 01001 1001 ] and plotted the coded BER at (Eb/No) = 10, 12, 14, 16, 18, 20 dB
obtained in our simulation and made analysis of the theoretical BER based on MLSE and MDD performance.
We have compare the plots obtained in (2), (3), (4) and (5) and calculated the dB gain achieved at BER = 2%.
5
![Page 6: s.eeweb.coms.eeweb.com/.../projects/2011/05/23/DigicommReport-1… · Web viewWe have included the following elements in this report about the ... Hamming code. In this ... Now](https://reader034.vdocuments.site/reader034/viewer/2022051717/5a6fc55d7f8b9aac538b60d2/html5/thumbnails/6.jpg)
SYSTEM DESCRIPTION
Fig.1: Block diagram of Digital Communication System
TRANSMITTER:
Following are the main components of transmitter design. Information bits Burst Builder Modulation Up sampling Pulse Shaping filter Channel
INFORMATION BITS:
In this project, we have made use of 800 information bits which later undergo size enhancement in terms of the number of bits, when the payload is sent through a burst builder. The burst builder adds redundancy to these bits, so that the information bits can be easily recovered at the receive end.
6
![Page 7: s.eeweb.coms.eeweb.com/.../projects/2011/05/23/DigicommReport-1… · Web viewWe have included the following elements in this report about the ... Hamming code. In this ... Now](https://reader034.vdocuments.site/reader034/viewer/2022051717/5a6fc55d7f8b9aac538b60d2/html5/thumbnails/7.jpg)
BURST BUILDER:
Fig.2: A sample message with individual size
GUARD BITS:
Guard bits are necessary to avoid data losses at the time of recovering the signal from the received message. Guard bits can be any bits which do not contain any information. As the name suggests they are only used for guarding the message and the information contained in it. For our project we have taken guard bits of length 5 - [0 0 0 0 0].
UNIQUE WORD:
We have made use of a 64 bit unique word in this project. Bits - 00101110 are repeated 8 times to obtain the unique word. In a practical digital system, the channel is unknown so we make use of a unique word to retrieve data. The process of adding a unique work helps us in the received signal decision making process.
TAIL BITS:
Two tail bits are attached to the message to denote the end of message. These bits do not carry any useful information and are used to decode the information in the received message. Tail bits are followed by another set of guard bits.
So thus at the end of the burst builder arrangement, the total number of bits increases to 876 = 5 guard bits + 64 unique word bits + 800 information bits + 2 tail bits + 5 guard bits.
BPSK MODULATION:
BPSK modulation is performed to render the message less prone to error. This action will also enable the easy recovery of the information at the receiver end. The modulation is achieved by mapping bit 0 to -1 and bit 1 to +1. In practical systems error is introduced during transmission, hence in order to recover the information easily we introduce a difference in these information bits by doing it to symbol mapping. So thus 876 bits get mapped to 876 samples after the modulation.
UP SAMPLING
Up sampling is performed in order to reduce the effect of noise in the transmitted message. In our project we have implemented a 32sample/ bit up sampling. So thus the total number of samples increases to 876 * 32 = 28,032 samples.
7
![Page 8: s.eeweb.coms.eeweb.com/.../projects/2011/05/23/DigicommReport-1… · Web viewWe have included the following elements in this report about the ... Hamming code. In this ... Now](https://reader034.vdocuments.site/reader034/viewer/2022051717/5a6fc55d7f8b9aac538b60d2/html5/thumbnails/8.jpg)
0 10 20 30 40 50 60 70 80 90 100-0.05
0
0.05
0.1
0.15
0.2
0.25
0.3
Fig.3a: Part of burst in symbol domain Fig.3b: Up sampling
PULSE SHAPING FILTER:
We have used this block in our project to generate a waveform, improve system performance and provide signal synchronization. This block acts like a low pass filter to remove noise and other periodic signals. As we add zeros in between two symbols we have to the assign values to these newly appended bits. We have used the RCOSINE filter feature, available in MATLAB, to achieve the desired result. The shape of RCOSINE filter is shown below. The result that we obtain after implementing RCOSINE filter is convolved with newly appended samples to achieve pulse shaping. We can also call this process as interpolation.
Fig.4: RCOSINE plot
8
![Page 9: s.eeweb.coms.eeweb.com/.../projects/2011/05/23/DigicommReport-1… · Web viewWe have included the following elements in this report about the ... Hamming code. In this ... Now](https://reader034.vdocuments.site/reader034/viewer/2022051717/5a6fc55d7f8b9aac538b60d2/html5/thumbnails/9.jpg)
Now,
Length of burst= M
Length of filter= L
Length of convolved signal= L+M-1
We should make the length of convolved signal same as input signal. So we will cut L-1 extra samples. Thus we remove (L-1)/2 samples at the start of the burst and (L-1)/2 samples at the end of the burst. As we are adding guard symbols, cutting symbols at the start and end would not affect the information in anyway.
In time domain we have infinite long sinc function, but we cannot implementing an infinite length function is impractical. Hence we roll it off or use approximation. We have used a roll off factor of 0.25 in our project.
CHANNEL:
In the beginning of our project implementation we try to achieve a BER of 0 by implementing a single path channel. Then we model the channel as a FIR filter described by the following equation – H(z) = 1 + 2z-1 – 1.5 z-2.
RECEIVER:
Following are the main components of our receiver design.
Matched Filter Down sampling Equalizer/Demodulator Burst Extractor BER calculator
MATCHED FILTER:
Matched filter does the same function as did our pulse shaping at the transmitter. Thus we perform convolution using the RCOSINE filter with the received signal. This operation acts like de-convolution, that is, it will nullify the effect of convolution done at the transmitter end.
DOWN SAMPLING:
The output of matched filter is in sample domain so we will convert it in into symbol domain again. Thus our output after the down sampling has 876 symbols.
9
![Page 10: s.eeweb.coms.eeweb.com/.../projects/2011/05/23/DigicommReport-1… · Web viewWe have included the following elements in this report about the ... Hamming code. In this ... Now](https://reader034.vdocuments.site/reader034/viewer/2022051717/5a6fc55d7f8b9aac538b60d2/html5/thumbnails/10.jpg)
EQUALIZER:
We make use of an equalizer to demodulate the original information. By making use of this block we can map the 876 symbols back to 876 bits.
Since, we make use of an FIR filter, we need to make use of an equalizer. As discussed above, we have designed and implemented 2 types of equalization:
Maximum Likely Hood Sequence Detector Minimum Distance Decision Rule
BURST EXTRACTOR:
It removes the guard bits, unique word and tail bits to give us only the information bits. Thus at the end of this block we obtain the original 800 information bits.
CHANNEL DECODER:
We know that, S=H * r where S- Syndrome, H- Parity check matrix, r- Received signal.
From these parameters we know H and r, therefore we can get S from above equation. And since each S map to each e (error), we finally obtain the corrected codeword from the equation - C = r + e.
Finally, we calculate the BER for both types of equalizations and compare the value with those obtained theoretically.
CHANNEL EQUALIZER:There are five types of channel equalizers:
Bayes Decision rule Minimum Distance Desicision(MDD) Maximum Likely Hood sequence detection(MLSE) Zero Forcing channel equalizer Least mean square error channel equalizer
Among the above equalizers, MLSE equalizer gives us the best performance. However, this equalizer is also difficult to implement.
MINIMUM DISTANCE DECISION EQUALIZER:
10
![Page 11: s.eeweb.coms.eeweb.com/.../projects/2011/05/23/DigicommReport-1… · Web viewWe have included the following elements in this report about the ... Hamming code. In this ... Now](https://reader034.vdocuments.site/reader034/viewer/2022051717/5a6fc55d7f8b9aac538b60d2/html5/thumbnails/11.jpg)
In this equalizer we define decision boundary. Then according to nearest node (+1 or -1) we will make decision of the received signal. Minimum distance decoding is also known as nearest neighbor decoding. It can be assisted or automated by using a standard array. Minimum distance decoding is a reasonable decoding method when the following conditions are met:
1. The probability p that an error occurs is independent of the position of the symbol2. Errors are independent events – an error at one position in the message does not affect
other positions
These assumptions may be reasonable for transmission over a binary symmetric channel. They may be unreasonable for other media, such as a DVD, where a single scratch on the disk can cause an error in many neighbor symbols or codewords.
The channel given is 1 +2z-1 - 1.5 z-2
So r(k) = S(k) +2 S(k-1) – 1.5 S(k-2)
So according to this we will make decision boundary and detect the received signal.
11
S(k) S(k-1) S(k-2) r(k)1 1 1 1.51 1 -1 4.51 -1 1 -2.51 -1 -1 0.5-1 1 1 -0.5-1 1 -1 2.5-1 -1 1 -4.5-1 -1 -1 -1.5
![Page 12: s.eeweb.coms.eeweb.com/.../projects/2011/05/23/DigicommReport-1… · Web viewWe have included the following elements in this report about the ... Hamming code. In this ... Now](https://reader034.vdocuments.site/reader034/viewer/2022051717/5a6fc55d7f8b9aac538b60d2/html5/thumbnails/12.jpg)
Fig.5: Decision Boundary for MDD
Where Hypothesis Ho corresponding to -1 and H1 corresponding to +1
In MDD equalizer we assume that channel is unknown. So we will use UNIQUE WORD to determine the channel.
Unique word: 0 0 1 0 1 1 1 0
Modulated unique word: -1 -1 1 -1 1 1 1 -1
We have total 64 bit unique word. Pattern of 8 bit is repeated 8 times.
We should get same received signal for r(8) , r(16), r(24) .. … ….
But because of noise we wouldn’t get the same value. So we would take average of these eight values. From these received signals we will take decision as explain above.
MAXIMUM LIKELIHOOD SEQUENCE ESTIMATION
In our project we have used Viterbi Algorithm to implement MLSE. The Viterbi algorithm is a dynamic programming algorithm for finding the most likely sequence of hidden states – called the Viterbi path – that results in a sequence of observed events, especially in the context of Markov information sources, and more generally, hidden Markov models. The forward algorithm is a closely related algorithm for computing the probability of a sequence of observed events. These algorithms belong to the realm of information theory. To illustrate how the Viterbi Algorithm works to obtain the shortest path, we need to represent the Markov process in a simple way. A state diagram for a channel is often used for this purpose. State diagrams are usually used in a system to describe its behavior. These diagrams can tell the possible state of the system when events occur. Each diagram usually represents objects of a single class and tracks the different states of its objects through the system.
At any time the system being modeled is in some state. There are a finite number of states. While multiple sequences of states (paths) can lead to a given state, at least one of them is a most likely path to that state, called the "survivor path". This is a fundamental assumption of the algorithm because the algorithm will examine all possible paths leading to a state and only keep the one most likely. This way the algorithm does not have to keep track of all possible paths, only one per state.
A second key assumption is that a transition from a previous state to a new state is marked by an incremental metric, usually a number. This transition is computed from the event. The
12
![Page 13: s.eeweb.coms.eeweb.com/.../projects/2011/05/23/DigicommReport-1… · Web viewWe have included the following elements in this report about the ... Hamming code. In this ... Now](https://reader034.vdocuments.site/reader034/viewer/2022051717/5a6fc55d7f8b9aac538b60d2/html5/thumbnails/13.jpg)
third key assumption is that the events are cumulative over a path in some sense, usually additive. So the crux of the algorithm is to keep a number for each state. When an event occurs, the algorithm examines moving forward to a new set of states by combining the metric of a possible previous state with the incremental metric of the transition due to the event and chooses the best. The incremental metric associated with an event depends on the transition possibility from the old state to the new state.
Fig.6: State Diagram of a four state process
A sample of the state diagram and the trellis diagram are shown in this page for reference. The state diagram has 4 states and the trellis diagram has been implemented for the same number of states.
13
![Page 14: s.eeweb.coms.eeweb.com/.../projects/2011/05/23/DigicommReport-1… · Web viewWe have included the following elements in this report about the ... Hamming code. In this ... Now](https://reader034.vdocuments.site/reader034/viewer/2022051717/5a6fc55d7f8b9aac538b60d2/html5/thumbnails/14.jpg)
Fig.7: Trellis for the four-state process
In the starting part of our MLSE code, we have implemented the simultaneous construction of the state diagram and the trellis diagram. This was realized by making use of several for loops, matrices and variables. Once the trellis diagram was successfully constructed, the shortest path from the final state to the initial state of the trellis diagram was obtained. This was obtained by first calculating the distance between the final state and the immediate 2 states backwards the final state and also by ascertaining the value of the present state. Based on the value of the present state and the immediate 2 states backwards the final state, the next present value was evaluated. Based on these values of the present state and the previous state, all 876 bits were evaluated.
CHANNEL CODINGThis component converts bit stream into stream of messages, or source symbols. As we already saw, the channel may cause the receiver to interpret wrong the transmitted source symbols. This component offers more protection for our information, which represented by the bit stream, by adding redundancy to the bit stream and defining source symbols. This additional redundancy would serve the receiver for correct interpretations when the channel garbles some of our bits. The idea to protect our data in a digital manner was quite revolutionary and enabled the development of many advance communication systems such as cellular modems.
We are using LINER BLOCK CODES. Examples of linear block codes are
Repetition code Parity check code Hamming code
14
![Page 15: s.eeweb.coms.eeweb.com/.../projects/2011/05/23/DigicommReport-1… · Web viewWe have included the following elements in this report about the ... Hamming code. In this ... Now](https://reader034.vdocuments.site/reader034/viewer/2022051717/5a6fc55d7f8b9aac538b60d2/html5/thumbnails/15.jpg)
In this project we are using [6 3 3] linear code.
We are getting drastic decrease in BER for MLSE and MDD.
We use m G = C Where m= message bits
G=generator matrix
C=code word
H = [0 1100 11 11 01 01 0110 0 ]
Where H is called as parity check matrix.
If G=[Ik , P] form then H = [Pt , In-k ] form. We are using [6 3 3] code. If we have 3 information bits then we have codeword of 6 bits. So we are taking 249 information bits so we have 498 bits of burst. We will add 2 extra bits so final our burst has 500 bits.
CHANNEL DECODINGWe know S = H * r
Where,
S: Syndrome
H: Parity check matrix
r: Received signal
H and r are known, therefore we then can get S from above equation. Depending on the syndrome we then use the lookup table to obtain e.
000000 100110 010011 001111 110101 101001 011100 111010 (000)t
000001 100111 010010 001110 110100 101000 011101 111011 (001)t
000010 100100 010001 001101 110111 101011 011110 111000 (010)t
000100 100010 010111 001011 110001 101101 011000 111110 (100)t
001000 101110 011011 000111 111101 100001 010100 110010 (111)t
010000 110110 000011 011111 10010 111001 001100 101010 (011)t
100000 000110 110011 101111 010101 001001 111100 011010 (110)t
000101 100011 010110 001010 110000 101100 011001 111111 (101)t
Table 3: Standard Array for the [6 3 3] code
15
![Page 16: s.eeweb.coms.eeweb.com/.../projects/2011/05/23/DigicommReport-1… · Web viewWe have included the following elements in this report about the ... Hamming code. In this ... Now](https://reader034.vdocuments.site/reader034/viewer/2022051717/5a6fc55d7f8b9aac538b60d2/html5/thumbnails/16.jpg)
6 8 10 12 14 16 18 2010
-2
10-1
100
plot of raw BER vs SNR for MDD channel equlization
Signal to noise ratio(SNR) in dB ->
raw
bit
erro
r ->
6 7 8 9 10 11 1210
-4
10-3
10-2
10-1
plot of raw BER vs SNR for MLSE channel equlization
Signal to noise ratio(SNR) in dB ->
raw
bit
erro
r ->
and since each S map to each e (error), we finally obtain the received codeword from the equation C=r+ e. Now we compare the received code word from the transmitted codeword by doing binary addition. If the result is [0 0 0 0 0], then the received codeword has no errors in it.
RESULT:1) RAW BIT ERROR RATE obtained via MLSE without channel coding
2) RAW BIT ERROR RATE obtained via MDD channel equalization without channel coding
16
![Page 17: s.eeweb.coms.eeweb.com/.../projects/2011/05/23/DigicommReport-1… · Web viewWe have included the following elements in this report about the ... Hamming code. In this ... Now](https://reader034.vdocuments.site/reader034/viewer/2022051717/5a6fc55d7f8b9aac538b60d2/html5/thumbnails/17.jpg)
6 8 10 12 14 16 18 2010
-2
10-1
100
plot of raw BER vs SNR for MDD channel equlization
Signal to noise ratio(SNR) in dB ->
raw
bit
erro
r ->
3) Comparison between practical MDD and theoretical MDD
6 8 10 12 14 16 18 2010
-2
10-1
100
raw BER MDDraw BER theoretical MDD
17
![Page 18: s.eeweb.coms.eeweb.com/.../projects/2011/05/23/DigicommReport-1… · Web viewWe have included the following elements in this report about the ... Hamming code. In this ... Now](https://reader034.vdocuments.site/reader034/viewer/2022051717/5a6fc55d7f8b9aac538b60d2/html5/thumbnails/18.jpg)
4) Coded BER via MLSE
6 6.2 6.4 6.6 6.8 7 7.2 7.4 7.6 7.8 810
-6
10-5
10-4
plot of coded BER vs SNR for MLSE channel equlization
Signal to noise ratio(SNR) in dB ->
raw
bit
erro
r ->
18
![Page 19: s.eeweb.coms.eeweb.com/.../projects/2011/05/23/DigicommReport-1… · Web viewWe have included the following elements in this report about the ... Hamming code. In this ... Now](https://reader034.vdocuments.site/reader034/viewer/2022051717/5a6fc55d7f8b9aac538b60d2/html5/thumbnails/19.jpg)
5) Coded BER via MDD
6 8 10 12 14 16 18 2010
-2
10-1
100
plot of coded BER vs SNR for MDD channel equlization
Signal to noise ratio(SNR) in dB ->
raw
bit
erro
r ->
19
![Page 20: s.eeweb.coms.eeweb.com/.../projects/2011/05/23/DigicommReport-1… · Web viewWe have included the following elements in this report about the ... Hamming code. In this ... Now](https://reader034.vdocuments.site/reader034/viewer/2022051717/5a6fc55d7f8b9aac538b60d2/html5/thumbnails/20.jpg)
6) Comparison of various graphs generated by various methods
20
![Page 21: s.eeweb.coms.eeweb.com/.../projects/2011/05/23/DigicommReport-1… · Web viewWe have included the following elements in this report about the ... Hamming code. In this ... Now](https://reader034.vdocuments.site/reader034/viewer/2022051717/5a6fc55d7f8b9aac538b60d2/html5/thumbnails/21.jpg)
CONCLUSION
1) In this project, we found out that with the introduction of ISI to the channel, large number of errors signal were generated in the received signal. Though, after adding the MLSE channel equalizer which has 8 signal patterns, the BER reduced considerably when compared with the results obtained by MDD. Meaning that MLSE equalizer helps in reducing the BER and helps in retrieving signal almost noise free.
2) We also found out that implementing MDD is easier to implement as compared with MLSE.
3) A signal suffers from nonlinear, linear, and additive distortion when transmitted through a channel. Linear equalizers are commonly used in receivers to compensate for linear channel distortion. So when we add channel coding before burst builder and decode the information bit after burst extractor, we can achieve even better BER comparing to the one without channel coding, which is 1.3 dB more.
4) The Channel coding is a viable method to reduce information rate through the channel and increase reliability. If the coding rate is higher the channel is called as an aggressive channel but is not reliable. Whereas channel coding rate is less, the system is much more stable. This goal is achieved by adding redundancy to the information symbol vector resulting in a longer coded vector of symbols that are distinguishable at the output of the channel.
5) Lastly, increasing timing error will cause system performance degrading more after burst extractor, we can achieve even better BER comparing to the one without channel.
PROGRAM CODE (MATLAB ® ) Code for Q.2
clc;clear all;snr=0;for SNR=1:6snr=snr+1;kn =[0.0994 0.0829 0.0710 0.0621 0.0552 0.0497];% This corresponds to SNR val for count=1:4000
21
![Page 22: s.eeweb.coms.eeweb.com/.../projects/2011/05/23/DigicommReport-1… · Web viewWe have included the following elements in this report about the ... Hamming code. In this ... Now](https://reader034.vdocuments.site/reader034/viewer/2022051717/5a6fc55d7f8b9aac538b60d2/html5/thumbnails/22.jpg)
% Information symbols no_of_infosymbol=800; Infosymbol=randint (1,no_of_infosymbol); % uniqueword uw=[0 0 1 0 1 1 1 0]; uniqueword=cat(2,uw,uw,uw,uw,uw, uw, uw, uw);
% guard guard (1:5) =0; %tail tail(1:2)=1;
%burst structure burst=cat(2,guard,uniqueword,Infosymbol,tail,guard); burst_length= length (burst); % 876
% modulation for i=1:burst_length % modulation 1->1 , 0->-1 if(burst(i)==0) burst_modulation(i)= -1; else burst_modulation(i)=1; end end
% Upsampling m=1;for j=1:burst_length up(m)= burst_modulation(j); for k=1:32 m=m+1; up(m)=0; endendupsample_length = length( up)-1;% length is 28032 ( 876*32)
for i=1:upsample_lengthupsample(i)= up(i);end
filter=rcosine(1,32,'sqrt',0.25);% length is M=193filter_len=length(filter);pulse_op=conv(filter,upsample);pulse_op_len= length (pulse_op);% length is (876*32 + 193 -1)= 28224
% Discarding M-1 samples
cut1=(filter_len-1)/2;cut2= pulse_op_len-cut1;j=1;for i= cut1+1:cut2
22
![Page 23: s.eeweb.coms.eeweb.com/.../projects/2011/05/23/DigicommReport-1… · Web viewWe have included the following elements in this report about the ... Hamming code. In this ... Now](https://reader034.vdocuments.site/reader034/viewer/2022051717/5a6fc55d7f8b9aac538b60d2/html5/thumbnails/23.jpg)
pulseshape_output(j)=pulse_op(i); j=j+1;endpulseshape_op_len=length(pulseshape_output); % length is 876*32= 28032
%channel
for i=1:31 u(i)=0;endh1=1;h2=2;h3=-1.5; filter_output=cat(2,h1,u,h2,u,h3);len_filter_output=length(filter_output); % length = 65channel_conv=conv(pulseshape_output,filter_output);len_channel_conv=length(channel_conv); % length is (876*3)+65-1 = 28096
% discarding M-1 samples
c1= (len_filter_output-1)/2;c2= (len_channel_conv)-c1;j=1;for i= c1+1 : c2 transmit_output(j) = channel_conv(i); j=j+1;endtransmit_output_len= length(transmit_output);
% AWGN NOISE
k=kn(snr);Noise=k*randn(1,transmit_output_len);
tx_output=transmit_output + Noise;
% RECEIVER
% Matched Filter
Matched_filter= rcosine(1,32,'sqrt',0.25);len_Matched_filter= length(Matched_filter); % length 193
Matched_conv=conv(Matched_filter,tx_output);len_Matched_conv=length(Matched_conv); % length 28224
23
![Page 24: s.eeweb.coms.eeweb.com/.../projects/2011/05/23/DigicommReport-1… · Web viewWe have included the following elements in this report about the ... Hamming code. In this ... Now](https://reader034.vdocuments.site/reader034/viewer/2022051717/5a6fc55d7f8b9aac538b60d2/html5/thumbnails/24.jpg)
% discard N-1;
m1= (len_Matched_filter-1)/2;m2= (len_Matched_conv)-m1;j=1;for i= m1+1 : m2 Matched_output(j) = Matched_conv(i); j=j+1;endMatched_output_length=length(Matched_output);
% DOWNSAMPLING
j=1;for i= 1:32:Matched_output_length r(j)=Matched_output(i); j=j+1;end
len=length(r) ; % 876
% MLSE DEMODULATOR
s11=[-1 -1];s12=[1 -1];s13=[-1 1];s14=[1 1]; for i=1:len if(i==1) c_state=s11; for input=-1:2:1 if(input==-1) s1=-1; s2=-1; s3=-1; n_state=s11; c(i,1)=state_value(s1,s2,s3); d(i,1)=(r(i)-c(i,1))^2; min(i,1)=d(i,1); elseif(input==1) s1=1; s2=-1; s3=-1; n_state=s12; c(i,2)=state_value(s1,s2,s3); d(i,2)=(r(i)-c(i,2))^2; min(i,2)=d(i,2); end end elseif(i==2) c_state=s11; for input= -1:2:1 if(input==-1) s1=-1; s2=-1; s3=-1; n_state=s11; c(i,1)=state_value(s1,s2,s3); d(i,1)=(r(i)-c(i,1))^2 + min(i-1,1);
24
![Page 25: s.eeweb.coms.eeweb.com/.../projects/2011/05/23/DigicommReport-1… · Web viewWe have included the following elements in this report about the ... Hamming code. In this ... Now](https://reader034.vdocuments.site/reader034/viewer/2022051717/5a6fc55d7f8b9aac538b60d2/html5/thumbnails/25.jpg)
min(i,1)=d(i,1); elseif(input==1) s1=1; s2=-1; s3=-1; n_state=s12; c(i,2)=state_value(s1,s2,s3); d(i,2)=(r(i)-c(i,2))^2 + min(i-1,1); min(i,2)=d(i,2); end end c_state=s12; for input=-1:2:1 if(input==-1) s1=-1; s2=1; s3=-1; n_state=s13; c(i,3)=state_value(s1,s2,s3); d(i,3)=(r(i)-c(i,3))^2 + min(i-1,2); min(i,3)=d(i,3); elseif(input==1) s1=1; s2=1; s3=-1; n_state=s14; c(i,4)=state_value(s1,s2,s3); d(i,4)=(r(i)-c(i,4))^2 + min(i-1,2); min(i,4)=d(i,4); end end elseif(i>2 && i<len-1) c_state=s11; for input= -1:2:1 if(input==-1) s1=-1; s2=-1; s3=-1; n_state=s11; c(i,1)=state_value(s1,s2,s3); d(i,1)=(r(i)-c(i,1))^2 + min(i-1,1); min(i,1)=d(i,1); elseif(input==1) s1=1; s2=-1; s3=-1; n_state=s12;; c(i,2)=state_value(s1,s2,s3); d(i,2)=(r(i)-c(i,2))^2 + min(i-1,1); min(i,2)=d(i,2); end end c_state=s12; for input=-1:2:1 if(input==-1) s1=-1; s2=1; s3=-1; n_state=s13; c(i,3)=state_value(s1,s2,s3); d(i,3)=(r(i)-c(i,3))^2 + min(i-1,2); min(i,3)=d(i,3); elseif(input==1) s1=1; s2=1; s3=-1; n_state=s14; c(i,4)=state_value(s1,s2,s3);
25
![Page 26: s.eeweb.coms.eeweb.com/.../projects/2011/05/23/DigicommReport-1… · Web viewWe have included the following elements in this report about the ... Hamming code. In this ... Now](https://reader034.vdocuments.site/reader034/viewer/2022051717/5a6fc55d7f8b9aac538b60d2/html5/thumbnails/26.jpg)
d(i,4)=(r(i)-c(i,4))^2 + min(i-1,2); min(i,4)=d(i,4); end end c_state=s13; for input=-1:2:1 if(input==-1) s1=-1; s2=-1; s3=1; n_state=s11; c(i,5)=state_value(s1,s2,s3); d(i,5)=(r(i)-c(i,5))^2 + min(i-1,3); if(d(i,5)<d(i,1)) min(i,1)=d(i,5); end elseif(input==1) s1=1; s2=-1; s3=1; n_state=s12; c(i,6)=state_value(s1,s2,s3); d(i,6)=(r(i)-c(i,6))^2 + min(i-1,3); if(d(i,6)<d(i,2)) min(i,2)=d(i,6); end end end c_state=s14; for input=-1:2:1 if(input==-1) s1=-1; s2=1; s3=1; n_state=s13; c(i,7)=state_value(s1,s2,s3); d(i,7)=(r(i)-c(i,7))^2 + min(i-1,4); if(d(i,7)<d(i,3)) min(i,3)=d(i,7); end elseif(input==1) s1=1; s2=1; s3=1; n_state=s14; c(i,8)=state_value(s1,s2,s3); d(i,8)=(r(i)-c(i,8))^2 + min(i-1,4); if(d(i,8) < d(i,4)) min(i,4)=d(i,8); end end end elseif(i==len-1) c_state=s11; for input= -1:2:1 if(input==-1) s1=-1; s2=-1; s3=-1; n_state=s11; c(i,1)=state_value(s1,s2,s3); d(i,1)=(r(i)-c(i,1))^2 + min(i-1,1); min(i,1)=d(i,1);
26
![Page 27: s.eeweb.coms.eeweb.com/.../projects/2011/05/23/DigicommReport-1… · Web viewWe have included the following elements in this report about the ... Hamming code. In this ... Now](https://reader034.vdocuments.site/reader034/viewer/2022051717/5a6fc55d7f8b9aac538b60d2/html5/thumbnails/27.jpg)
end end c_state=s12; for input=-1:2:1 if(input==-1) s1=-1; s2=1; s3=-1; n_state=s13; c(i,3)=state_value(s1,s2,s3); d(i,3)=(r(i)-c(i,3))^2 + min(i-1,2); min(i,3)=d(i,3); end end c_state=s13; for input=-1:2:1 if(input==-1) s1=-1; s2=-1; s3=1; n_state=s11; c(i,5)=state_value(s1,s2,s3); d(i,5)=(r(i)-c(i,5))^2 + min(i-1,3); if(d(i,5)<d(i,1)) min(i,1)=d(i,5); end end end c_state=s14; for input=-1:2:1 if(input==-1) s1=-1; s2=1; s3=1; n_state=s13; c(i,7)=state_value(s1,s2,s3); d(i,7)=(r(i)-c(i,7))^2 + min(i-1,4); if(d(i,7)<d(i,3)) min(i,3)=d(i,7); end end end elseif(i==len) c_state=s11; for input= -1:2:1 if(input==-1) s1=-1; s2=-1; s3=-1; n_state=s11; c(i,1)=state_value(s1,s2,s3); d(i,1)=(r(i)-c(i,1))^2 + min(i-1,1); min(i,1)=d(i,1); end end c_state=s13; for input=-1:2:1 if(input==-1) s1=-1; s2=-1; s3=1; n_state=s11; c(i,5)=state_value(s1,s2,s3); d(i,5)=(r(i)-c(i,5))^2 + min(i-1,3); if(d(i,5)<d(i,1))
27
![Page 28: s.eeweb.coms.eeweb.com/.../projects/2011/05/23/DigicommReport-1… · Web viewWe have included the following elements in this report about the ... Hamming code. In this ... Now](https://reader034.vdocuments.site/reader034/viewer/2022051717/5a6fc55d7f8b9aac538b60d2/html5/thumbnails/28.jpg)
min(i,1)=d(i,5); end end end endend for k=len:-1:1 if(k==len) min_all=min(k,1); index=1; p_state=state(index); s11=[-1 -1]; s12=[1 -1]; s13=[-1 1]; s14=[1 1]; % switch p_state % case s11 if(p_state==s11) received(k)=s11(1); previous_state1=s11; previous_state2=s13; %case s12 elseif(p_state==s12) received(k)=s12(1); previous_state1=s11; previous_state2=s13; % case s13 elseif(p_state==s13) received(k)=s13(1); previous_state1=s12; previous_state2=s14; %case s14 elseif(p_state==s14) received(k)=s14(1); previous_state1=s12; previous_state2=s14; end elseif(k<len && k>2) cal_index1=find_index(previous_state1); cal_index2=find_index(previous_state2); if(min(k,cal_index1)<min(k,cal_index2)) min_all=min(k,cal_index1); index=cal_index1; else min_all=min(k,cal_index2); index=cal_index2; end min_all; index; p_state=state(index); s11=[-1 -1]; s12=[1 -1]; s13=[-1 1]; s14=[1 1];
28
![Page 29: s.eeweb.coms.eeweb.com/.../projects/2011/05/23/DigicommReport-1… · Web viewWe have included the following elements in this report about the ... Hamming code. In this ... Now](https://reader034.vdocuments.site/reader034/viewer/2022051717/5a6fc55d7f8b9aac538b60d2/html5/thumbnails/29.jpg)
if(p_state==s11) received(k)=s11(1); previous_state1=s11; previous_state2=s13; elseif(p_state==s12) received(k)=s12(1); previous_state1=s11; previous_state2=s13; elseif(p_state==s13) received(k)=s13(1); previous_state1=s12; previous_state2=s14; elseif(p_state==s14) received(k)=s14(1); previous_state1=s12; previous_state2=s14; end elseif (k==2) cal_index1=find_index(previous_state1); cal_index2=find_index(previous_state2); if(min(k,cal_index1)<min(k,cal_index2)) min_all=min(k,cal_index1); index=cal_index1; else min_all=min(k,cal_index2); index=cal_index2; end min_all; index; p_state=state(index); s11=[-1 -1]; s12=[1 -1]; s13=[-1 1]; s14=[1 1]; if(p_state==s11) received(k)=s11(1); previous_state1=s11; elseif(p_state==s12) received(k)=s12(1); previous_state1=s11; elseif(p_state==s13) received(k)=s13(1); previous_state1=s12; elseif(p_state==s14) received(k)=s14(1); previous_state1=s12; end elseif(k==1) cal_index1=find_index(previous_state1); min_all=min(k,cal_index1); index=cal_index1; p_state=state(index); s11=[-1 -1]; s12=[1 -1]; s13=[-1 1]; s14=[1 1]; if(p_state==s11)
29
![Page 30: s.eeweb.coms.eeweb.com/.../projects/2011/05/23/DigicommReport-1… · Web viewWe have included the following elements in this report about the ... Hamming code. In this ... Now](https://reader034.vdocuments.site/reader034/viewer/2022051717/5a6fc55d7f8b9aac538b60d2/html5/thumbnails/30.jpg)
received(k)=s11(1); previous_state1=s11; elseif(p_state==s12) received(k)=s12(1); previous_state1=s11; end endendfor i=len:-1:1 if(i>1) received(i)=received(i-1); endendber=0;for i=1:876 if (received(i)~=burst_modulation(i)) ber=ber+1; endendBER(count)=ber/876;endBER=sum(BER)/4000;Bit_ERR(SNR)=BER;Endsnr1=[6 7 8 9 10 11 12] % since it gives zero value for snr >12semilogy(snr1,Bit_ERR);title('plot of raw BER vs SNR for MLSE channel equlization ');xlabel('Signal to noise ratio(SNR) in dB ->'); ylabel('raw bit error ->');
FUNCTIONS USED FOR CODE 2
function r=state_value(s1,s2,s3)
r=s1 +2*s2 -1.5*s3;end
function index=find_index(state) s11=[-1 -1]; s12=[1 -1]; s13=[-1 1]; s14=[1 1]; if(state==s11) index=1; elseif(state==s12) index=2; elseif(state==s13) index=3; elseif(state==s14) index=4; endfunction p_state=state(index)
30
![Page 31: s.eeweb.coms.eeweb.com/.../projects/2011/05/23/DigicommReport-1… · Web viewWe have included the following elements in this report about the ... Hamming code. In this ... Now](https://reader034.vdocuments.site/reader034/viewer/2022051717/5a6fc55d7f8b9aac538b60d2/html5/thumbnails/31.jpg)
s11=[-1 -1]; s12=[1 -1]; s13=[-1 1]; s14=[1 1]; if(index==1) s1=-1; s2=-1; p_state=s11; elseif(index==2) s1=1; s2=-1; p_state=s12; elseif(index==3) s1=-1; s2=1; p_state=s13; elseif(index==4) s1=1; s2=1; p_state=s14; endend
Code for Q.3
clc;clear all;snr=0;for SNR=1:6kn =[0.0994 0.0829 0.0710 0.0621 0.0552 0.0497];% This corresponds to SNR valfor count=1:4000
% Information symbols no_of_infosymbol=800; Infosymbol=randint (1,no_of_infosymbol); % uniqueword uw=[0 0 1 0 1 1 1 0]; uniqueword=cat(2,uw,uw,uw,uw,uw, uw, uw, uw);
% guard guard (1:5) =0; %tail tail(1:2)=1;
31
![Page 32: s.eeweb.coms.eeweb.com/.../projects/2011/05/23/DigicommReport-1… · Web viewWe have included the following elements in this report about the ... Hamming code. In this ... Now](https://reader034.vdocuments.site/reader034/viewer/2022051717/5a6fc55d7f8b9aac538b60d2/html5/thumbnails/32.jpg)
%burst structure burst=cat(2,guard,uniqueword,Infosymbol,tail,guard); burst_length= length (burst); % 876
% modulation for i=1:burst_length % modulation 1->1 , 0->-1 if(burst(i)==0) burst_modulation(i)= -1; else burst_modulation(i)=1; end end % Upsampling m=1;for j=1:burst_length up(m)= burst_modulation(j); for k=1:32 m=m+1; up(m)=0; endendupsample_length = length( up)-1;% length is 28032 ( 876*32)
for i=1:upsample_lengthupsample(i)= up(i);end
% Filterfilter=rcosine(1,32,'sqrt',0.25);% length is M=193filter_len=length(filter);pulse_op=conv(filter,upsample);pulse_op_len= length (pulse_op);% length is (876*32 + 193 -1)= 28224
% Discarding M-1 samples
cut1=(filter_len-1)/2;cut2= pulse_op_len-cut1;j=1;for i= cut1+1:cut2 pulseshape_output(j)=pulse_op(i); j=j+1;endpulseshape_op_len=length(pulseshape_output); % length is 876*32= 28032
%channel
for i=1:31 u(i)=0;endh1=1;h2=2;h3=-1.5;
32
![Page 33: s.eeweb.coms.eeweb.com/.../projects/2011/05/23/DigicommReport-1… · Web viewWe have included the following elements in this report about the ... Hamming code. In this ... Now](https://reader034.vdocuments.site/reader034/viewer/2022051717/5a6fc55d7f8b9aac538b60d2/html5/thumbnails/33.jpg)
filter_output=cat(2,h1,u,h2,u,h3);len_filter_output=length(filter_output); % length = 65channel_conv=conv(pulseshape_output,filter_output);len_channel_conv=length(channel_conv); % length is (876*3)+65-1 = 28096
% discarding M-1 samples
c1= (len_filter_output-1)/2;c2= (len_channel_conv)-c1;j=1;for i= c1+1 : c2 transmit_output(j) = channel_conv(i); j=j+1;endtransmit_output_len= length(transmit_output);
% AWGN NOISEk=kn(snr);Noise=k*randn(1,transmit_output_len);
tx_output=transmit_output + Noise;
% RECEIVER
% Matched Filter
Matched_filter= rcosine(1,32,'sqrt',0.25);len_Matched_filter= length(Matched_filter); % length 193
Matched_conv=conv(Matched_filter,tx_output);len_Matched_conv=length(Matched_conv); % length 28224
% discard N-1;
m1= (len_Matched_filter-1)/2;m2= (len_Matched_conv)-m1;j=1;for i= m1+1 : m2 Matched_output(j) = Matched_conv(i); j=j+1;endMatched_output_length=length(Matched_output);
% DOWNSAMPLING
33
![Page 34: s.eeweb.coms.eeweb.com/.../projects/2011/05/23/DigicommReport-1… · Web viewWe have included the following elements in this report about the ... Hamming code. In this ... Now](https://reader034.vdocuments.site/reader034/viewer/2022051717/5a6fc55d7f8b9aac538b60d2/html5/thumbnails/34.jpg)
j=1;for i= 1:32:Matched_output_length downsample(j)= Matched_output(i); j=j+1;end
len_downsample=length(downsample);
% MDD demodulation
j=1; for m=1:69 if(m>7) mdd_input(j)=downsample(m); j=j+1; end end mdd_input(63)=0; mdd_input(64)=0; for i=64:-1:1 if(i>1) mdd_input(i)=mdd_input(i-1); end end mdd_input(1)=0; length(mdd_input); k=0; out(1:8)=0; for j=1:8 for i=9:8:56 out(j)=out(j) + mdd_input(k+i); end r(j)=out(j)/6; k=k+1; end b1=(r(7)+r(3))/2; b2=(r(3)+r(8))/2; b3=(r(1)+r(6))/2; b4=(r(5)+r(2))/2; b5=(r(2)+r(4))/2; for i=1:len_downsample if(downsample(i) < b1) output(i)=-1; elseif(downsample(i) < b2 && downsample(i)> b1) output(i)=1; elseif(downsample(i) < b3 && downsample(i)> b2) output(i)=-1; elseif(downsample(i)< b4 && downsample(i)>b3) output(i)=1; elseif(downsample(i)< b5 && downsample(i)>b4) output(i)=-1; elseif( downsample(i)>b5)
34
![Page 35: s.eeweb.coms.eeweb.com/.../projects/2011/05/23/DigicommReport-1… · Web viewWe have included the following elements in this report about the ... Hamming code. In this ... Now](https://reader034.vdocuments.site/reader034/viewer/2022051717/5a6fc55d7f8b9aac538b60d2/html5/thumbnails/35.jpg)
output(i)=1; end end for i=len_downsample:-1:1 if(i>1) output(i)=output(i-1); end end ber=0;for i=1:len_downsample if(output(i)~=burst_modulation(i)) ber=ber+1; endendberber/876*100ber(count)=ber/len_downsample;endBER=0;for i=1:4000 BER=BER+ber(i);endBER=BER/4000;Bit_ERR(SNR)=BER;endfigure;snr2=[6 8 10 12 14 16 18 20] % to get good responsesemilogy(snr2,final_ber);title('plot of raw BER vs SNR for MDD channel equlization ');xlabel('Signal to noise ratio(SNR) in dB ->');ylabel('raw bit error ->');
Code for Q4.
clc;clear all;for b=1:100
% Inforamation symbols no_of_infosymbol=800; Infosymbol=randint (1,no_of_infosymbol); % uniqueword uw=[0 0 1 0 1 1 1 0]; uniqueword=cat(2,uw,uw,uw,uw,uw, uw, uw, uw);
% guard guard (1:5) =0; %tail tail(1:2)=1;
35
![Page 36: s.eeweb.coms.eeweb.com/.../projects/2011/05/23/DigicommReport-1… · Web viewWe have included the following elements in this report about the ... Hamming code. In this ... Now](https://reader034.vdocuments.site/reader034/viewer/2022051717/5a6fc55d7f8b9aac538b60d2/html5/thumbnails/36.jpg)
%burst structure burst=cat(2,guard,uniqueword,Infosymbol,tail,guard); burst_length= length (burst); % 876
% modulation for i=1:burst_length % modulation 1->1 , 0->-1 if(burst(i)==0) burst_modulation(i)= -1; else burst_modulation(i)=1; end end % Upsampling m=1;for j=1:burst_length up(m)= burst_modulation(j); for k=1:32 m=m+1; up(m)=0; endendupsample_length = length( up)-1;% length is 28032 ( 876*32)
for i=1:upsample_lengthupsample(i)= up(i);end
% Filter
filter=rcosine(1,32,'sqrt',0.25);% length is M=193filter_len=length(filter);pulse_op=conv(filter,upsample);pulse_op_len= length (pulse_op);% length is (876*32 + 193 -1)= 28224
% Discarding M-1 samples
cut1=(filter_len-1)/2;cut2= pulse_op_len-cut1;j=1;for i= cut1+1:cut2 pulseshape_output(j)=pulse_op(i); j=j+1;endpulseshape_op_len=length(pulseshape_output); % length is 876*32= 28032
% RECEIVER
% Matched Filter
Matched_filter= rcosine(1,32,'sqrt',0.25);len_Matched_filter= length(Matched_filter); % length 193
Matched_conv=conv(Matched_filter,pulseshape_output);
36
![Page 37: s.eeweb.coms.eeweb.com/.../projects/2011/05/23/DigicommReport-1… · Web viewWe have included the following elements in this report about the ... Hamming code. In this ... Now](https://reader034.vdocuments.site/reader034/viewer/2022051717/5a6fc55d7f8b9aac538b60d2/html5/thumbnails/37.jpg)
len_Matched_conv=length(Matched_conv); % length 28224
% discard N-1;
m1= (len_Matched_filter-1)/2;m2= (len_Matched_conv)-m1;j=1;for i= m1+1 : m2 Matched_output(j) = Matched_conv(i); j=j+1;endMatched_output_length=length(Matched_output);
% DOWNSAMPLING
j=1;for i= 1:32:Matched_output_length downsample(j)= Matched_output(i); j=j+1;endlen_downsample=length(downsample);
%Signal Power
P_signal=0;for i=1:len_downsample P_signal=downsample(i)^2+ P_signal;endP_S(b)=(P_signal)/len_downsample;endSignal_Power=0;for i=1:100 Signal_Power=P_S(i)+Signal_Power;end
Signal_Power=Signal_Power/100 % it is 0.9935
snr=[10 12 14 16 18 20];for i=1:length(snr)x1=1/ sqrt(signal_power /snr(i)) ;x2=0.5/ sqrt(signal_power /snr(i)) ;x3=1.5/ sqrt(signal_power /snr(i)) ;
ber(i)= 0.5((2*(erfc(x1/sqrt(2)))) + 3*(erfc(x2/sqrt(2)))+ 2*(erfc(x3/sqrt(2)))); endfigure;snr3=[6 8 10 12 14 16 18 20] % to get good responsesemilogy(snr3,ber);title('plot of raw BER vs SNR for MDD theoretical channel equlization ');xlabel('Signal to noise ratio(SNR) in dB ->');ylabel('raw bit error ->');
37
![Page 38: s.eeweb.coms.eeweb.com/.../projects/2011/05/23/DigicommReport-1… · Web viewWe have included the following elements in this report about the ... Hamming code. In this ... Now](https://reader034.vdocuments.site/reader034/viewer/2022051717/5a6fc55d7f8b9aac538b60d2/html5/thumbnails/38.jpg)
Code for Q.5.1
clc;clear all;snr=0;for SNR=1:6kn =[0.0994 0.0829 0.0710 0.0621 0.0552 0.0497];% This corresponds to SNR valfor count=1:4000
% Encoder
Encoder_info_len=399; info=randint(1,Encoder_info_len) ; % generate information bits G=[1 0 0 1 1 0;0 1 0 0 1 1;0 0 1 1 1 1]; % generator matrix j=1; for i=1:3:Encoder_info_len mat(j,:)=info(i:i+2); codeword(j,:)=mat(j,:)*G; j=j+1; end a=[1 1]; final=[]; cat_val = (Encoder_info_len)/3; for i=1:cat_val p=cat(2,final,codeword(i,:)); end p=cat(2,p,a); p_len=length(p); for i=1:fin_len if(p(:,i) > 1) if(mod(p(:,i),2) == 0) p(:,i)=0; end end if(p(:,i) > 1) if(mod(p(:,i),2) ~= 0) p(:,i)=1; end end end Infosymbol=p;% uniqueword uw=[0 0 1 0 1 1 1 0]; uniqueword=cat(2,uw,uw,uw,uw,uw, uw, uw, uw);
% guard guard (1:5) =0; %tail tail(1:2)=1;
%burst structure burst=cat(2,guard,uniqueword,Infosymbol,tail,guard); burst_length= length (burst); % 876
38
![Page 39: s.eeweb.coms.eeweb.com/.../projects/2011/05/23/DigicommReport-1… · Web viewWe have included the following elements in this report about the ... Hamming code. In this ... Now](https://reader034.vdocuments.site/reader034/viewer/2022051717/5a6fc55d7f8b9aac538b60d2/html5/thumbnails/39.jpg)
% modulation for i=1:burst_length % modulation 1->1 , 0->-1 if(burst(i)==0) burst_modulation(i)= -1; else burst_modulation(i)=1; end end
% Upsampling m=1;for j=1:burst_length up(m)= burst_modulation(j); for k=1:32 m=m+1; up(m)=0; endendupsample_length = length( up)-1;% length is 28032 ( 876*32)
for i=1:upsample_lengthupsample(i)= up(i);end
filter=rcosine(1,32,'sqrt',0.25);% length is M=193filter_len=length(filter);pulse_op=conv(filter,upsample);pulse_op_len= length (pulse_op);% length is (876*32 + 193 -1)= 28224
% Discarding M-1 samples
cut1=(filter_len-1)/2;cut2= pulse_op_len-cut1;j=1;for i= cut1+1:cut2 pulseshape_output(j)=pulse_op(i); j=j+1;endpulseshape_op_len=length(pulseshape_output); % length is 876*32= 28032
%channel
for i=1:31 u(i)=0;endh1=1;h2=2;h3=-1.5; filter_output=cat(2,h1,u,h2,u,h3);len_filter_output=length(filter_output); % length = 65channel_conv=conv(pulseshape_output,filter_output);len_channel_conv=length(channel_conv); % length is (876*3)+65-1 = 28096
39
![Page 40: s.eeweb.coms.eeweb.com/.../projects/2011/05/23/DigicommReport-1… · Web viewWe have included the following elements in this report about the ... Hamming code. In this ... Now](https://reader034.vdocuments.site/reader034/viewer/2022051717/5a6fc55d7f8b9aac538b60d2/html5/thumbnails/40.jpg)
% discarding M-1 samples
c1= (len_filter_output-1)/2;c2= (len_channel_conv)-c1;j=1;for i= c1+1 : c2 transmit_output(j) = channel_conv(i); j=j+1;endtransmit_output_len= length(transmit_output);
% AWGN NOISE
k=kn(snr);Noise=k*randn(1,transmit_output_len);
tx_output=transmit_output + Noise;
% RECEIVER
% Matched Filter
Matched_filter= rcosine(1,32,'sqrt',0.25);len_Matched_filter= length(Matched_filter); % length 193
Matched_conv=conv(Matched_filter,tx_output);len_Matched_conv=length(Matched_conv); % length 28224
% discard N-1;
m1= (len_Matched_filter-1)/2;m2= (len_Matched_conv)-m1;j=1;for i= m1+1 : m2 Matched_output(j) = Matched_conv(i); j=j+1;endMatched_output_length=length(Matched_output);
% DOWNSAMPLING
j=1;for i= 1:32:Matched_output_length r(j)=Matched_output(i); j=j+1;end
40
![Page 41: s.eeweb.coms.eeweb.com/.../projects/2011/05/23/DigicommReport-1… · Web viewWe have included the following elements in this report about the ... Hamming code. In this ... Now](https://reader034.vdocuments.site/reader034/viewer/2022051717/5a6fc55d7f8b9aac538b60d2/html5/thumbnails/41.jpg)
len=length(r) ; % 876
% MLSE DEMODULATOR
s11=[-1 -1];s12=[1 -1];s13=[-1 1];s14=[1 1]; for i=1:len if(i==1) c_state=s11; for input=-1:2:1 if(input==-1) s1=-1; s2=-1; s3=-1; n_state=s11; c(i,1)=state_value(s1,s2,s3); d(i,1)=(r(i)-c(i,1))^2; min(i,1)=d(i,1); elseif(input==1) s1=1; s2=-1; s3=-1; n_state=s12; c(i,2)=state_value(s1,s2,s3); d(i,2)=(r(i)-c(i,2))^2; min(i,2)=d(i,2); end end elseif(i==2) c_state=s11; for input= -1:2:1 if(input==-1) s1=-1; s2=-1; s3=-1; n_state=s11; c(i,1)=state_value(s1,s2,s3); d(i,1)=(r(i)-c(i,1))^2 + min(i-1,1); min(i,1)=d(i,1); elseif(input==1) s1=1; s2=-1; s3=-1; n_state=s12; c(i,2)=state_value(s1,s2,s3); d(i,2)=(r(i)-c(i,2))^2 + min(i-1,1); min(i,2)=d(i,2); end end c_state=s12; for input=-1:2:1 if(input==-1) s1=-1; s2=1; s3=-1; n_state=s13; c(i,3)=state_value(s1,s2,s3); d(i,3)=(r(i)-c(i,3))^2 + min(i-1,2); min(i,3)=d(i,3); elseif(input==1)
41
![Page 42: s.eeweb.coms.eeweb.com/.../projects/2011/05/23/DigicommReport-1… · Web viewWe have included the following elements in this report about the ... Hamming code. In this ... Now](https://reader034.vdocuments.site/reader034/viewer/2022051717/5a6fc55d7f8b9aac538b60d2/html5/thumbnails/42.jpg)
s1=1; s2=1; s3=-1; n_state=s14; c(i,4)=state_value(s1,s2,s3); d(i,4)=(r(i)-c(i,4))^2 + min(i-1,2); min(i,4)=d(i,4); end end elseif(i>2 && i<len-1) c_state=s11; for input= -1:2:1 if(input==-1) s1=-1; s2=-1; s3=-1; n_state=s11; c(i,1)=state_value(s1,s2,s3); d(i,1)=(r(i)-c(i,1))^2 + min(i-1,1); min(i,1)=d(i,1); elseif(input==1) s1=1; s2=-1; s3=-1; n_state=s12;; c(i,2)=state_value(s1,s2,s3); d(i,2)=(r(i)-c(i,2))^2 + min(i-1,1); min(i,2)=d(i,2); end end c_state=s12; for input=-1:2:1 if(input==-1) s1=-1; s2=1; s3=-1; n_state=s13; c(i,3)=state_value(s1,s2,s3); d(i,3)=(r(i)-c(i,3))^2 + min(i-1,2); min(i,3)=d(i,3); elseif(input==1) s1=1; s2=1; s3=-1; n_state=s14; c(i,4)=state_value(s1,s2,s3); d(i,4)=(r(i)-c(i,4))^2 + min(i-1,2); min(i,4)=d(i,4); end end c_state=s13; for input=-1:2:1 if(input==-1) s1=-1; s2=-1; s3=1; n_state=s11; c(i,5)=state_value(s1,s2,s3); d(i,5)=(r(i)-c(i,5))^2 + min(i-1,3); if(d(i,5)<d(i,1)) min(i,1)=d(i,5); end elseif(input==1) s1=1; s2=-1; s3=1; n_state=s12;
42
![Page 43: s.eeweb.coms.eeweb.com/.../projects/2011/05/23/DigicommReport-1… · Web viewWe have included the following elements in this report about the ... Hamming code. In this ... Now](https://reader034.vdocuments.site/reader034/viewer/2022051717/5a6fc55d7f8b9aac538b60d2/html5/thumbnails/43.jpg)
c(i,6)=state_value(s1,s2,s3); d(i,6)=(r(i)-c(i,6))^2 + min(i-1,3); if(d(i,6)<d(i,2)) min(i,2)=d(i,6); end end end c_state=s14; for input=-1:2:1 if(input==-1) s1=-1; s2=1; s3=1; n_state=s13; c(i,7)=state_value(s1,s2,s3); d(i,7)=(r(i)-c(i,7))^2 + min(i-1,4); if(d(i,7)<d(i,3)) min(i,3)=d(i,7); end elseif(input==1) s1=1; s2=1; s3=1; n_state=s14; c(i,8)=state_value(s1,s2,s3); d(i,8)=(r(i)-c(i,8))^2 + min(i-1,4); if(d(i,8) < d(i,4)) min(i,4)=d(i,8); end end end elseif(i==len-1) c_state=s11; for input= -1:2:1 if(input==-1) s1=-1; s2=-1; s3=-1; n_state=s11; c(i,1)=state_value(s1,s2,s3); d(i,1)=(r(i)-c(i,1))^2 + min(i-1,1); min(i,1)=d(i,1); end end c_state=s12; for input=-1:2:1 if(input==-1) s1=-1; s2=1; s3=-1; n_state=s13; c(i,3)=state_value(s1,s2,s3); d(i,3)=(r(i)-c(i,3))^2 + min(i-1,2); min(i,3)=d(i,3); end end c_state=s13; for input=-1:2:1 if(input==-1) s1=-1; s2=-1; s3=1; n_state=s11; c(i,5)=state_value(s1,s2,s3);
43
![Page 44: s.eeweb.coms.eeweb.com/.../projects/2011/05/23/DigicommReport-1… · Web viewWe have included the following elements in this report about the ... Hamming code. In this ... Now](https://reader034.vdocuments.site/reader034/viewer/2022051717/5a6fc55d7f8b9aac538b60d2/html5/thumbnails/44.jpg)
d(i,5)=(r(i)-c(i,5))^2 + min(i-1,3); if(d(i,5)<d(i,1)) min(i,1)=d(i,5); end end end c_state=s14; for input=-1:2:1 if(input==-1) s1=-1; s2=1; s3=1; n_state=s13; c(i,7)=state_value(s1,s2,s3); d(i,7)=(r(i)-c(i,7))^2 + min(i-1,4); if(d(i,7)<d(i,3)) min(i,3)=d(i,7); end end end elseif(i==len) c_state=s11; for input= -1:2:1 if(input==-1) s1=-1; s2=-1; s3=-1; n_state=s11; c(i,1)=state_value(s1,s2,s3); d(i,1)=(r(i)-c(i,1))^2 + min(i-1,1); min(i,1)=d(i,1); end end c_state=s13; for input=-1:2:1 if(input==-1) s1=-1; s2=-1; s3=1; n_state=s11; c(i,5)=state_value(s1,s2,s3); d(i,5)=(r(i)-c(i,5))^2 + min(i-1,3); if(d(i,5)<d(i,1)) min(i,1)=d(i,5); end end end endend for k=len:-1:1 if(k==len) min_all=min(k,1); index=1; p_state=state(index); s11=[-1 -1]; s12=[1 -1]; s13=[-1 1]; s14=[1 1]; % switch p_state
44
![Page 45: s.eeweb.coms.eeweb.com/.../projects/2011/05/23/DigicommReport-1… · Web viewWe have included the following elements in this report about the ... Hamming code. In this ... Now](https://reader034.vdocuments.site/reader034/viewer/2022051717/5a6fc55d7f8b9aac538b60d2/html5/thumbnails/45.jpg)
% case s11 if(p_state==s11) received(k)=s11(1); previous_state1=s11; previous_state2=s13; %case s12 elseif(p_state==s12) received(k)=s12(1); previous_state1=s11; previous_state2=s13; % case s13 elseif(p_state==s13) received(k)=s13(1); previous_state1=s12; previous_state2=s14; %case s14 elseif(p_state==s14) received(k)=s14(1); previous_state1=s12; previous_state2=s14; end elseif(k<len && k>2) cal_index1=find_index(previous_state1); cal_index2=find_index(previous_state2); if(min(k,cal_index1)<min(k,cal_index2)) min_all=min(k,cal_index1); index=cal_index1; else min_all=min(k,cal_index2); index=cal_index2; end min_all; index; p_state=state(index); s11=[-1 -1]; s12=[1 -1]; s13=[-1 1]; s14=[1 1]; if(p_state==s11) received(k)=s11(1); previous_state1=s11; previous_state2=s13; elseif(p_state==s12) received(k)=s12(1); previous_state1=s11; previous_state2=s13; elseif(p_state==s13) received(k)=s13(1); previous_state1=s12; previous_state2=s14; elseif(p_state==s14) received(k)=s14(1); previous_state1=s12; previous_state2=s14; end elseif (k==2) cal_index1=find_index(previous_state1);
45
![Page 46: s.eeweb.coms.eeweb.com/.../projects/2011/05/23/DigicommReport-1… · Web viewWe have included the following elements in this report about the ... Hamming code. In this ... Now](https://reader034.vdocuments.site/reader034/viewer/2022051717/5a6fc55d7f8b9aac538b60d2/html5/thumbnails/46.jpg)
cal_index2=find_index(previous_state2); if(min(k,cal_index1)<min(k,cal_index2)) min_all=min(k,cal_index1); index=cal_index1; else min_all=min(k,cal_index2); index=cal_index2; end min_all; index; p_state=state(index); s11=[-1 -1]; s12=[1 -1]; s13=[-1 1]; s14=[1 1]; if(p_state==s11) received(k)=s11(1); previous_state1=s11; elseif(p_state==s12) received(k)=s12(1); previous_state1=s11; elseif(p_state==s13) received(k)=s13(1); previous_state1=s12; elseif(p_state==s14) received(k)=s14(1); previous_state1=s12; end elseif(k==1) cal_index1=find_index(previous_state1); min_all=min(k,cal_index1); index=cal_index1; p_state=state(index); s11=[-1 -1]; s12=[1 -1]; s13=[-1 1]; s14=[1 1]; if(p_state==s11) received(k)=s11(1); previous_state1=s11; elseif(p_state==s12) received(k)=s12(1); previous_state1=s11; end endendfor i=len:-1:1 if(i>1) received(i)=received(i-1); endend
% Burst Extractor
j=1;for i=1:len_downsample
46
![Page 47: s.eeweb.coms.eeweb.com/.../projects/2011/05/23/DigicommReport-1… · Web viewWe have included the following elements in this report about the ... Hamming code. In this ... Now](https://reader034.vdocuments.site/reader034/viewer/2022051717/5a6fc55d7f8b9aac538b60d2/html5/thumbnails/47.jpg)
if(i>69 && i<870) burst_received(j)=output(i); j=j+1; endendlen_burst=length(burst_received);
% Decoding
for i=1:len_burst if(burst_received(i)==-1) l(i)=0; else l(i)=1; end end len_l=length(l); received=l(1:len_l-2); len_received=length(received); H=[1 0 1 1 0 0; 1 1 1 0 1 0; 0 1 1 0 0 1]; j=1; for i=1:6:len_received r_mat(j,:)=received(i:i+5); syn(j,:)=H*r_mat(j,:)'; j=j+1; end r_cat_val = (len_received)/6; for i=1:r_cat_val for k=1:3 if(syn(i,k)>1) if(mod(syn(i,k),2)==0) syndrom(i,k)=0; else syndrom(i,k)=1; end else syndrom(i,k)=syn(i,k); end end end [row col]=size(syndrom); for i=1:row error(i,:)=error_calculate(syndrom(i,:)); estimated(i,:)=r_mat(i,:)+error(i,:); end received=[]; for p=1:len_estimated received=cat(2,received,estimated(p,:)); end
ber=0;
47
![Page 48: s.eeweb.coms.eeweb.com/.../projects/2011/05/23/DigicommReport-1… · Web viewWe have included the following elements in this report about the ... Hamming code. In this ... Now](https://reader034.vdocuments.site/reader034/viewer/2022051717/5a6fc55d7f8b9aac538b60d2/html5/thumbnails/48.jpg)
for i=70:870 if (received(i)~=burst_modulation(i)) ber=ber+1; endendBER(count)=ber/800;endBER=sum(BER)/4000;Bit_ERR(SNR)=BER;Endsnr4=[6 6.2 6.6 6.8 7 7.2 7.4 7.6 7.8 8]% since it gives zero value for snr>8 semilogy(snr4,Bit_ERR);title('plot of raw BER vs SNR for MLSE channel equlization ');xlabel('Signal to noise ratio(SNR) in dB ->');ylabel('raw bit error ->');
FUNCTIONS USED FOR CODE 5.1
function error=error_calculate(syndrom)
% syndrom=[1 0 0]'; if(syndrom==[0 0 0]) error=[0 0 0 0 0 0]; elseif (syndrom==[0 0 1]) error=[0 0 0 0 0 1]; elseif (syndrom==[0 1 0]) error=[0 0 0 0 1 0]; elseif (syndrom==[1 0 0]) error=[0 0 0 1 0 0]; elseif (syndrom==[1 1 1]) error=[0 0 1 0 0 0]; elseif (syndrom==[0 1 1]) error=[0 1 0 0 0 0]; elseif (syndrom==[1 1 0]) error=[1 0 0 0 0 0]; elseif (syndrom==[1 0 1]) error=[0 0 0 1 0 1]; end
function r=state_value(s1,s2,s3)
r=s1 +2*s2 -1.5*s3;end
function index=find_index(state) s11=[-1 -1]; s12=[1 -1]; s13=[-1 1]; s14=[1 1]; if(state==s11)
48
![Page 49: s.eeweb.coms.eeweb.com/.../projects/2011/05/23/DigicommReport-1… · Web viewWe have included the following elements in this report about the ... Hamming code. In this ... Now](https://reader034.vdocuments.site/reader034/viewer/2022051717/5a6fc55d7f8b9aac538b60d2/html5/thumbnails/49.jpg)
index=1; elseif(state==s12) index=2; elseif(state==s13) index=3; elseif(state==s14) index=4; endfunction p_state=state(index)
s11=[-1 -1]; s12=[1 -1]; s13=[-1 1]; s14=[1 1]; if(index==1) s1=-1; s2=-1; p_state=s11; elseif(index==2) s1=1; s2=-1; p_state=s12; elseif(index==3) s1=-1; s2=1; p_state=s13; elseif(index==4) s1=1; s2=1; p_state=s14; endend
Code for Q.5.2
clc;clear all;snr=0;for SNR=1:6kn =[0.0994 0.0829 0.0710 0.0621 0.0552 0.0497];% This corresponds to SNR valfor count=1:4000
% Encoder
Encoder_info_len=399; info=randint(1,Encoder_info_len) ; % generate information bits G=[1 0 0 1 1 0;0 1 0 0 1 1;0 0 1 1 1 1]; % generator matrix j=1; for i=1:3:Encoder_info_len mat(j,:)=info(i:i+2);
49
![Page 50: s.eeweb.coms.eeweb.com/.../projects/2011/05/23/DigicommReport-1… · Web viewWe have included the following elements in this report about the ... Hamming code. In this ... Now](https://reader034.vdocuments.site/reader034/viewer/2022051717/5a6fc55d7f8b9aac538b60d2/html5/thumbnails/50.jpg)
codeword(j,:)=mat(j,:)*G; j=j+1; end a=[1 1]; final=[]; cat_val = (Encoder_info_len)/3; for i=1:cat_val p=cat(2,final,codeword(i,:)); end p=cat(2,p,a); p_len=length(p); for i=1:fin_len if(p(:,i) > 1) if(mod(p(:,i),2) == 0) p(:,i)=0; end end if(p(:,i) > 1) if(mod(p(:,i),2) ~= 0) p(:,i)=1; end end end Infosymbol=p;% uniqueword uw=[0 0 1 0 1 1 1 0]; uniqueword=cat(2,uw,uw,uw,uw,uw, uw, uw, uw);
% guard guard (1:5) =0; %tail tail(1:2)=1;
%burst structure burst=cat(2,guard,uniqueword,Infosymbol,tail,guard); burst_length= length (burst); % 876
% modulation for i=1:burst_length % modulation 1->1 , 0->-1 if(burst(i)==0) burst_modulation(i)= -1; else burst_modulation(i)=1; end end
% Upsampling m=1;for j=1:burst_length up(m)= burst_modulation(j); for k=1:32 m=m+1; up(m)=0; endend
50
![Page 51: s.eeweb.coms.eeweb.com/.../projects/2011/05/23/DigicommReport-1… · Web viewWe have included the following elements in this report about the ... Hamming code. In this ... Now](https://reader034.vdocuments.site/reader034/viewer/2022051717/5a6fc55d7f8b9aac538b60d2/html5/thumbnails/51.jpg)
upsample_length = length( up)-1;% length is 28032 ( 876*32)
for i=1:upsample_lengthupsample(i)= up(i);end
filter=rcosine(1,32,'sqrt',0.25);% length is M=193filter_len=length(filter);pulse_op=conv(filter,upsample);pulse_op_len= length (pulse_op);% length is (876*32 + 193 -1)= 28224
% Discarding M-1 samples
cut1=(filter_len-1)/2;cut2= pulse_op_len-cut1;j=1;for i= cut1+1:cut2 pulseshape_output(j)=pulse_op(i); j=j+1;endpulseshape_op_len=length(pulseshape_output); % length is 876*32= 28032
%channel
for i=1:31 u(i)=0;endh1=1;h2=2;h3=-1.5; filter_output=cat(2,h1,u,h2,u,h3);len_filter_output=length(filter_output); % length = 65channel_conv=conv(pulseshape_output,filter_output);len_channel_conv=length(channel_conv); % length is (876*3)+65-1 = 28096
% discarding M-1 samples
c1= (len_filter_output-1)/2;c2= (len_channel_conv)-c1;j=1;for i= c1+1 : c2 transmit_output(j) = channel_conv(i); j=j+1;endtransmit_output_len= length(transmit_output);
% AWGN NOISE
k=kn(snr);Noise=k*randn(1,transmit_output_len);
tx_output=transmit_output + Noise;
51
![Page 52: s.eeweb.coms.eeweb.com/.../projects/2011/05/23/DigicommReport-1… · Web viewWe have included the following elements in this report about the ... Hamming code. In this ... Now](https://reader034.vdocuments.site/reader034/viewer/2022051717/5a6fc55d7f8b9aac538b60d2/html5/thumbnails/52.jpg)
% RECEIVER
% Matched Filter
Matched_filter= rcosine(1,32,'sqrt',0.25);len_Matched_filter= length(Matched_filter); % length 193
Matched_conv=conv(Matched_filter,tx_output);len_Matched_conv=length(Matched_conv); % length 28224
% discard N-1;
m1= (len_Matched_filter-1)/2;m2= (len_Matched_conv)-m1;j=1;for i= m1+1 : m2 Matched_output(j) = Matched_conv(i); j=j+1;endMatched_output_length=length(Matched_output);
% DOWNSAMPLING
j=1;for i= 1:32:Matched_output_length r(j)=Matched_output(i); j=j+1;end
len=length(r) ; % 876
% MDD DEMODULATION j=1; for m=1:69 if(m>7) mdd_input(j)=downsample(m); j=j+1; end end mdd_input(63)=0; mdd_input(64)=0; for i=64:-1:1 if(i>1) mdd_input(i)=mdd_input(i-1); end end mdd_input(1)=0; length(mdd_input);
52
![Page 53: s.eeweb.coms.eeweb.com/.../projects/2011/05/23/DigicommReport-1… · Web viewWe have included the following elements in this report about the ... Hamming code. In this ... Now](https://reader034.vdocuments.site/reader034/viewer/2022051717/5a6fc55d7f8b9aac538b60d2/html5/thumbnails/53.jpg)
k=0; out(1:8)=0; for j=1:8 for i=9:8:56 out(j)=out(j) + mdd_input(k+i); end r(j)=out(j)/6; k=k+1; end b1=(r(7)+r(3))/2; b2=(r(3)+r(8))/2; b3=(r(1)+r(6))/2; b4=(r(5)+r(2))/2; b5=(r(2)+r(4))/2; for i=1:len_downsample if(downsample(i) < b1) output(i)=-1; elseif(downsample(i) < b2 && downsample(i)> b1) output(i)=1; elseif(downsample(i) < b3 && downsample(i)> b2) output(i)=-1; elseif(downsample(i)< b4 && downsample(i)>b3) output(i)=1; elseif(downsample(i)< b5 && downsample(i)>b4) output(i)=-1; elseif( downsample(i)>b5) output(i)=1; end end for i=len_downsample:-1:1 if(i>1) output(i)=output(i-1); end end% Burst Extractor
j=1;for i=1:len_downsample if(i>69 && i<870) burst_received(j)=output(i); j=j+1; endendlen_burst=length(burst_received);
% Decoding
for i=1:len_burst if(burst_received(i)==-1) l(i)=0; else
53
![Page 54: s.eeweb.coms.eeweb.com/.../projects/2011/05/23/DigicommReport-1… · Web viewWe have included the following elements in this report about the ... Hamming code. In this ... Now](https://reader034.vdocuments.site/reader034/viewer/2022051717/5a6fc55d7f8b9aac538b60d2/html5/thumbnails/54.jpg)
l(i)=1; end end len_l=length(l); received=l(1:len_l-2); len_received=length(received); H=[1 0 1 1 0 0; 1 1 1 0 1 0; 0 1 1 0 0 1]; j=1; for i=1:6:len_received r_mat(j,:)=received(i:i+5); syn(j,:)=H*r_mat(j,:)'; j=j+1; end r_cat_val = (len_received)/6; for i=1:r_cat_val for k=1:3 if(syn(i,k)>1) if(mod(syn(i,k),2)==0) syndrom(i,k)=0; else syndrom(i,k)=1; end else syndrom(i,k)=syn(i,k); end end end [row col]=size(syndrom); for i=1:row error(i,:)=error_calculate(syndrom(i,:)); estimated(i,:)=r_mat(i,:)+error(i,:); end received=[]; for p=1:len_estimated received=cat(2,received,estimated(p,:)); end
ber=0;for i=70:870 if (received(i)~=burst_modulation(i)) ber=ber+1; endendBER(count)=ber/800;endBER=sum(BER)/4000;Bit_ERR(SNR)=BER;endfigure;snr5=[6 8 10 12 14 16 18 20];semilogy(snr5,Bit_ERR);title('plot of raw BER vs SNR for MDD channel equlization ');xlabel('Signal to noise ratio(SNR) in dB ->');
54
![Page 55: s.eeweb.coms.eeweb.com/.../projects/2011/05/23/DigicommReport-1… · Web viewWe have included the following elements in this report about the ... Hamming code. In this ... Now](https://reader034.vdocuments.site/reader034/viewer/2022051717/5a6fc55d7f8b9aac538b60d2/html5/thumbnails/55.jpg)
ylabel('raw bit error ->');grid on;
FUNCTIONS USED FOR CODE 5.2
function error=error_calculate(syndrom)
% syndrom=[1 0 0]'; if(syndrom==[0 0 0]) error=[0 0 0 0 0 0]; elseif (syndrom==[0 0 1]) error=[0 0 0 0 0 1]; elseif (syndrom==[0 1 0]) error=[0 0 0 0 1 0]; elseif (syndrom==[1 0 0]) error=[0 0 0 1 0 0]; elseif (syndrom==[1 1 1]) error=[0 0 1 0 0 0]; elseif (syndrom==[0 1 1]) error=[0 1 0 0 0 0]; elseif (syndrom==[1 1 0]) error=[1 0 0 0 0 0]; elseif (syndrom==[1 0 1]) error=[0 0 0 1 0 1]; end
Code for Q.6
% comparisionsnr1=[6 7 8 9 10 11 12]; % since it gives zero value for snr >12snr2=[6 8 10 12 14 16 18 20]; % to get good response snr3=[6 8 10 12 14 16 18 20]; % to get good responsesnr4=[6 6.2 6.6 6.8 7 7.2 7.4 7.6 7.8 8]; % since it gives zero value for snr> 8snr5=[6 8 10 12 14 16 18 20];snr6=[8 10 12 14 16 18 20];
[snr1,final_ber1]= rawBER_MDD(); % code for Q2 is rawBER_MDD();[snr3,final_ber2]= raw_theoretical_MDD();code for Q4 is raw_theoreticalB_MDD();figure;semilogy(snr1,final_ber1,snr3,final_ber2);legend('raw BER MDD ','raw BER theoretical MDD');grid on; [snr2,final_ber3]= rawBER_MLSE();code for Q3 is rawBER_MLSE();[snr4,final_ber4]= codedBER_MDD();code for Q5.1 is codedBER_MDD();[snr5,final_ber5]= codedBER_MLSE();code for Q5.2 is codedBER_MLSE(); semilogy(snr1,final_ber1,'-o',snr2,final_ber2,'-o',snr3,final_ber3,'-o',snr4,final_ber4,'-o',snr5,final_ber5,'-o');legend('raw BER MDD ','raw BER theoretical MDD','raw BER MLSE','coded BER MDD','coded BER MLSE' );grid on;
55
![Page 56: s.eeweb.coms.eeweb.com/.../projects/2011/05/23/DigicommReport-1… · Web viewWe have included the following elements in this report about the ... Hamming code. In this ... Now](https://reader034.vdocuments.site/reader034/viewer/2022051717/5a6fc55d7f8b9aac538b60d2/html5/thumbnails/56.jpg)
REFERENCES
1. Class Notes by Dr. Liang
2. Class Handouts by Dr. Liang
3. Viterbi, Andrew J. and Audrey M. Viterbi, “Nonlinear Estimation of PSK
4. Modulated Carrier Phase with Application to Burst Digital Transmission,”IEEE Trans. Information Theory, vol. IT-29, no. 4, pp. 543-551, July 1983.
56
![Page 57: s.eeweb.coms.eeweb.com/.../projects/2011/05/23/DigicommReport-1… · Web viewWe have included the following elements in this report about the ... Hamming code. In this ... Now](https://reader034.vdocuments.site/reader034/viewer/2022051717/5a6fc55d7f8b9aac538b60d2/html5/thumbnails/57.jpg)
5. John Proakis, Digital Communications, 4th ed, McGraw-Hill Higher Education, 2000.
6. http://zone.ni.com/cms/images/devzone/tut/code%2041.jpg
7. http://merganser.math.gvsu.edu/david/reed05/projects/jimenez/state.png
57