0% found this document useful (0 votes)
88 views

For NRZ Polar, NRZ Unipolar 1. Description of The Input

The document describes experiments to generate time domain waveforms for various line coding schemes including NRZ, RZ, BPSK, QPSK, and 16-QAM. Random bit sequences are generated as input and mapped to output amplitude levels according to each scheme. For all schemes, MATLAB code uses a time index variable and for loop to map input bits to amplitude values over time, generating the desired waveforms. Key steps and equations for obtaining each type of waveform are provided.

Uploaded by

ASHIRWAD RAY
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
88 views

For NRZ Polar, NRZ Unipolar 1. Description of The Input

The document describes experiments to generate time domain waveforms for various line coding schemes including NRZ, RZ, BPSK, QPSK, and 16-QAM. Random bit sequences are generated as input and mapped to output amplitude levels according to each scheme. For all schemes, MATLAB code uses a time index variable and for loop to map input bits to amplitude values over time, generating the desired waveforms. Key steps and equations for obtaining each type of waveform are provided.

Uploaded by

ASHIRWAD RAY
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 9

EXPERIMENT -1

Generate time domain waveforms for a random bit sequence for the following:
NRZ, RZ polar, RZ unipolar, BPSK, QPSK, QAM.

FOR NRZ POLAR, NRZ UNIPOLAR

1. Description of the input

Randomly 20 binary sequences are generated by the use of the command ‘randi’
in the MATLAB code. It is all either 1’s or 0’s. This is applicable for both NRZ
polar and NRZ unipolar line coding scheme.

2. Description of the output

For NRZ Polar Line coding, all 1’s is mapped to +1 amplitude level and 0’s are
mapped to -1 amplitude level for the entire symbol duration of Tb.

For NRZ Unipolar line coding, all 1’s is mapped to +1 amplitude level and 0’s
are mapped to 0 amplitude level for the entire bit duration.

3. All required waveforms or numerical results


4. How the waveforms or numerical results were obtained briefly
 In the code provided, time axis is defined as

t=0:0.01:length(x);
 Here ‘x’ is the input bits generated of length = 20. So it will print as :
t= 0, 0.01, 0.02, 0.03, 0.04 upto 20.

 In MATLAB, it is t(1) =0 ; t(2) = 0.01; t(3) = 0.02 and so on.


A variable is defined for indexing purpose (in code it is defined as 1).

%NRZ Pulse Shaping


b=1; % for indexing purpose
t=0:0.01:length(x);
for j=1:length(t)
if t(j)<=b
y(j)=p(b);
else
y(j)=p(b);
b=b+1;
end
end
The for loop starts from j =1 , 2, 3,….

 For j=1, it will take t(1) that is value = 0 and it will compare with the
value of b , which is 1. As this condition satisfies, it will take output y(1)
= p(1) = which stores the value of 1st bit in the randomly generated
sequence (either 0 or 1).

 Again for j=2, it will take t(2) that value is 0.01 which is still less than the
value of b (that is 1). The condition is satisfied and it takes output y(2) =
p(1) = the same value as previous .

 In this way, from 0 to 1, it will store same amplitude level ‘y’, be it either
0 or 1 based on randomly generated bits.

 The amplitude level will change when for example – j = 1.01 <=1(the
value of b), it will increment the value of b ; (from the line b=b+1 in the
code) to 2.

 This was the way the waveforms were generated in MATLAB.


FOR RZ POLAR, RZ UNIPOLAR

1. Description of the input

Randomly 20 binary sequences are generated by the use of the command ‘randi’
in the MATLAB code. It is all either 1’s or 0’s. This is applicable for both RZ
polar and NRZ unipolar line coding scheme.

2. Description of the output

For RZ Polar Line coding, all 1’s is mapped to +1 amplitude level for half bit
duration Tb ;whereas for other half it remains as 0 and 0’s are mapped to -1
amplitude level for the half bit duration of Tb.

if ‘1’ is transmitted

if ‘0’ is transmitted

For RZ Unipolar Line coding, all 1’s is mapped to +1 amplitude level for half
bit duration Tb ;whereas for other half it remains as 0 and 0’s are mapped to 0
amplitude level for entire bit duration of Tb.

if ‘1’ is transmitted

if ‘0’ is transmitted

3. All required waveforms or numerical results


5. How the waveforms or numerical results were obtained briefly
 In the code provided, time axis is defined as

t=0:0.01:length(x);
 Here ‘x’ is the input bits generated of length = 20. So it will print as :
t= 0, 0.01, 0.02, 0.03, 0.04 upto 20.

 In MATLAB, it is t(1) =0 ; t(2) = 0.01; t(3) = 0.02 and so on.


A variable is defined for indexing purpose (in code it is defined as 1).
xn1 =[ ]; %empty matrices intialized to store two values
for i = 1:N
if(x(i)==1)
xn = [1 0]
else
xn = [-1 0]
end
xn1 = [xn1 xn]
end
 This program will work in the same manner as that for the NRZ case.
 The only difference is for inputs ‘1’, it takes sequence = [1 0] as
mentioned in the above code for RZ polar and similarly for ‘0’, it takes
sequence = [-1 0] for RZ polar and [0 0] sequence for RZ unipolar case.
FOR BPSK

1. Description of the input

Randomly 20 binary sequences are generated by the use of the command ‘randi’
in the MATLAB code. It is all either 1’s or 0’s.

2. Description of the output

There is a phase change of 180o in every transition from either 0 to 1 or 1 to 0.

3. All required waveforms or numerical results

4. How the waveforms were obtained briefly


 A random input bit stream of 20 was generated
 It is then NRZ polar mapped, such that it will have amplitude levels as +1
and -1.
 From the theory of representation of BPSK signals in signal space:

If ‘1’ is transmitted

If ‘0’ is transmitted
 From the above expressions, we can say a carrier signal is multiplied with
a positive amplitude level if ‘1’ is transmitted, else it is multiplied with a
negative amplitude of same value if ‘0’ is transmitted.
 The 3rd subplot shows the required waveform for BPSK signal.

FOR QPSK

1. Description of the input

Randomly 10 binary sequences are generated by the use of the command ‘randi’
in the MATLAB code. It is all either 1’s or 0’s. It is mapped to +1 and -1.

2. Description of the output

There is a phase change of 180 o in every transition from either 0 to 1 or 1 to 0 of


two even and odd sequence when multiplied with a carrier cosine and sine
signal resulting in a BPSK signal.

3. All required waveforms or numerical results


4. How the waveforms were obtained briefly
 The randomly generated information bit stream is first converted into a
non-return to zero waveform with +1 or -1 levels.
 This NRZ waveform is further de-multiplexed into even and odd bit
streams.
 Each of the even and odd bit streams are picked up from the original
information bit stream and is extended upto 2 sec.
 The even bit stream multiplied with cosine signal and odd bit stream
multiplied with sine signal, both of them is a typical case of BPSK signal.
 On further addition of those two BPSK signals yields a QPSK signal.
Even sequence (be) Inphase BPSK

QPSK
Input bits
Acos(2*pi*f*t)
NRZ Line coding Demultiplexed

Odd sequence (bo) Quadrature phase BPSK

Acos(2*pi*f*t)
FOR 16-ARY QAM

1. Description of the input

Randomly 40 binary sequences are generated by the use of the command ‘randi’
in the MATLAB code. It is all either 1’s or 0’s. It is mapped to +1 and 0
indicating the transmitted bit sequence amplitude.

2. Description of the output

There is a variation in phase and amplitude observed in the output waveform for
16- ary QAM signal.

3. All required waveforms or numerical results

4. How the waveforms were obtained briefly


 Each of the 4 bit combination i.e. from 0000 to 1111 points in the signal
space constellation diagram corresponds to 4 different amplitude levels .
Those are +A, +3A, -A, -3A where A = amplitude value.
 It has a 2 dimensional basis function: one is in-phase component and
another is quadrature phase component
 Those 16 points in the constellation space corresponds to different
amplitude points (AI, AQ) => (-1,-3),(-1,-1),(-1,1),(-1,3),..... and so on.
 Now multiplying the in-phase component of the transmitted bits with the
cosine signal and quadrature phase component multiplication with the
sine signal will yield a QAM signal according to following equation:

You might also like